This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Problem compiling GAPI with legacy Win32 'C' DLL driver code


Problem compiling GAPI with legacy Win32 'C' DLL driver code

Postby HLEW » May 23, 2005 @ 8:29am

I am working on some legacy code written in Win32 'C' that implements a Windows CE driver. The driver is in the form of a DLL.

The driver needs to put animated graphics up on the screen. I am currently using the standard WinGDI functions (BitBlt, etc ...) but the response is too slow.

It looks like the direct access to video memory supplied by GAPI would improve the response.

When I add just the header "gx.h" to the source code I get compile errors.

gx.h(56) : error C2061: syntax error : identifier 'GXGetDisplayProperties'

gx.h(57) : error C2061: syntax error : identifier 'GXGetDefaultKeys'



The lines of code in gx.h are declarations for structures that are to be exported.


GXDLL_API GXDisplayProperties GXGetDisplayProperties();
GXDLL_API GXKeyList GXGetDefaultKeys(int iOptions);


where :


#ifdef GXDLL_EXPORTS
#define GXDLL_API __declspec(dllexport)
#else
#define GXDLL_API __declspec(dllimport)
#endif

and

the definition for the structures are:

struct GXDisplayProperties {
DWORD cxWidth;
DWORD cyHeight; // notice lack of 'th' in the word height.
long cbxPitch; // number of bytes to move right one x pixel - can be negative.
long cbyPitch; // number of bytes to move down one y pixel - can be negative.
long cBPP; // # of bits in each pixel
DWORD ffFormat; // format flags.
};

struct GXKeyList {
short vkUp; // key for up
POINT ptUp; // x,y position of key/button. Not on screen but in screen coordinates.
short vkDown;
POINT ptDown;
short vkLeft;
POINT ptLeft;
short vkRight;
POINT ptRight;
short vkA;
POINT ptA;
short vkB;
POINT ptB;
short vkC;
POINT ptC;
short vkStart;
POINT ptStart;
};




I don't have this problem if I compile the GAPI C++ sample code.


I can make the errors go away if I change the declarations to:


GXDLL_API struct GXDisplayProperties GXGetDisplayProperties();
GXDLL_API struct GXKeyList GXGetDefaultKeys(int iOptions);


When I try to link to the "gx.lib" though the linker can not find functions associated with the GX.LIB that were added to the source code.

I suspect that it is because GX.LIB is expecting a C++ calling convention that supports mangled function and variable names. As a result the 'C' linker does not know how to resolve the external functions in the GX.LIB.

I am compiling for an ARM processor. I have checked to see that I have the correct library specified and I have specified the path in the include for gx.h.


Has anyone had experience trying to use the GAPI library with a Win32 C program? A work around would be great.

Alternatively, can someone suggest a third party graphics library. It looks like PocketHAL, PocketFROG and EasyCE as C++ based libraries. Fastgraph seems to be one of the few that support C.
HLEW
pm Member
 
Posts: 2
Joined: May 23, 2005 @ 8:22am


Postby gamefreaks » May 25, 2005 @ 11:41am

What if everything is an illusion and nothing exists? In that case, I definitely overpaid for my carpet. -Woody Allen
User avatar
gamefreaks
pm Insider
 
Posts: 466
Joined: Oct 20, 2001 @ 8:52pm
Location: Leicester, England


Problem compiling GAPI with legacy Win32 'C' DLL driver code

Postby HLEW » May 27, 2005 @ 10:35am

HLEW
pm Member
 
Posts: 2
Joined: May 23, 2005 @ 8:22am


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron