0

I need to give support to a tool developed in Delphi 7. It is using Borland database engine. So i developed a installation kit which installs BDE and uses IDAPINST DLL functions.

Till Windows 8.1, the tool was running perfectly in both the English and German OS. But in Win 10 German OS, the installation hanging when the function from IDAPINST DLL called.

I already tried to use the appcompat settings bases on suggestions given by few experts in some blogs. unfortunately, it didn't help!!

Any suggestions almost welcome

sample code

procedure TForm1.Button1Click(Sender: TObject);
type
  T95IntlProc = procedure(pszCfgFile: pChar;blIdapi16: Integer;sLang: pChar); stdcall;
  zString = array[0..255] of Char;
Var
  hLib: THandle;
  IntlProc95: T95IntlProc;
  z1,z2: zString;
begin
  Try
    hLib := LoadLibrary('IDAPINST.DLL');
    if hLib = 0 then raise Exception.Create('unable to load idapiinst dll');
    StrPCopy(z1,'C:\Borland\Common Files\BDE\idapi32.cnf');
    StrPCopy(z2,'0009');
    Showmessage('GET IntlConfig ProcAddr');
    IntlProc95 := T95IntlProc(GetProcAddress(hLib,'IntlConfig'));
    Showmessage('CallDLL_IntlConfig started');

{** MY code hanging in the below method **}
IntlProc95(z1, 0, z2);
Showmessage('CallDLL_IntlConfig called');

Finally FreeLibrary(hLib); End ; end;

Andy_D
  • 2,340
  • 16
  • 21
user413088
  • 51
  • 7
  • 2
    Did you not get the Do Not Resuscitate instruction? – David Heffernan Aug 28 '15 at 11:34
  • What is IntlProc95 supposed to do? – MartynA Aug 28 '15 at 11:49
  • While this is not the cause of your problem, `zString` is unnecessary in this situation. Use a regular `AnsiString` and type-cast it to `PAnsiChar` when calling `IntlProc95()`, eg: `var z1, z2: AnsiString; ... z1 := 'C:\Borland\Common Files\BDE\idapi32.cnf'; z2 := '0009'; ... IntlProc95(PAnsiChar(z1), 0, PAnsiChar(z2));` Or, simply get rid of the variables altogether and pass the literals directly: `IntlProc95('C:\Borland\Common Files\BDE\idapi32.cnf', 0, '0009');` – Remy Lebeau Aug 29 '15 at 02:23
  • BTW, does your app even have access to the `C:\Borland\Common Files\BDE` folder on Win10? You really should not be using folders off the root like that. And you REALLY should not be using BDE anyway, it is a deprecated technology. Consider migrating to a more modern database engine, even if you keep the project in Delphi 7. – Remy Lebeau Aug 29 '15 at 02:24

0 Answers0