1
Gentlemen, I have this code, it lies in my Form Activate
, then, it serves to identify my running software, and consequently update it, ie it is an auto updater.
if servidor = false then //se o servidor estiver conectado
begin
for i := 0 to ParamCount do //contador para verificar os parametros
begin
if vparam[i] <> ExtractFileName(Application.ExeName) then <---Acess Violation aqui!
begin
........
end;
end;
end;
In the comment indicates the line of Acess Violation, could anyone tell me why?
Still keeps making the mistake.... : S
– Ramon Ruan
Does access Violation occur at the first execution of the line of code? Does this array actually have the required number of positions? This error most likely indicates that you are trying to access within "vparam" a non-existent position...
– adamasan
Provavemnte @Arthurdeandrade, has a function that determines the size of the array, I’m checking now.
– Ramon Ruan
No longer giving access to Violation friend, thank you.
– Ramon Ruan
Before you leave, there’s a way to explain what this one’s for
ParamCount
? Thank you– Ramon Ruan
Paramcount simply contains the number of parameters that have been used to invoke the executable in opening it. So if you pass as parameters in the opening, for example, the server name, the user, and the permission level, the Paramcount value will be 3.
– adamasan
I got it, thank you very much, buddy.
– Ramon Ruan