Calling InstallDeviceService() with Borland Stuff

0 Likes

Problem:

I have some problems when I try to start the class driver with the Daconfig.dll . using Borland C 5.02, and when I debug, or build the application, I get an error message like this :

<<

Linking C:\Projects\testi2c\proj0001.exe

  !Error: Unresolved external '_InstallDeviceService' referenced from c:\projects\testi2c\parallelport.obj

>>

in despite I added DaConfig.lib in the project, I included dainstall.h in the code, and I added

the correct DLLs in folders.

Resolution:

This is a known issue with Driver::Agent 1.15. You can use the following workaround to call DaConfig. Note: This procedure assumes that you have linked implicitly against DaConfig.DLL in some other place in your code. If not, you can use LoadLibrary() rather than GetModuleHandle().

typedef DEVSTATUS (_cdecl *WorkaroundInstallDeviceService)

(

LPCTSTR pszDeviceName,

LPCTSTR pszDisplayName,

LPCTSTR pszPath,

ULONG dwReserved

) ;

WorkaroundInstallDeviceService InstallDevService = (WorkaroundInstallDeviceService)

GetProcAddress(

GetModuleHandle("DaConfig.DLL"),

"InstallDeviceService"

);

(WorkaroundInstallDeviceService)( _T("DeviceName"), _T("DisplayName"), _T("Path"), -1 );

Old KB# 11159
Comment List
Anonymous
Related Discussions
Recommended