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

Thread: What does C4237 mean?

  1. #1
    Join Date
    Dec 2010
    Posts
    907

    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
    Code:
    __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?
    Thanks
    Jack

    Code:
    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
    Location
    Voronezh, Russia
    Posts
    6,603

    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,
    Igor

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)