Atlwin.h and VS.NET 2005

I'm working on a project (HydraIRC) using a modified version of atlwin.h. When converting this project to VC8 I've encountered some errors, which all have been resolved except for some with atlwin.h (CWndProcThunk) .
I've tried using the standard atlwin.h (only to meet more errors), and tried several modifications to it. I've tried just replacing the one section with no luck as well. I've used a recent (if not most recent) PSDK, and what was included with VS.NET 2005 standard for this.

Errors:
c:\Documents and Settings\User\Desktop\04.16.06.HydraIRC.VS.NET.2005\HydraIRC - 2005\HydraIRC\include\altered_ms_includes\atlwin.h(2231) : error C2146: syntax error : missing ';' before identifier 'thunk' c:\Documents and Settings\User\Desktop\04.16.06.HydraIRC.VS.NET.2005\HydraIRC - 2005\HydraIRC\include\altered_ms_includes\atlwin.h(2231) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\Documents and Settings\User\Desktop\04.16.06.HydraIRC.VS.NET.2005\HydraIRC - 2005\HydraIRC\include\altered_ms_includes\atlwin.h(2231) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\Documents and Settings\User\Desktop\04.16.06.HydraIRC.VS.NET.2005\HydraIRC - 2005\HydraIRC\include\altered_ms_includes\atlwin.h(2235) : error C2065: 'thunk' : undeclared identifier c:\Documents and Settings\User\Desktop\04.16.06.HydraIRC.VS.NET.2005\HydraIRC - 2005\HydraIRC\include\altered_ms_includes\atlwin.h(2235) : error C2228: left of '.Init' must have class/struct/union type is ''unknown-type'' c:\Documents and Settings\User\Desktop\04.16.06.HydraIRC.VS.NET.2005\HydraIRC - 2005\HydraIRC\include\altered_ms_includes\atlwin.h(2239) : error C2228: left of '.GetCodeAddress' must have class/struct/union type is ''unknown-type''

Here is the altered section of code (I get the same errors in unaltered except they occur throughout the entire file with different sections):
class CWndProcThunk
{
public:
_AtlCreateWndData cd;
CStdCallThunk thunk;

void Init(WNDPROC proc, void* pThis)
{
thunk.Init((DWORD_PTR)proc, pThis);
}
WNDPROC GetWNDPROC()
{
return (WNDPROC)thunk.GetCodeAddress();
}
};

Any ideas / people with similar issues


Answer this question

Atlwin.h and VS.NET 2005

  • kg81

    This is a Microsoft include however, and compiles fine on VS.NET 2003 for other people who are working on the project.
    I am trying to conclude if;
    1. This is a microsoft issue with the latest PSDK and VC8.
    2. I am missing an include that defines CStdCallThunk (atlbase.h is included).
    3. There is some reasonable way for a not so great C++ coder to fix this. (I have worked primarily in delphi in the past).


    Any help would be much appreciated,
    Andrew

  • Carl-Otto

    It can't be a Microsoft issue unless they forgot to test functionality that depends on CStdCallThunk. Extremely unlikely.

    1. Find out where CStdCallThunk is defined. For example:

    C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include>findstr CStdCallThunk *
    atlstdthunk.h:typedef CDynamicStdCallThunk CStdCallThunk;
    atlstdthunk.h:typedef _stdcallthunk CStdCallThunk;
    atlwin.h: CStdCallThunk thunk;

    C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include>findstr CDynamicStdCallThunk *.h
    atlstdthunk.h:class CDynamicStdCallThunk
    atlstdthunk.h: CDynamicStdCallThunk()
    atlstdthunk.h: ~CDynamicStdCallThunk()
    atlstdthunk.h:typedef CDynamicStdCallThunk CStdCallThunk;

    C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include>findstr atlstdthunk.h *.h
    atlcom.h:#include <atlstdthunk.h>
    atlwin.h:#include <atlstdthunk.h>

    2. Follow how your code is being compiled. Two methods: a. the /showIncludes flag shows the headers that are included in your particular build. b. The /P compiler option creates a *.i file that has all the code for a particular compilation unit. You can open this file and inspect it. Remember that /P is for temporary purposes.

    Brian


  • Herru Perdana

    Looks as though CStdCallThunk is not defined.
  • Atlwin.h and VS.NET 2005