Program crashes in WinME and not in WinXP

Everything else that doesn't fall into one of the other PB categories.
Gantry
User
User
Posts: 20
Joined: Tue Jun 03, 2003 6:24 am
Location: Sweden

Program crashes in WinME and not in WinXP

Post by Gantry »

Hi all!

Are there any general principles to think about when coding apps for winxp vs winme?

I can't really post my app, since it's too big. The program has a few tabs. It opens files. Reads some information. Calculates a new file name and then renames the file. It also supports drag and drop.

The problem is this: The program works just fine in winxp / win2k but users report crashes on winme. I have no idea what is causing this.

Does anything come to mind? Yeah I know, how could you tell from this description, but anyways...

/Gantry
*** In the end we will remember not the words of our enemies, but the silence of our friends. (Martin Luther King Jr.) ***
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Re: Program crashes in WinME and not in WinXP

Post by GPI »

>I can't really post my app, since it's too big. The program has a few tabs. It
>opens files. Reads some information. Calculates a new file name and then
>renames the file. It also supports drag and drop.
>
>The problem is this: The program works just fine in winxp / win2k but users
>report crashes on winme. I have no idea what is causing this.

Oh, i know this. I had almost the same problem with PB-Editor-GPI-MOD 4 and above. It crashed under WinXP/2000, but works fine with Win9x...

I started then jaPBe, because it was easier to rewrite the complete editor...

But, what i have changed:
* NEVER USE STRINGS AS BUFFER
(something like this: String.s=space(1000): adr=@string ....)
This can crash your code on some systems, on other not.
(And yes, i use in japbe strings as buffers, but not as much as in my mods)
* When you allocate memory, every procedure should get his own memory-block.
Don't share them, you can get in conflict with it. When you don't need them anymore, give them free.
* On CallBacks (Window,Richedit,etc), threads, etc, don't use AllocateMemory, use AllocGlobal_ (API).
Why? Windows is a MultiTasking-System, so it could happen, that the same procedure runs at the same time twice..., so you can get problems. Same for all procedures, which are called by a callback, etc.

GPI
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

ho, i'll write all your advises on a whitepaper :P
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Gantry
User
User
Posts: 20
Joined: Tue Jun 03, 2003 6:24 am
Location: Sweden

Post by Gantry »

Thanks GPI!

I will try to sort things out after reading your advice. :D

It's sad though not being able to trust ones applications to run on ordinary windows systems. I cant really find any bugs and still it crashes on people.

I really hope it doesn't drag my project in the dirt :cry: , since it has (including previous version in delphi/borland builder) over 3500 downloads.

C ya all!

/Gantry
*** In the end we will remember not the words of our enemies, but the silence of our friends. (Martin Luther King Jr.) ***
Post Reply