Results 1 to 3 of 3

Thread: [resolved] VC++ 2005 Link errors with win32api code

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Resolved [resolved] VC++ 2005 Link errors with win32api code

    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:
    Code:
    HWND hWnd = (HWND)this->Handle.ToPointer();
    
    ::MessageBox(hWnd, L"testing win32api", L"", 0);
    The link errors are:
    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
    I'm sure it's something simple I'm overlooking.
    Last edited by wey97; Oct 3rd, 2006 at 07:39 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width