Flexman Posted July 13, 2011 Share Posted July 13, 2011 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'. Quote 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 More sharing options...
Canardia Posted July 13, 2011 Share Posted July 13, 2011 I would use MinGW C++ with Code::Blocks. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
paramecij Posted July 13, 2011 Share Posted July 13, 2011 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.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.