MC++... unable to compile my code correctly :-(

G

Guest

I m new to MC++ and interoperability and I try to find a bug since a long
time without succes, maybe you can help me ?

(I have a sample project if you want, you can contact me at
(e-mail address removed) too)

I describe the problem:

I have 2 MS VC2003 projects... and have difference between both. The first
one is a MC++ project I have create, the second is the original C++ library
(that works fine!)

1 - Here is my managed class :
----------------------------------------------
public __gc class UFOzSocket
{
private:
addrinfo _hints;
public:
UFOzSocket(AddressFamily addressFamily, SocketType socketType);
~UFOzSocket();
void Connect(EndPoint * remoteEP);
protected:
UFOzSocket();
private:
UDTSOCKET _internalSocket;
};

During debugging, when I see this structure, it is like this :

Structure in the first application, see by the debugger (Bad fields order):
-----------------------------------------------------------------------------
- _hints : addrinfo
+ ai_addr : 0x00000000 sockaddr*
+ ai_addrlen : 0 unsigned __int32
+ ai_canonname : 0x00000000 char*
+ ai_family :2 __int32
+ ai_flags :1 __int32
+ ai_next : 0x00000000 addrinfo*
+ ai_protocol : 0 __int32
+ ai_socktype : 1 __int32

Structure in the second application, see by the debugger (Good fields order):
----------------------------------------------------------------------------------
- hints {ai_flags=1 ai_family=2 ai_socktype=1 ...} addrinfo
+ ai_flags : 1 int
+ ai_family : 2 int
+ ai_socktype : 1 int
+ ai_protocol : 0 int
+ ai_addrlen : 0 unsigned int
+ ai_canonname : 0x00000000 <Bad Ptr> char *
+ ai_addr : 0x00000000 {sa_family=??? sa_data=0x00000002 <Bad
Ptr> } sockaddr *
+ ai_next : 0x00000000 {ai_flags=??? ai_family=???
ai_socktype=??? ...} addrinfo *

So, how can I change this to force the first application to have the same
behavior ?

Thanks for your help

Chris
 
G

Guest

Thanks

but the problem is on the structure "addrinfo" defined like this :

typedef struct addrinfo
{
int ai_flags; // AI_PASSIVE, AI_CANONNAME,
AI_NUMERICHOST
int ai_family; // PF_xxx
int ai_socktype; // SOCK_xxx
int ai_protocol; // 0 or IPPROTO_xxx for IPv4 and IPv6
size_t ai_addrlen; // Length of ai_addr
char * ai_canonname; // Canonical name for nodename
struct sockaddr * ai_addr; // Binary address
struct addrinfo * ai_next; // Next structure in linked list
}
ADDRINFOA, *PADDRINFOA;

in the file "ws2tcpip.h"

and not in one of my files :-( ... so I cannot change it !

It is the problem !!
 
G

Guest

Jochen...

I have a sample project... in a ZIP that is ready, if you want to see to
problem...

It is simple, surely for you (I have see your web site about interop)... but
for me, it sounds complex ( I work on it since 2 week without success :-( )

Thanks for your help
 
J

Jochen Kalmbach [MVP]

Hi Chris!
I have a sample project... in a ZIP that is ready, if you want to see to
problem...

You can mail it to me:

jochen addddd kalmbachnet dottttt de

Greetings
Jochen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top