P
peter
I can't get this code to link properly. I got two error during link:
error LNK2028: unresolved token (0A00000C) "extern "C" int __stdcall
EnumFontFamiliesExW(struct HDC__ *,struct tagLOGFONTW *,int
(__stdcall*)(struct tagLOGFONTW const *,struct tagTEXTMETRICW const
*,unsigned long,long),long,unsigned long)"
(?EnumFontFamiliesExW@@$$J220YGHPAUHDC__@@PAUtagLOGFONTW@@P6GHPBU2@PBUtagTEXTMETRICW@@KJ@ZJK@Z)
referenced in function "int __clrcall main(cli::array<class System::String ^
EnumFontFamiliesExW(struct HDC__ *,struct tagLOGFONTW *,int
(__stdcall*)(struct tagLOGFONTW const *,struct tagTEXTMETRICW const
*,unsigned long,long),long,unsigned long)"
(?EnumFontFamiliesExW@@$$J220YGHPAUHDC__@@PAUtagLOGFONTW@@P6GHPBU2@PBUtagTEXTMETRICW@@KJ@ZJK@Z)
referenced in function "int __clrcall main(cli::array<class System::String ^
//----------- start of code ---------------
#define UNICODE 1
#include "stdafx.h"
#include <windows.h>
int CALLBACK FontNameProc(
ENUMLOGFONTEX *lpelfe,
NEWTEXTMETRICEX *lpntme,
int FontType,
LPARAM lParam
) { return 0; }
int main(array<System::String ^> ^args)
{
LOGFONT logfont;
HDC hdc;
// ignore uninitialized variables warnings for now
EnumFontFamiliesEx(hdc, &logfont, (FONTENUMPROC) FontNameProc, 0, 0);
}
//------------ end of code --------------
The environment is visual C++ express and the IDE, and sdk just downloaded
from microsoft. I also changed a compile-time flag (to disable pure function
or something because of previous warnings). But I can't find where it is
anymore.
Any ideas?
error LNK2028: unresolved token (0A00000C) "extern "C" int __stdcall
EnumFontFamiliesExW(struct HDC__ *,struct tagLOGFONTW *,int
(__stdcall*)(struct tagLOGFONTW const *,struct tagTEXTMETRICW const
*,unsigned long,long),long,unsigned long)"
(?EnumFontFamiliesExW@@$$J220YGHPAUHDC__@@PAUtagLOGFONTW@@P6GHPBU2@PBUtagTEXTMETRICW@@KJ@ZJK@Z)
referenced in function "int __clrcall main(cli::array<class System::String ^
error LNK2019: unresolved external symbol "extern "C" int __stdcall^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z)
EnumFontFamiliesExW(struct HDC__ *,struct tagLOGFONTW *,int
(__stdcall*)(struct tagLOGFONTW const *,struct tagTEXTMETRICW const
*,unsigned long,long),long,unsigned long)"
(?EnumFontFamiliesExW@@$$J220YGHPAUHDC__@@PAUtagLOGFONTW@@P6GHPBU2@PBUtagTEXTMETRICW@@KJ@ZJK@Z)
referenced in function "int __clrcall main(cli::array<class System::String ^
^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z)
//----------- start of code ---------------
#define UNICODE 1
#include "stdafx.h"
#include <windows.h>
int CALLBACK FontNameProc(
ENUMLOGFONTEX *lpelfe,
NEWTEXTMETRICEX *lpntme,
int FontType,
LPARAM lParam
) { return 0; }
int main(array<System::String ^> ^args)
{
LOGFONT logfont;
HDC hdc;
// ignore uninitialized variables warnings for now
EnumFontFamiliesEx(hdc, &logfont, (FONTENUMPROC) FontNameProc, 0, 0);
}
//------------ end of code --------------
The environment is visual C++ express and the IDE, and sdk just downloaded
from microsoft. I also changed a compile-time flag (to disable pure function
or something because of previous warnings). But I can't find where it is
anymore.
Any ideas?