I'm experimenting with a managed VC++ 2005 app to call win32api. I put #include <windows.h> in stdafx.h and call the api function from the global namespace:
The link errors are:Code:HWND hWnd = (HWND)this->Handle.ToPointer(); ::MessageBox(hWnd, L"testing win32api", L"", 0);
I'm sure it's something simple I'm overlooking.Code:Error 1 error LNK2028: unresolved token (0A00000E) "extern "C" int __stdcall MessageBoxW(struct HWND__ *,wchar_t const *,wchar_t const *,unsigned int)" (?MessageBoxW@@$$J216YGHPAUHWND__@@PB_W1I@Z) referenced in function "extern "C" int __clrcall MessageBox(struct HWND__ *,wchar_t const *,wchar_t const *,unsigned int)" (?MessageBox@@$$J0YMHPAUHWND__@@PB_W1I@Z) MyApp.obj Error 2 error LNK2019: unresolved external symbol "extern "C" int __stdcall MessageBoxW(struct HWND__ *,wchar_t const *,wchar_t const *,unsigned int)" (?MessageBoxW@@$$J216YGHPAUHWND__@@PB_W1I@Z) referenced in function "extern "C" int __clrcall MessageBox(struct HWND__ *,wchar_t const *,wchar_t const *,unsigned int)" (?MessageBox@@$$J0YMHPAUHWND__@@PB_W1I@Z) MyApp.obj


Reply With Quote
CornedBee