Logitech G15 Display SDK in D

Mike vertex at gmx.at
Tue Mar 11 17:10:41 PDT 2008


On Wed, 12 Mar 2008 00:26:31 +0100, lutger <lutger.blijdestijn at gmail.com>  
wrote:

> Mike wrote:
>
>> On Tue, 11 Mar 2008 00:58:35 +0100, Lutger  
>> <lutger.blijdestijn at gmail.com>
>> wrote:
>>
>>> I see I didn't get very far, it still compiles and works with dmd 1.022
>>> though.
>>>
>>> I remember having some difficulties with the lib format provided by
>>> logitech, I think I just compiled a dll from this myself or found one
>>> via the internet.
>>
>> I think I'm giving up too ... tried various ways to convert the COFF lib
>> to OMF, the best result was 1 missing symbol. Maybe linking with another
>> linker would help. I'm not sure about the dll thing, since lglcd.lib is
>> just a wrapper that loads the "real" dll. So loading a DLL to load a DLL
>> sounds a bit strange. But there is an alternative implementation, at  
>> least
>> I've found some hints on google. Maybe that's a good way.
> Are you sure it's just an import library? I know I've tried loading the
> functions dynamically from the real dll but that didn't work. I have
> downloaded some binding somewhere and I believe they have just wrapped  
> the
> lib as a dll, so I did that myself. I just tested a simple program on
> windows and it does work, I'll go check it out further, might take a  
> couple
> of days though.
>

So ... I've done some research now :)

lglcd.lib imports the LoadLibrary, RegOpen, RegQuery stuff from windows  
and nothing else. There are some other very interesting symbols in  
lglcd.lib:

- a registry key
- "szPathToDLL"
- "GetInterface"

GetInterface is a symbol that is exported by lglcdapi.dll, so it's save to  
say that this lib does nothing than get the location of lglcdapi.dll and  
fetch an interface from there. That's not too hard to do, and we'll end up  
with a nice D interface to work with instead of C function prototypes.  
Together with the structs and magic numbers from the SDK this should work  
well. It's way past midnight so I probably won't get far tonight, but  
we'll see.


-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/



More information about the Digitalmars-d mailing list