Wintab/PASCAL calling convention

Bill Baxter dnewsgroup at billbaxter.com
Tue Mar 11 14:43:44 PDT 2008


Mike wrote:
> Hi!
> 
> I've just bought this nice new gaming keyboard with the fancy LCD 
> (http://www.logitech.com/index.cfm/keyboards/keyboard/devices/3498&cl=us,en) 
> and wanted to ask if anybody has ever translated the SDK to D. If not, 
> I'm currently looking into how much work it would be. If anybody's 
> interested I'll wrap it in a nice class and post it here (don't know 
> when, I've got so much work in my day job currently).
> 
> As a side note (@billbaxter): Maybe you remember that I've said I'd port 
> WinTab to D - I'm in the process of setting up classes for various input 
> devices right now (mostly MIDI control devices like Vestax DJ console), 
> so WinTab is on my todo-asap-list - but, as I said, I have not much time 
> right now, eventually I'll be able to do it. And programming the G15 
> display is simply more fun right now :)

What did you say you did about the Pascal calling convention?  Was that 
you?  Someone explained previously here you have to reverse the order of 
the arguments or something like that, but I can't find the message.

I thought I'd take a shot at porting the header, but all I get is
  Error 42: Symbol Undefined _WTOpenW at 12

I tried the various combinations of making the import lib with /system 
and without.  And making the prototypes extern(Windows) vs extern(C). 
No luck so far.

The entry in WINTAB32.DEF looks like this:
WTOpenW at 12                      @1021

And the prototype i'm using looks like this:
HCTX WTOpenW(HWND, LPLOGCONTEXTW, BOOL);


--bb



More information about the Digitalmars-d mailing list