I'm writing a WPF app that uses PINVOKE to make calls to a dll that I'm also writing. In one of the exported functions in the dll, the SetupDiGetClassDevs is called. At this point, when running the app on XP, I get an error, first of all a dialog box saying:
"The procedure entry point RegOpenKeyExW could not be located in the dynamic link library KERNAL32.dll."
Clicking ok then leads me to an unhandled exception dialog. Both the WPP app and the dll are built with VS2010 on a Win7 machine, and the app runs fine on Win7 systems. The problem only happens when running the app on XP. If I avoid the SetupDiGetClassDevs (and subsequent SetUpdi function calls) in the dll, then nothing goes wrong; so it seems the PINVOKE mechanism is working ok.
Any ideas what is going wrong? I'm a bit confused about seeing RegOpenKeyExW referenced, as the dll is not built with UNICODE enabled.
Thanks Tom