"SetupOpenInfFile" gets an access violation error in Delphi2010

When using the following line code in Delphi 2010 a'm gets an "Access Violation" error, but the same code works fine in VC ++.

Delphi Code 2010

var
  hMyInf : HINF;
begin
hMyInf := SetupOpenInfFile('.\\DIGIMHID.INF','Mouse', INF_STYLE_WIN4,Nil);

VC ++ Code

hMyInf = SetupOpenInfFile(".\\DigimHID.inf", "Mouse", INF_STYLE_WIN4, NULL);

Please help me solve this problem. Thanks to everyone.

+3
source share
2 answers

Call LoadSetupAPIbefore using any methods inSetupAPI.pas

, : , , , . : : Windows, Runtime Error 216. , . AV, .

Delphi " ", , SetupOpenInfFile , import. - . SetupAPI.pas ( Google , JEDI), , LoadSetupAPI. : LoadSetupAPI initialization? , . .

+4

Delphi. \ Delphi, . .

, GetProcAddress . . .

, . Cosmin . , SETUPAPI_LINKONREQUEST SetupApi.pas.

+2

Source: https://habr.com/ru/post/1791802/


All Articles