delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/08/01/22:08:48

From: ebritten AT uci DOT edu (Eric Britten)
Subject: Re: directx
1 Aug 1997 22:08:48 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <33E2B8E3.1B3E4DD8.cygnus.gnu-win32@uci.edu>
References: <3 DOT 0 DOT 3 DOT 32 DOT 19970731094435 DOT 00697934 AT mail DOT mindspring DOT com> <33E23580 DOT F0D012D6 AT uci DOT edu> <33e38f56 DOT 707231 AT smtp DOT netzone DOT com>
Mime-Version: 1.0
X-Mailer: Mozilla 4.01 [en] (Win95; I)
Original-To: gnu-win32 AT cygnus DOT com
X-Priority: 3 (Normal)
Original-Sender: owner-gnu-win32 AT cygnus DOT com

I am glad that the headers in SDK_4_ming_cygwin32
will compile using g++.  I just downloaded the files to patch my mssdk
platform headers.

However the name mangling conventions of VC++ are irrelavent.  If you
write code that uses C++ and OLE it doesn't matter what compiler you
because you only work with interface pointers.  All functions that your
program calls in other DLLs are declared and exported in C with no name
mangling(this doesn't count interface functions but you call them
through pointers).  One calls the C functions to get interface pointers
to objects.  You can work with C++ or C with these functions.  It's
easier in C++ because you type less.  In C you must pass a pointer to
the object as the first parameter of any interface function.  In C++
this is the equivalent of the this pointer which is handled implicitly.
For example:

pUnknown->AddRef(pUnknown);  //C
pUnknown->AddRef();  //C++

And it gets worse if you declare your own objects in C as opposed to
C++.

I have built a shell extension with modifications of the SDK headers and
a shell extension example.  Although it crashed my system I know that
there were no link errors.

Hopefully the headers in SDK_4_ming_cygwin32 will allow me to compile,
link and debug a working shell extension without crashing my Win95
machine.  Thus far I have been unable to so.

Eric Britten

Mikey wrote:

> The headers in SDK_4_ming_cygwin32
> will compile using g++, that isn't
> the major problem, the reason you have to use C for
> the INTERFACE_() declarations is that the
> system dll's were built with VC++,
> which has a different name mangling convention
> than g++.
>
> Unless you want to try to figure out msvc++ name mangling
> and implement that for gnu-win32 g++, you will never
> be able to use any of the C++ routines in the system
> libraries, you will always have to "thunk"
> to C.
>
> On Fri, 01 Aug 1997 12:14:08 -0700, you wrote:
>
> >Derek Greene wrote:
> >
> >Check out....
> > http://dragon.acadiau.ca/~025668b/develop/cygnus/
> >
> >I have also used gnuwin32 to use OLE & COM objects.  I think directx
> >uses a similar interface.  It's not easy, you must use C not C++ for
> >now.  C++ cleans up your code alot, but it doesn't compile the
> Microsoft
> >headers at all.  For some reason the g++ is more peticular about the
> >location of * in a function prototype that returns a pointer.
> >
> >The directx sample doesn't have any problems since it uses C.
> >
> >For instance,
> >int * __stdcall foo();
> >
> >gives an error.  but
> >
> >int __stdcall * foo();
> >
> >does not.
> >
> >Another thing is that if you declare the calling convention for a
> member
> >function of a class, the calling convention is ignored.  This may
> pose a
> >problem since OLE expects stdcall for member functions of COM
> objects.
> >
> >Hope this helps.
> >
> >Eric Britten
> >
> >> has ANYONE managed to port directx to gnu-win32? puh-leez say yes,
> >> puh-leez
> >> say yes....:)
>



-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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