wrote:
> 1>.main.c(54) : warning C4013: 'GetNumberOfConsoleFonts' non défini
> (e) ; extern retournant int pris par défaut
Il faut les appeler dynamiquement (GetProcAddress())
(il ya aussi SetCurrentConsoleFontEx() pour Vista)
Un exemple =>
#include <windows.h>
#include <iostream>
#include <tchar.h>
#include <conio.h>
typedef BOOL (WINAPI*SCF)
(
IN HANDLE hConsoleOutput,
IN DWORD nFont
);
typedef DWORD (WINAPI*GNOCF)(void) ;
typedef DWORD (WINAPI*GCFI)
(
IN HANDLE hConsoleOutput,
IN BOOL bMaxSize,
IN DWORD dwLength,
OUT PCONSOLE_FONT_INFO lpConsoleFontInfo
) ;
int _tmain(int argc, _TCHAR* argv[])
{
HMODULE hDLL = LoadLibrary(TEXT("kernel32.dll"));
SCF pSetConsoleFont = (SCF)GetProcAddress(hDLL, "SetCon soleFont");
GNOCF pGetNumberOfConsoleFonts = (GNOCF)GetProcAddress( hDLL,
"GetNumberOfConsoleFonts");
GCFI pGetConsoleFontInfo = (GCFI)GetProcAddress(hDLL,
"GetConsoleFontInfo");
if (!pSetConsoleFont || !pGetNumberOfConsoleFonts || ! pGetConsoleFontInfo)
return 1;
HANDLE hStdOut;
hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
DWORD dwNbFonts = pGetNumberOfConsoleFonts();
printf ("Number of Fonts = %drn", dwNbFonts);
CONSOLE_FONT_INFO cfi[50];
DWORD dwFonts = pGetConsoleFontInfo(hStdOut, FALSE, dwN bFonts, cfi) ;
for (int i = 0; i<dwFonts; i++)
{
pSetConsoleFont(hStdOut, i);
printf ("Font number %d - X=%d-Y=%dr n", i, cfi[i].dwFontSize.X,
cfi[i].dwFontSize.Y);
getch();
}
return 0;
}
vive-gauth...@live.fr wrote:
> 1>.main.c(54) : warning C4013: 'GetNumberOfConsoleFonts' non défini
> (e) ; extern retournant int pris par défaut
Il faut les appeler dynamiquement (GetProcAddress())
(il ya aussi SetCurrentConsoleFontEx() pour Vista)
Un exemple =>
#include <windows.h>
#include <iostream>
#include <tchar.h>
#include <conio.h>
typedef BOOL (WINAPI*SCF)
(
IN HANDLE hConsoleOutput,
IN DWORD nFont
);
typedef DWORD (WINAPI*GNOCF)(void) ;
typedef DWORD (WINAPI*GCFI)
(
IN HANDLE hConsoleOutput,
IN BOOL bMaxSize,
IN DWORD dwLength,
OUT PCONSOLE_FONT_INFO lpConsoleFontInfo
) ;
int _tmain(int argc, _TCHAR* argv[])
{
HMODULE hDLL = LoadLibrary(TEXT("kernel32.dll"));
SCF pSetConsoleFont = (SCF)GetProcAddress(hDLL, "SetCon soleFont");
GNOCF pGetNumberOfConsoleFonts = (GNOCF)GetProcAddress( hDLL,
"GetNumberOfConsoleFonts");
GCFI pGetConsoleFontInfo = (GCFI)GetProcAddress(hDLL,
"GetConsoleFontInfo");
if (!pSetConsoleFont || !pGetNumberOfConsoleFonts || ! pGetConsoleFontInfo)
return 1;
HANDLE hStdOut;
hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
DWORD dwNbFonts = pGetNumberOfConsoleFonts();
printf ("Number of Fonts = %drn", dwNbFonts);
CONSOLE_FONT_INFO cfi[50];
DWORD dwFonts = pGetConsoleFontInfo(hStdOut, FALSE, dwN bFonts, cfi) ;
for (int i = 0; i<dwFonts; i++)
{
pSetConsoleFont(hStdOut, i);
printf ("Font number %d - X=%d-Y=%dr n", i, cfi[i].dwFontSize.X,
cfi[i].dwFontSize.Y);
getch();
}
return 0;
}
wrote:
> 1>.main.c(54) : warning C4013: 'GetNumberOfConsoleFonts' non défini
> (e) ; extern retournant int pris par défaut
Il faut les appeler dynamiquement (GetProcAddress())
(il ya aussi SetCurrentConsoleFontEx() pour Vista)
Un exemple =>
#include <windows.h>
#include <iostream>
#include <tchar.h>
#include <conio.h>
typedef BOOL (WINAPI*SCF)
(
IN HANDLE hConsoleOutput,
IN DWORD nFont
);
typedef DWORD (WINAPI*GNOCF)(void) ;
typedef DWORD (WINAPI*GCFI)
(
IN HANDLE hConsoleOutput,
IN BOOL bMaxSize,
IN DWORD dwLength,
OUT PCONSOLE_FONT_INFO lpConsoleFontInfo
) ;
int _tmain(int argc, _TCHAR* argv[])
{
HMODULE hDLL = LoadLibrary(TEXT("kernel32.dll"));
SCF pSetConsoleFont = (SCF)GetProcAddress(hDLL, "SetCon soleFont");
GNOCF pGetNumberOfConsoleFonts = (GNOCF)GetProcAddress( hDLL,
"GetNumberOfConsoleFonts");
GCFI pGetConsoleFontInfo = (GCFI)GetProcAddress(hDLL,
"GetConsoleFontInfo");
if (!pSetConsoleFont || !pGetNumberOfConsoleFonts || ! pGetConsoleFontInfo)
return 1;
HANDLE hStdOut;
hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
DWORD dwNbFonts = pGetNumberOfConsoleFonts();
printf ("Number of Fonts = %drn", dwNbFonts);
CONSOLE_FONT_INFO cfi[50];
DWORD dwFonts = pGetConsoleFontInfo(hStdOut, FALSE, dwN bFonts, cfi) ;
for (int i = 0; i<dwFonts; i++)
{
pSetConsoleFont(hStdOut, i);
printf ("Font number %d - X=%d-Y=%dr n", i, cfi[i].dwFontSize.X,
cfi[i].dwFontSize.Y);
getch();
}
return 0;
}
Voila, j'ai plus que deux fonctions non définies :
1>main.obj : error LNK2001: symbole externe non résolu
_pGetConsoleFontInfo
1>main.obj : error LNK2001: symbole externe non résolu
_pGetNumberOfConsoleFonts
Voila, j'ai plus que deux fonctions non définies :
1>main.obj : error LNK2001: symbole externe non résolu
_pGetConsoleFontInfo
1>main.obj : error LNK2001: symbole externe non résolu
_pGetNumberOfConsoleFonts
Voila, j'ai plus que deux fonctions non définies :
1>main.obj : error LNK2001: symbole externe non résolu
_pGetConsoleFontInfo
1>main.obj : error LNK2001: symbole externe non résolu
_pGetNumberOfConsoleFonts
wrote:
> Voila, j'ai plus que deux fonctions non définies :
> 1>main.obj : error LNK2001: symbole externe non résolu
> _pGetConsoleFontInfo
> 1>main.obj : error LNK2001: symbole externe non résolu
> _pGetNumberOfConsoleFonts
Ells sont définies dans l'exemple ci-dessus (typedef)
vive-gauth...@live.fr wrote:
> Voila, j'ai plus que deux fonctions non définies :
> 1>main.obj : error LNK2001: symbole externe non résolu
> _pGetConsoleFontInfo
> 1>main.obj : error LNK2001: symbole externe non résolu
> _pGetNumberOfConsoleFonts
Ells sont définies dans l'exemple ci-dessus (typedef)
wrote:
> Voila, j'ai plus que deux fonctions non définies :
> 1>main.obj : error LNK2001: symbole externe non résolu
> _pGetConsoleFontInfo
> 1>main.obj : error LNK2001: symbole externe non résolu
> _pGetNumberOfConsoleFonts
Ells sont définies dans l'exemple ci-dessus (typedef)
1>Compilation en cours...
1>main.c
1>.main.c(51) : warning C4013: 'pGetNumberOfConsoleFonts' non défini
(e) ; extern retournant int pris par défaut
1>.main.c(53) : warning C4013: 'pGetConsoleFontInfo' non défini(e) ;
extern retournant int pris par défaut
1>Compilation en cours...
1>main.c
1>.main.c(51) : warning C4013: 'pGetNumberOfConsoleFonts' non défini
(e) ; extern retournant int pris par défaut
1>.main.c(53) : warning C4013: 'pGetConsoleFontInfo' non défini(e) ;
extern retournant int pris par défaut
1>Compilation en cours...
1>main.c
1>.main.c(51) : warning C4013: 'pGetNumberOfConsoleFonts' non défini
(e) ; extern retournant int pris par défaut
1>.main.c(53) : warning C4013: 'pGetConsoleFontInfo' non défini(e) ;
extern retournant int pris par défaut
wrote:
> 1>Compilation en cours...
> 1>main.c
> 1>.main.c(51) : warning C4013: 'pGetNumberOfConsoleFonts' non défini
> (e) ; extern retournant int pris par défaut
> 1>.main.c(53) : warning C4013: 'pGetConsoleFontInfo' non défini(e) ;
> extern retournant int pris par défaut
Si tu mets la définition d'une fonction après le premier appel, c'est
plutôt normal..
vive-gauth...@live.fr wrote:
> 1>Compilation en cours...
> 1>main.c
> 1>.main.c(51) : warning C4013: 'pGetNumberOfConsoleFonts' non défini
> (e) ; extern retournant int pris par défaut
> 1>.main.c(53) : warning C4013: 'pGetConsoleFontInfo' non défini(e) ;
> extern retournant int pris par défaut
Si tu mets la définition d'une fonction après le premier appel, c'est
plutôt normal..
wrote:
> 1>Compilation en cours...
> 1>main.c
> 1>.main.c(51) : warning C4013: 'pGetNumberOfConsoleFonts' non défini
> (e) ; extern retournant int pris par défaut
> 1>.main.c(53) : warning C4013: 'pGetConsoleFontInfo' non défini(e) ;
> extern retournant int pris par défaut
Si tu mets la définition d'une fonction après le premier appel, c'est
plutôt normal..
wrote:
> 1>Compilation en cours...
> 1>main.c
> 1>.main.c(51) : warning C4013: 'pGetNumberOfConsoleFonts' non défini
> (e) ; extern retournant int pris par défaut
> 1>.main.c(53) : warning C4013: 'pGetConsoleFontInfo' non défini(e) ;
> extern retournant int pris par défaut
Si tu mets la définition d'une fonction après le premier appel, c'est
plutôt normal..
vive-gauth...@live.fr wrote:
> 1>Compilation en cours...
> 1>main.c
> 1>.main.c(51) : warning C4013: 'pGetNumberOfConsoleFonts' non défini
> (e) ; extern retournant int pris par défaut
> 1>.main.c(53) : warning C4013: 'pGetConsoleFontInfo' non défini(e) ;
> extern retournant int pris par défaut
Si tu mets la définition d'une fonction après le premier appel, c'est
plutôt normal..
wrote:
> 1>Compilation en cours...
> 1>main.c
> 1>.main.c(51) : warning C4013: 'pGetNumberOfConsoleFonts' non défini
> (e) ; extern retournant int pris par défaut
> 1>.main.c(53) : warning C4013: 'pGetConsoleFontInfo' non défini(e) ;
> extern retournant int pris par défaut
Si tu mets la définition d'une fonction après le premier appel, c'est
plutôt normal..