Hello everybody :) i am a simple delphi6 user, trying to build some applications to run on cnc lathes; cnc lathes have windows

Hello everybody :) i am a simple delphi6 user, trying to build some applications to run on cnc lathes; cnc lathes have windows

at this moment, i put shortcuts into win+startup menu, so applications are starting and all is ok; but i would like to have a start up behaviour from code

this is what i have used :

procedure SetAutoStart(AppName, AppTitle: string; bRegister: Boolean);
const RegKey = '\Software\Microsoft\Windows\CurrentVersion\Run'; // Run or RunOnce
var Registry: TRegistry;
begin
Registry := TRegistry.Create;
try Registry.RootKey := HKEY_LOCAL_MACHINE;
if Registry.OpenKey(RegKey, False)
then begin
if bRegister = False then Registry.DeleteValue(AppTitle)
else Registry.WriteString(AppTitle, AppName);
end;
finally Registry.Free;
end;
end;

this code creates the key inside the HKLM, but at start-up, i receive an error

the error is the same on all 3 computers ( my PC + 2 lathes )

i have googled it, and it seems that this case is common

please, how can i fix this behaviour ?

i have attached the "error" and "specs" for my pc, lathe1, lathe 2

kindly !



Comments

  1. Alex Klop​ look at the stack trace in mad except. Beyond that sounds like the issue relates to you using relative paths and the working directory not being what you expect. Use full paths.

    ReplyDelete
  2. hey David, you are right :) i should have used full paths; i really dont know why i have not verified this; ups !

    different ways of starting the application are causing it to have different default search directory paths

    by the way, did you figured it out from the image that i sent you ? ... omg ! please, what did you saw on that report ?

    nice skills mr David Heffernan :) thank you !

    ReplyDelete
  3. No, just an educated guess based on different behaviour for different startup modes.

    ReplyDelete

Post a Comment