This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project. See the Cygwin home page for more information.
Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: DirectX and COM objects


Didn't this issue get resolved by using the COM stuff from LCC-Win 
headers.  TRUST ME :) I don't know any details.  I just remember 
reading in a DirectX 5.0 Library port to gnuwin32 that the COM stuff 
had to be borrowed from the LCC-Win32 Compiler.

Regards,
Richard

>Using C it is fairly easy to use DirectX with gcc.
>
>But most of the samples from MS are in C++. It is possible
>to compile those samples using gcc (I use EGCS 1.1.2), but the
>executable program breaks down. This is due to the fact that
>the layout of COM objects (structs with pure virtual members) in gcc
>differs from that supposed by MS. This has been mentioned in this
>list before by Mumit Khan. 
>
>By inspection one finds the following layout for
>         struct Obj {
>             virtual A(...) = 0;
>             virtual B(...) = 0;
>             ....
>         }
>
>     MS                           gcc
>     ==                           ===
>
>    address A (4 bytes)           8 bytes
>    address B (4 bytes)           DA (4 bytes)  address A (4 bytes)
>    ...                           DB (4 bytes)  address B (4 bytes)
>                                  ...
>
>and DA etc has be 0 to get the code produced by gcc to behave as
>expected by MS. 
>
>One possible solution then would be to create a copy of the MS object
>with a layout adapted to gcc. This means rather few changes in the
>but not in all. I suspect that there might be more to an object than
>is seen in the interface declaration, i e there are more things to 
>copy. 
>
>Questions:
>1) Any help?
>2) Is there or will there be a compiler flag in gcc which brings
>   about the "correct" code for MS COM objects?
>
>I don't intend do to do any serious work with DirectX. However it is
>there and  I want to climb it by curiousness.
>
>Magnus Bondesson
>Department of Computing Science
>Chalmers University of Technology
>S-412 96 Gothenburg
>SWEDEN
>
>--
>Want to unsubscribe from this list?
>Send a message to cygwin-unsubscribe@sourceware.cygnus.com
>


_______________________________________________________________
Get Free Email and Do More On The Web. Visit http://www.msn.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com