Access violation in Win98

From: Johan Smit (smitjsno_at_spamlantic.net)
Date: 09/28/04

  • Next message: Coen: "String$() function in delphi?"
    Date: Tue, 28 Sep 2004 05:49:37 GMT
    
    

    Hi,
    In Delphi5, I do the following:
    Type TTwoPChar = Procedure(Char1, Char2 : PChar);stdcall;
    ..
    procedure TfrmMain.PlugsClick(Sender: TObject);
    var TwoPChar : TTwoPChar;
    begin
      ..
      TheDLL := LoadLibrary(PChar(str));
      if GetProcAddress(TheDLL,'ExecuteProcess') <> nil then begin
       @TwoPChar := GetProcAddress(TheDLL,'ExecuteProcess');
       TwoPChar(PChar(aStr), PChar(InitDir));
      end;
    end;

    This works fine in Windows XP,
    but if the app is run in Win98, there is an access violation on
    executing the line
       TwoPChar(PChar(aStr), PChar(InitDir));
    What could I possibly do about it?
    Thank you
    Johan Smit


  • Next message: Coen: "String$() function in delphi?"