Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Setupapi help needed


1 reply to this topic

elektrik

elektrik
  • Full Members
  • 12 posts

Posted 18 July 2002 - 20:20

Hi all. Having a little bit of a problem accessing this .dll from IS 6.31.

Here's my defines/prototype/typedef:

#define DLL_FILE "setupapi.dll"
#define DIGCF_PRESENT 0x00000002
#define DIGCF_ALLCLASSES 0x00000004
#define DIGCF_PROFILE 0x00000008
#define DIGCF_DEVICEINTERFACE 0x00000010

typedef HDEVINFO
begin
LONG pHdevinfo;
end;
HDEVINFO hDevinfo;
HDEVINFO POINTER phDevinformation;
prototype NUMBER SetupAPI.SetupDiGetClassDevsA(LONG,BYVAL STRING,LONG,LONG);

The code is below:
function callmydll()
NUMBER nResult;
STRING szDLL;
begin
szDLL = DLL_FILE;
nResult = UseDLL (szDLL);
hDevinfo.pHdevinfo = SetupDiGetClassDevsA(NULL,
"", // Enumerator
0,
DIGCF_PRESENT);
if (UnUseDLL (szDLL) < 0) then
MessageBox("UnUseDLL failed.\n\nDLL still in memory.", SEVERE);
endif;
end;

pretty generic code ( I think I actually got the example on this site); the problem I keep getting is that hDevinfo keeps returning -1 no matter what I do....Can anyone help?

Thanks!

Jerry

elektrik

elektrik
  • Full Members
  • 12 posts

Posted 18 July 2002 - 22:48

More info...I've tried to call the same .dll from Visual Basic and I can't seem to get the data types right-that seems to be where it's failing....