Jump to content

Linking older VS libs in a project


Flexman
 Share

Recommended Posts

One of the elements in the DirectInput DLL I made is a feature that detects the OEM flags of a device using GetDeviceInfo(DIDEVICEINSTANCE)

The reason for this is that I need to support some some LED features on the device. A small OEM library is provided to support these.

 

The code snippet below is just an example of how to pull out some manufacturer info for a specific device instance (joystick).

 


CONST DWORD VID_LOGITECH = 0x046d;
CONST DWORD VID_MICROSOFT = 0x045e;

...

DIDEVICEINSTANCE  device;

/* MUST set these for any DI structure before use or bad things happen */
ZeroMemory(&device, sizeof(device));
device.dwSize = sizeof(device);

if (FAILED(hr = joystick->GetDeviceInfo(&device))) {
return hr;
}
...
...
DWORD vidPid_ = device.guidProduct.Data1;
this->vid = LOWORD(vidPid_);
this->pid = HIWORD(vidPid_);

if (VID_LOGITECH == this->vid) {
  /*  do some OEM stuff here */
  if (PID_G940_THROTTLE == this->pid ) {
     /* the product ID matches special hardware so do something here */
  }
}

 

 

I don't have a problem per say, I'm more in deed of reassurance and guidance. The extras library for LED control is provided 'as is' by Logitech and compiled using Visual Studio 2008 however since I'm working with a more recent (VS2010) editor I get the LNK4099 error.

 

Now I can get it to link by changing the project options [ LINKER > Debugging > Generate Debug Info = "No" ]. I think it's complaining that the object data in the supplied library isn't in a format VS2010 likes. It seems to work OK and I can set all the special lamp switches, LED colour and all the joystick functions no problem. Even multiple devices (I have 3 HOTAS systems plugged in at the same time, that about 1,000 UKP worth of flight simulation controls). And I'm not seeing any problems functionally.

 

From the online searches I did on this error most people say DONT without explaining why. Can it seriously be that big of a problem in a release build? Logitech don't supply the source to rebuild the library, it's provided 'as is'.

6600 2.4G / GTX 460 280.26 / 4GB Windows 7

Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT

Tricubic Studios Ltd. ~ Combat Helo

Link to comment
Share on other sites

Yeah, that's the biggest problem I had when I switched to VS2010.. had to re-compile most of the libs, which sometimes proved to be a bigger challenge than I thought (that's why I still have the previous VS installed) .. but I had some show-stopper errors, this one is just for the missing debug info (i think) so I don't think it makes a difference for the release build..

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...