delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/04/16/03:49:20

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <19990416084707.67943.qmail@hotmail.com>
X-Originating-IP: [129.37.77.221]
From: "Richard Ashwell" <richval AT hotmail DOT com>
To: bond AT cs DOT chalmers DOT se, cygwin AT sourceware DOT cygnus DOT com
Subject: Re: DirectX and COM objects
Date: Fri, 16 Apr 1999 01:47:03 PDT
Mime-Version: 1.0

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 AT sourceware DOT cygnus DOT 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 AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019