MFC DLL class problem...very strange!
From: Donald Sorenson (dony_s_at_excite.com)
Date: 09/22/04
- Next message: GuitarBill: "Re: Detecting application main window display state?"
- Previous message: Dave: "Re: Writing Active-X programs..."
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 22 Sep 2004 23:42:03 +0200
Well, here is the (strange!) situation. I wrote couple of classes that I
first test in an exe. Then I decided, to export them to an MFC DLL. I
created the DLL and of course, added the AFX_EXT_CLASS (this is not the
first time I'm doing that) to the headers. Now here is the really strange
thing. I'm calling the GetQueuedCompletionStatus(). This function returns
(among other things) an object pointer as part of the IOCP. The pointer that
this function returns (the overlapped pointer) and please be patient here,
is 4 bytes higher then the ACTUAL address of the formerly passed pointer… I
will make it clearer with an example… say I have allocated (and it doesn't
matter if it’s the stack or the free store) an overlapped structure and its
address is, let say, 0x00170000. Now, whenever GetQueuedCompletionStatus()
returns, its returning the value of 0x00170004 in the pointer!... now that
was working fine with the exe, but when passed to the DLL, I got that
strange effect. And no, 0x00170004 is not an address of some other class.
Now bypassing that is real easy, but I want to understand WHY this is
happening. I have created many class DLL like this, and this is the first
time I see something like this…Also, the pointer is allocated in the DLL and
the GetQueuedCompletionStatus()function call is also in the DLL, incase
someone need that info. Anyone has any idea…?
- Next message: GuitarBill: "Re: Detecting application main window display state?"
- Previous message: Dave: "Re: Writing Active-X programs..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|