Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   Problem with opening .res file (https://www.delphipraxis.net/41680-problem-opening-res-file.html)

delphi_goldy 7. Mär 2005 06:52


Problem with opening .res file
 
Since I'm writing this in English, I'll keep it (hopefully) short!

#1.
I have 2 forms. I try to open .res file in Form2. Delphi stops and
reports "Project XXXX.exe raised exception class EAccess Violation with message 'Access violation at address 00408895 in module XXXX.exe. Write of address 004037C7' Process stopped."

Then it points toward Form1 where it's written ShowModal!
I try to write in file with strPCopy(Something.One, edit1.text);

where
type TNk=record
One:PAnsiChar;
var Something:TNk;

What is the problem?

#2.
Another question, but not connected to previous: When I press button, it reads from edit. This works (of course). Then I try to set focus again to edit. (with Edit1.SetFocus). It should
work with Delphi v5 (I rewritten from book). It doesn't work. It reports missing semicolon or something like that!

Goldy

rantanplan99 7. Mär 2005 10:09

Re: Problem with opening .res file
 
Hi,

some rules first: open up a new thread for every problem you have. don't put 2 different problems in the same thread.
second: please use the "Delphi-Code" Tags for sourcecode.

for problem #2: you have to put a semicolon ; at the end of the line, like this
Delphi-Quellcode:
Edit1.SetFocus;
you can omit the semicolon if its the last command in your code-block wich is terminated by an end; like this

Delphi-Quellcode:
procedure a;
begin
  Edit1.SetFocus
end;

or

procedure b;
var
  i: integer;
begin
  i := 0;
  if (i = 5) then begin
    Edit1.SetFocus
  end;
  i := 1;
end;

the following gives you an error:

procedure c;
begin
  Edit1.SetFocus
  ShowMessage('MessageBox')
end;
maybe in your delphi book, the Edit1.SetFocus Command was followed by an end;

rantanplan


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:02 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz