Archived

This forum has been archived. Please start a new discussion on GitHub.

MFC DLL with ICE

Hello.

Because of my lack of knowledge in C++ and the multi-programming language nature of my project, I'm having trouble debugging my client side DLL (which uses ICE). So I thought of making an MFC DLL with Automation so I can actually debug my application.

So, I used the .Net MFC dll wizard and included the slice definition and ICE headers. When I compile it, im getting the following error:
C:\Ice-1.1.0\include\Ice\Config.h(84) : error C2065: 'WSAGetLastError' : undeclared identifier
C:\Ice-1.1.0\include\IceUtil\Time.h(38) : error C2833: 'operator timeval' is not a recognized operator or type
C:\Ice-1.1.0\include\IceUtil\Time.h(38) : error C2059: syntax error : 'newline'
C:\Ice-1.1.0\include\IceUtil\Time.h(38) : error C2238: unexpected token(s) preceding ';'

Any idea how I can fix this?

Thanks.

Alex

Comments

  • marc
    marc Florida
    WSAGetLastError() is a standard winsock call. By including windows.h (which is included by IceUtil/Config.h), you should get the declaration of this function.

    I'm afraid I don't know enough about the MFC DLL automation. Perhaps it's doing some strange things, such as preventing the winsock headers from being included in windows.h?
  • Hello Marc,

    Thanks for this info. I remember that there is an option to include WINSOCK headers when making an MFC DLL using the wizard.

    Btw. Your correct, incorrect placement of the #include <Ice/Ice.h> in an MFC application will make the .NET compiler complaining about multiple inclusion of the <windows.h> file.

    I'll try including the winsock headers as soon as I get a few bugs squashed today.

    Thanks.

    Alex