Subject: Re: EGCS-1.0.2-Mingw32
From: [email-masked] (Paul Garceau)

12 Sep 1998 00:13:31 -0700
Message-ID: <[email-masked]>
References: <[email-masked]>
Reply-To: [email-masked]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7BIT
To: Mumit Khan <[email-masked]>
Cc: [email-masked]

Hi folks,

On 10 Sep 98, at 16:21, the Illustrious Mumit Khan wrote:

> On Wed, 9 Sep 1998, Paul Garceau wrote:
> 
> > 
> > 	The latter, C++ mangling.  EGCS-1.0.2-Mingw32 is looking for 
> > IDirectDraw::SetCooperativeLevel.  Headers can only understand
> > IDirectDraw->SetCooperativeLevel.
> 
> Hmmm ... the two are completely incompatible in C++, so I don't what it's
> trying to do.

	Yes.  egcs-1.0.2-mingw32 is attempting to map to a C++ class member 
(IDirectDraw::SetCooperativeLevel(int,dword)) defined within the actual 3d 
Renderer source code to something that it can understand and reference via 
the ddraw.h header file.  The ddraw.h file has no C++ classes references in it.

	However, it is set up to handle C typedef struct member references 
such as IDirectDraw->SetCooperativeLevel(int,dword).

	Thus, if I define the IDirectDraw struct, I should be able to make the 
ddraw.h call.  So, if I can manage to disable the C++ name mangling, it 
seems that I should be able to access the IDirectDraw struct that I do have 
by using the predefined variables in the C++ source code.
	
> 
> Also, note that MS provides a mechanism for accessing all their C++ APIs
> using C only. I don't know much about it, but I know others have used it
> (and I thought you are one of those people).

	Yes, I am.  However, the method has yet to proove that it is either a) 
reliable or b) consistent.  Also, I am doing my primary porting using EGCS-
1.0.2-mingw32 and am not using any MS tools.

> 
> Anyway, please send me a snippet of code so I know what you're asking.

	Ok.

code snippet:

(.h)

class SysGraphics2d:public CSGraphics2d
{
	...
	...
	protected:
	static LPDIRECTDRAW lpDD;
	...
	...
}

(.cpp)

SysGraphics2d* Sys2d;
....
LPDIRECTDRAW SysGraphics2D::lpDD=NULL;
....

SysGraphics2D::SysGraphics2D(int argc, char* argv[]) : csGraphics2D ()
{
	...
	...
	...
	Sys2d=this;
	ddrval = lpDD->SetCooperativeLevel (NULL, DDSCL_NORMAL);
	...
	...
}

	Ok, note the lpDD->SetCooperativeLevel(...) reference above; this is a C 
syntax reference to IDirectDraw, which is included in the ddraw.h file.

	EGCS-1.0.2-Mingw32 translates the call to:

	ddrval = IDirectDraw::SetCooperativeLevel(NULL, DDSCL_NORMAL);

	which is a C++ class::<member reference> (as far as I can tell).

	The questions are:

	"How can I force a C++ source code line of symbols to not be submitted 
to the C++ name mangling process?"
	
	"What are the other alternatives, if any?"

	Hope this helps.

		Peace,

			Paul G.

Information Systems Consultant
NewDawn Productions
http://www.teleport.com/~pgarceau/newdawn/
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".