c++ - GetCurrentConsoleFont not declared in scope, what I do wrong? -



c++ - GetCurrentConsoleFont not declared in scope, what I do wrong? -

at origin have:

#include <sstream> #include <iostream> #include <stdio.h> #include <iomanip> #include <string> #define _win32_winnt 0x500 //tells win 2000 or higher, without getconsolewindow not work #include <windows.h> using namespace std; int main() { pconsole_font_info lpconsolecurrentfont; getcurrentconsolefont(getstdhandle(std_output_handle), false, lpconsolecurrentfont); homecoming 0; }

and undocumented function setconsolefont works, getcurrentconsolefont fails @ compilation saying not declared in scope.

-- edit: changed self sustained code.

getcurrentconsolefont exported on nt4+ @ least, mingw headers must wrong.

try adding code after #include's:

#ifdef __cplusplus extern "c" { #endif bool winapi getcurrentconsolefont(handle hconsoleoutput,bool bmaximumwindow,pconsole_font_info lpconsolecurrentfont); #ifdef __cplusplus } #endif

your code wrong, should be:

console_font_info consolefontinfo; getcurrentconsolefont(getstdhandle(std_output_handle), false, &consolefontinfo);

(any time see psometype parameter allocate sometype struct on stack , pass pointer struct parameter)

c++ winapi console windows-xp mingw

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -