Recent

Author Topic: Showing a second form using a Menu  (Read 12751 times)

ThomasK1201

  • New Member
  • *
  • Posts: 31
Re: Showing a second form using a Menu
« Reply #15 on: March 04, 2015, 10:00:01 pm »
Your attachment couldn't be saved. This might happen because it took too long to upload or the file is bigger than the server will allow.

This is what the site says when I try to post it..

ChrisF

  • Hero Member
  • *****
  • Posts: 542
Re: Showing a second form using a Menu
« Reply #16 on: March 04, 2015, 10:13:45 pm »
Probably because your zip file is too big.

Which is the case, if you've included the executable file (and if the debugging infos are activated; this is the case by default). Delete this executable file, "rezip" all the project files, and make another try.

Just in case, the executable file is the "final" file produced by FPC/Lazarus when you build your project.

If you're using Windows, for instance, and if your project is called 'Myproject', you'll get a -big- file called MyProject.exe.


ThomasK1201

  • New Member
  • *
  • Posts: 31
Re: Showing a second form using a Menu
« Reply #17 on: March 05, 2015, 12:55:03 pm »
My project is called MainUnit (I accidentally gave it a the name of my unit -_-) and there is 1 big file called MainUnit, but I dont see any .exe ... Compressed it is 4064 kB. Is that the file I have to delete?

ChrisF

  • Hero Member
  • *****
  • Posts: 542
Re: Showing a second form using a Menu
« Reply #18 on: March 05, 2015, 01:21:20 pm »
My project is called MainUnit (I accidentally gave it a the name of my unit -_-) and there is 1 big file called MainUnit, but I dont see any .exe ... Compressed it is 4064 kB. Is that the file I have to delete?

Probably.

I guess your Windows (your are using Windows, aren't you ?) is configured to hide known file extensions (http://windows.microsoft.com/en-us/windows/show-hide-file-name-extensions#show-hide-file-name-extensions=windows-7). This is why you can't see the .exe file extension.

AFAIK, the file limit for a attachment is only 250 KB (as indicated into "Attachments and other options"): which is usually quite enough for only source code.

BTW, don't include neither the subdirectories of your project into the zip file (i.e. "lib" and "backup").


It's not clear to me. Have you downloaded and tested the small test project I've attached in this post : http://forum.lazarus.freepascal.org/index.php/topic,27562.msg170634.html#msg170634  ?

I mean download the "YourTest.zip" file, extract the files from the zip file, and build the "YourProject" project with Lazarus/FPC.  Not only the " SommenOefeningUnit" code that I've also posted in this same post.

ThomasK1201

  • New Member
  • *
  • Posts: 31
Re: Showing a second form using a Menu
« Reply #19 on: March 05, 2015, 07:53:26 pm »
Yes Im using Windows.

Ill delete the file and try it again.

No I havent seen YourTest, so I just downloaded it but Lazarus cant read it.

ThomasK1201

  • New Member
  • *
  • Posts: 31
Re: Showing a second form using a Menu
« Reply #20 on: March 05, 2015, 07:54:53 pm »
Hope it'll work now  %)

ThomasK1201

  • New Member
  • *
  • Posts: 31
Re: Showing a second form using a Menu
« Reply #21 on: March 05, 2015, 07:56:32 pm »
I deleted the file, but when I try to run my project, is gives an error:

MainUnit.exe not found

ChrisF

  • Hero Member
  • *****
  • Posts: 542
Re: Showing a second form using a Menu
« Reply #22 on: March 05, 2015, 08:28:13 pm »
OK, in the order....

1/ Theoretically, you should have no problem to run my test project (it's really a very, very, very basic project).

Have you :
- unzip all the files (7 files),
- start the project (double click on YourTest.lpr or on YourTest.lpi to start Lazarus with it),
- Run -> Build menu in the Lazarus IDE to compile it,
- and finally Run -> Run (or F9).


2/ I've downloaded and tested your own project  (MainUnit.zip). Everything is working correctly here (see capture).


3/ As you've deleted the executable file, you must re-recreate it in order to be able to run it. So, in the Lazarus IDE, menu : Run -> Build.

------------------------

Are you using an old version of Lazarus/FPC (current release version is 1.2.6/2.6.4) ? Did you get any trouble when installing it ?

Because you should now be able to compile and run your own test project without any problem. I can't see any reason to get an error.

ChrisF

  • Hero Member
  • *****
  • Posts: 542
Re: Showing a second form using a Menu
« Reply #23 on: March 05, 2015, 10:58:01 pm »
OK. I've found the reason of your last error (i.e. "Project MainUnit raised exception class 'EReadError'  ...").

You've got an absent OnCreate event (absent in code, I mean) in your mainform form (i.e. mainform.lfm file).

I don't know how I've got it, because you should have got a message to remove it when compiling.

Anyway, I've removed it manually: replace your "mainform.lfm" file by the one present in the attached zip file "mainform-corrected.zip" (extract the file from the zip file, and put it in your own current project directory).

It should now work properly.

ThomasK1201

  • New Member
  • *
  • Posts: 31
Re: Showing a second form using a Menu
« Reply #24 on: March 06, 2015, 11:56:46 am »
This one does work thank you very very very much :D

 

TinyPortal © 2005-2018