CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2

Thread: What does C4237 mean?

  1. #1
    Join Date
    Dec 2010

    What does C4237 mean?

    warning C4273: 'MyTextOutW' : inconsistent dll linkage

    I am developing the hooker in windows xp using Visual Studio 2010,
    I have linked all kernel32.dll, user32.lib, advapi32.lib.... from the 7.0a sdk
    By definition, WINGDIAPI is just __declspec(dllimport)

    The original prototype is
    __gdi_entry WINGDIAPI BOOL  WINAPI TextOutA( __in HDC hdc, __in int x, __in int y, __in_ecount(c) LPCSTR lpString, __in int c);
    They just match each other, why does the warning occur?

    WINGDIAPI  BOOL    WINAPI MyTextOutA(HDC, int, int, LPCSTR, int); 
    BOOL    WINAPI MyTextOutA(HDC hDC, int a, int b, LPCSTR str, int c)
    	std::string s("TextOutA called");
    	logfile.write(s.c_str(), s.length());
    	return ::TextOutA(hDC, a, b, "Hooked text", 11);

  2. #2
    Join Date
    Nov 2000
    Voronezh, Russia

    Re: What does C4237 mean?

    dllimport hints linker that this function address must be from some dll, and therefore, some import library has to be involved. Imagine how it gets surprised when finds out the symbol is local and has nothing to do with any dll.
    Best regards,

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)