R
Rymfax
I have an application that is installing Drivers to the OS. I was
using the UpdateDriverForPlugAndPlayDevices() function to handle
this. It works fine, but on VISTA I get prompted by Windows Security
if the Driver isn't pre-installed first. To avoid this I want to use
the DiInstallDriver() function which will Pre-Install the driver first
and then install it to any device that uses it.
The problem I'm having is that everytime I try to compile now that
I've added a reference in my code to DiInstallDriver(), I get the
following error:
Error 13 error LNK2019: unresolved external symbol _DiInstallDriverW
referenced in function "private: void __thiscall
ScanHardware::UpdateDriver(class ScanResult *)" (?
UpdateDriver@ScanHardware@@AAEXPAVScanResult@@@Z) ScanHardware.obj
Error 14 fatal error LNK1120: 1 unresolved externals C:\Projects
\UIUHWScan++\Debug\UIUHWScan++.exe 1
For the life of me I can't figure out why it's giving me this error.
The function is in declared in newdev.h and I am including that in
my .cpp file. UpdateDriverForPlugAndPlayDevices() is defined in hte
same newdev.h and works fine.
I don't know if this is happening because DiInstallDriver() is a VISTA
function and I'm building on a XP machine or what, but it is driving
me crazy! Any help would be VERY MUCH appreciated it.
Here's a snippet of what my code looks like:
if(osMajorVersion > 5)
{
if(ForceUpdate) installFlag = DIIRFLAG_FORCE_INF;
installResult = DiInstallDriver(0, inf, installFlag,
&rebootRequired);
} else
{
if(ForceUpdate) installFlag = INSTALLFLAG_FORCE;
installResult =
UpdateDriverForPlugAndPlayDevices(0,hwid,inf,installFlag,&rebootRequired);
}
TIA!
using the UpdateDriverForPlugAndPlayDevices() function to handle
this. It works fine, but on VISTA I get prompted by Windows Security
if the Driver isn't pre-installed first. To avoid this I want to use
the DiInstallDriver() function which will Pre-Install the driver first
and then install it to any device that uses it.
The problem I'm having is that everytime I try to compile now that
I've added a reference in my code to DiInstallDriver(), I get the
following error:
Error 13 error LNK2019: unresolved external symbol _DiInstallDriverW
referenced in function "private: void __thiscall
ScanHardware::UpdateDriver(class ScanResult *)" (?
UpdateDriver@ScanHardware@@AAEXPAVScanResult@@@Z) ScanHardware.obj
Error 14 fatal error LNK1120: 1 unresolved externals C:\Projects
\UIUHWScan++\Debug\UIUHWScan++.exe 1
For the life of me I can't figure out why it's giving me this error.
The function is in declared in newdev.h and I am including that in
my .cpp file. UpdateDriverForPlugAndPlayDevices() is defined in hte
same newdev.h and works fine.
I don't know if this is happening because DiInstallDriver() is a VISTA
function and I'm building on a XP machine or what, but it is driving
me crazy! Any help would be VERY MUCH appreciated it.
Here's a snippet of what my code looks like:
if(osMajorVersion > 5)
{
if(ForceUpdate) installFlag = DIIRFLAG_FORCE_INF;
installResult = DiInstallDriver(0, inf, installFlag,
&rebootRequired);
} else
{
if(ForceUpdate) installFlag = INSTALLFLAG_FORCE;
installResult =
UpdateDriverForPlugAndPlayDevices(0,hwid,inf,installFlag,&rebootRequired);
}
TIA!