Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unable to Run more then twice one program within Delphi

169 views
Skip to first unread message

Yannick Gratton

unread,
Jan 24, 2000, 3:00:00 AM1/24/00
to
My problem is a bit strange : I'm only able to Run (with F9) my program
once. If I do any changes to it and try to run it again, the .exe compiles
but when Delphi 5 tries to open it, there's some Win32.API function error
(it seem's to be related to some string) that appears.
If I try to open the exe from Windows Explorer after it compiles the
second time, it doesn't work until I close down Delphi it self. I found out
that if I save my project under a different name, the Run function will work
correctly just once.
Also, my problem appears under Windows 98, there is no problem if I use
Windows NT.
Actually, my problem only appears on one big program, smaller programs
work well.

If you have any ideas, please tell me.
Thanks

David Lively

unread,
Jan 24, 2000, 3:00:00 AM1/24/00
to
Yannick -

This information is a bit sketchy, but it sounds like you're allocating some
system resource or loading a module (OCX, DLL, etc) and not freeing it. The
error you see the second time you attempt to run your app could be some sort
of sharing violation.

Could you provide a more detailed description of the error message you're
receiving?

- Dave Lively
dli...@intellecare.com


Yannick Gratton <volon...@hotmail.com> wrote in message
news:86hv4c$ms...@bornews.borland.com...

Remco de Korte

unread,
Jan 25, 2000, 3:00:00 AM1/25/00
to
Yannick Gratton wrote:
>
> My problem is a bit strange : I'm only able to Run (with F9) my
> program
> once. If I do any changes to it and try to run it again, the .exe
> compiles
> but when Delphi 5 tries to open it, there's some Win32.API function
> error
> (it seem's to be related to some string) that appears.
> If I try to open the exe from Windows Explorer after it compiles
> the
> second time, it doesn't work until I close down Delphi it self. I
> found out
> that if I save my project under a different name, the Run function
> will work
> correctly just once.
> Also, my problem appears under Windows 98, there is no problem if I
> use
> Windows NT.
> Actually, my problem only appears on one big program, smaller
> programs
> work well.
>
> If you have any ideas, please tell me.
> Thanks

Do you have a Tmediaplayer component in your application?
That's what caused a similar problem in a program I worked on.

Remco

http://www.xs4all.nl/~remcodek/

Joris Van Damme

unread,
Jan 25, 2000, 3:00:00 AM1/25/00
to
Hi Yannick,

I think you mean 'Unable to Run more then once...'?

It's only a guess, but the problem might be that the first 'Run' is
still running. Delphi, nor any other compiler, can modify or rewrite an
exe file if the exe file is running, so you get the problems you
describe.

You could check this. Use CTRL-ALT-DELETE to pop up a list of currently
running processes, when you have the problem. Is your application among
them?

If it is, there is some reason why it is not closing down as it should.
It might be a thread that's holding things up, or an OCX, or simply a
bug that confuses Delphi or the system.

Joris

Yannick Gratton

unread,
Jan 25, 2000, 3:00:00 AM1/25/00
to
Hi,

I'm not trying to Run it again when it is already running. The problem
happen also when I restart my computer, open Delphi 5, open my program
(that I've already run once before) and try to run it again.

Joris Van Damme <as.van.da...@planetinternet.be> wrote in message
news:388CF4D0...@planetinternet.be...

Joris Van Damme

unread,
Jan 25, 2000, 3:00:00 AM1/25/00
to
Yannick Gratton wrote:
>
> Hi,
>
> I'm not trying to Run it again when it is already running. The problem
> happen also when I restart my computer, open Delphi 5, open my program
> (that I've already run once before) and try to run it again.

WOW, that is REALLY WEIRD. Like twilight zone stuff.

I can't think of any probable cause; but here's an improbable one (hey,
I do what I can): might it perhaps be related to compilation
optimization regarding to file dependencies? Try 'build all' instead of
F9. If that still doesn't work, please elaborate on this 'some Win32.API
function error' you're getting. Also you might want to try to tracing
initialization, using F7 rather than F9 (but do a 'build all' first).
Because maybe it's related to initialization code? Are you using any
third-party components? Any hacked stuff (sorry, just asking)? Did you
recently upgrade your Delphi version? Is the VCL included in your
library path? Does one of your units mistakingly have the same name as a
VCL unit?

Sorry I can't be more helpfull, but do come back with the answers on
these questions.

Joris


Joris Van Damme

unread,
Jan 25, 2000, 3:00:00 AM1/25/00
to
Or, are you aware of anything using the registry perhaps? Does searching
the registry for your app's name turn up anything?

Just guessing,


Joris


Yannick Gratton

unread,
Jan 25, 2000, 3:00:00 AM1/25/00
to
Hi,

There is one TMediaPlayer in my program. I deleted it with all the related
procedures but still doesn't work. Do you have other ideas ? Or maybe when
I delete it, I'm suppose to do something else ?


Remco de Korte <remc...@xs4all.nl> wrote in message
news:388CF50F...@xs4all.nl...

Ralph Friedman (TeamB)

unread,
Jan 25, 2000, 3:00:00 AM1/25/00
to
In message <86kg4r$oh...@bornews.borland.com>, Yannick Gratton stated:

> [Attachment decoded to FILE://D:\PROGRA~1\VA\Download\error from Delphi when F9.bmp]
>
Yannick,

Please don't post attachments. As well as going against newsgroup rules, it
inconveniences everyone who d/l's them. You will find the rules at

http://www.borland.com/newsgroups/guide.html

Thanks for your cooperation. Your post has been canceled.

All it would have taken is a bit of effort for you to note the error messages as part
of your text message, instead of posting > 3 megabytes of bitmaps.

===
Regards
Ralph (TeamB)
===


Yannick Gratton

unread,
Jan 25, 2000, 3:00:00 AM1/25/00
to
Hi,

I've already tried 'Build all', it build it all right but I'm not able to
run it from Delphi or when Delphi is open.

For the Win32 function error, I've posted most of my errors that I get under
the person that reply before you.

When I try tracing with F7 and F9, the error is not always at the same place
in the loading process : it move's from an ... .Item.String to a different
... .Item.String.

Also, every OCX that I used are not hacked.

The version of Delphi is 5.0 (Build 5.62).

I don't think that my units have the same name as a VCL unit because my
program works on Windows NT.

I think I've answer all your questions, so what do you think ?


Joris Van Damme <as.van.da...@planetinternet.be> wrote in message

news:388DB81B...@planetinternet.be...

Yannick Gratton

unread,
Jan 25, 2000, 3:00:00 AM1/25/00
to
Here's most of the error messages that I'm getting :

Project ... .exe raised exception class EWin32Error with message 'Win32
Error. Code :87. The parameters is incorrect'. Process stopped. Use Step
or Run to continue.

Exception EReadError in module ... .exe at 000175E7. Error reading
Quantity_cbx.Items.Strings : A Win32 API function failed.

Project ... .exe raised exception class EAccessViolation with mesage 'Access
violation' at address 00494B20 in module '... .exe'. Read of address
5F4AC1E0'. Process stopped. Use Step of Run to continue.

Exception EReadError in module ... .exe at 000175E7. Error reading
sign_cmbBox.Items.Strings : A Win32 API function failed.

Project ... .exe raised exception class EReadError with message 'Error
reading QS_WaferType_cb.Items.Strings : Win32 Error. Code : 87. The
parameter is incorrect'. Process stopped. Use Step or Run to continue.

Exception EReadError in module ... .exe at 000175E7. Error reading
QS_WaferType_cb.Items.Strings : Win32 Error. Code : 87. The parameter is
incorrect.

Project ... .exe raised exception class ElnOutError with message 'File not
found'. Process stopped. Use Step or Run to continue.

What is 'Code : 87' ?? I was not able to find what it is.


Also, in my program, I use a lot of different OCX :
from Turbo Power : Abbrevia, Async Professional, Essentials, Systools
from Olectra Charts : 2D Chart and 3D Chart

All the new tabs that have appeared in Delphi 5 when I've install the
different OXC are :
Abbrevia, Apro Fax, Apro, Apro TAPI, Essentials 1, SysTools,
SysTools (CC), OR3 (General), OR3 (Edits), OR3 (Lists),
OR3 (ComboBox), OR3 (Non Visual), OR3 (Dialog), OR3 (Table),
OR3 (db 1/2), OR3 (db 2/2)

Also, the different errors that appears when my program is loading seem's to
come up ramdomly : different ... .Item.String come's up. If I just add a
label to one of my forms and try to run it, the ... .Item.String will be
different.

It's really strange that if I change the name of my project I'm able to run
it until I do a change in the program and try to run it again.

Hope it's less sketchy this time.

Thanks again.

David Lively <dli...@intellecare.com> wrote in message
news:86hvj8$ms...@bornews.borland.com...


> Yannick -
>
> This information is a bit sketchy, but it sounds like you're allocating
some
> system resource or loading a module (OCX, DLL, etc) and not freeing it.
The
> error you see the second time you attempt to run your app could be some
sort
> of sharing violation.
>
> Could you provide a more detailed description of the error message you're
> receiving?
>
> - Dave Lively
> dli...@intellecare.com
>
>
> Yannick Gratton <volon...@hotmail.com> wrote in message
> news:86hv4c$ms...@bornews.borland.com...

Remco de Korte

unread,
Jan 25, 2000, 3:00:00 AM1/25/00
to
Yannick Gratton wrote:
>
> Hi,
>
> There is one TMediaPlayer in my program. I deleted it with all the
> related
> procedures but still doesn't work. Do you have other ideas ? Or
> maybe when
> I delete it, I'm suppose to do something else ?
>

Nope, sorry.
I'm just a simple mind.
All I can think of has already been said.

Remco

http://www.xs4all.nl/~remcodek/

Joris Van Damme

unread,
Jan 25, 2000, 3:00:00 AM1/25/00
to
Yannick Gratton wrote:
> When I try tracing with F7 and F9, the error is not always at the same place
> in the loading process : it move's from an ... .Item.String to a different
> ... .Item.String.
>
> I think I've answer all your questions, so what do you think ?

I think
- Some helpfull Team B member cancelled your error messages post (but
hey, if it was over 3 meg, I'm happy I was too late to download it...)
- There is an error 'a winapi function failed' which is displayed
sometimes. If this was your error, you should not take it seriously. It
is usually displayed when the system is totally messed up, eg a severe
case of memory corruption. (I love the smell of memory corruption in the
morning.)
- And most of all, I think I'm out of thoughts (unlike win32, my brain
has a very limited number of available DC's). Unless, of course, it's
the obvious: are you sure you're handling all these strings correctly?
Try moving this code to a place that is easier to debug, like a button
click event handler, and use MemProof if necessary. Or try posting this
code here. (But make sure it's less than 3 meg, and do NOT use an
attachment.)

Joris


Robert Kennedy

unread,
Jan 26, 2000, 3:00:00 AM1/26/00
to
Yannick,

I've read the other postings in response to your problem, and like the
others, I have no clue about the cause of your problem. It sounds like you
don't even know where the problem pops up in your code.

Instead of launching with F9, have you tried F7? It takes you to your very
first line of executable code and from there you can F7 and F8 your way
through your code until it crashes again. My guess is that the last
successful line of code doesn't change from one attempt to run to the next.

Sorry if this is just too elementary, but it does sound like it's time to
grasp at any straw that passes by.

Robert

0 new messages