PDA

View Full Version : Dialog_ChooseColor Problem



Lee Allen
19-03-2007, 02:02
Hi Eros
Just thought you would like to know there appears to be a problem around the
Dialog_ChooseColor function. Although the problem appears AFTER the function
ends and the Message Box is dismissed.

Maybe a stack issue or a uninitiated pointer somewhere?

This is how to reproduce the problem. The code is the Dialog_ChooseColor.tBasic Sample Script


uses "UI"

dim lColor as long

lColor = Dialog_ChooseColor(0, rgb(255, 0, 0), %CC_RGBINIT OR %CC_FULLOPEN )

if lColor = -1 then
msgbox 0, "Color Dialog cancel by user"
else
msgbox 0, "Your color is: " & hex$(lColor, 6)
end if

1: Run script
2: Click Button Add to Custom Colors
3: Select the new red custom color
4: Click OK
5: Message Box appears (all OK so far)
6: Click OK on Message box then this message pops up...

The instruction at "0x77fcd989" referenced memory at "0x00000000". The memory could not be written

ErosOlmi
19-03-2007, 02:11
Strange, I cannot replicate the GPF.
What OS version are you on?

Lee Allen
19-03-2007, 02:30
I am using Win 2k. But I also just tried it on a machine with XP. Same problem.

It only seems to give a problem if you click 'Add to Custom Colors' before exiting

sandyrepope
19-03-2007, 02:57
I just tried Lee's script and got the same result.

Note that I tried it from thinair. I don't know if this has anything to do with the weird behavior or not.

Could someone try it that way and see if they get the same error message too?

Thanks
Sandy

PS: I tried it a bunch of times but can't figure it out. The error message turns Almost every time.

Also: Lee, how are you running the script? Do you run it from thinair?

Lee Allen
19-03-2007, 03:14
Hi Sandy
No I just clicked on the sample file in the install directory...

C:\thinBasic\SampleScripts\UI\Common\Dialog_ChooseColor.tBasic

sandyrepope
19-03-2007, 03:28
Lee, I just tried it from there too and found that I get the error about half of the times I tried it. Since the error shows up sometimes, I think it will be hard to figure out the why.

I think that if given enough time someone will figure out what to do with this.

Sandy

ErosOlmi
19-03-2007, 07:39
OK, I got it.
I didn't click on "Add to custom color" button

I will investigate.

Ciao
Eros

ErosOlmi
19-03-2007, 07:51
Problem fixed. An index starting from 1 instead of 0

Fix will be present in next preview release.
If you cannot wait I will attach new UI module. Let me know.

Thanks a lot for this catch.
Ciao
Eros

Lee Allen
19-03-2007, 14:48
>Fix will be present in next preview release.
Thanks- no rush - next release is fine.

P.S.
I have found a similar GPF problem in my script when updating LISTBOX data. It seems very intermittent and I have not yet pinned down the exact circumstances.
I will post a new topic when I have more precise details. In the meantime if anyone else
notices a LISTBOX update problem please post.

ErosOlmi
19-03-2007, 14:54
OK, perfect.
In the meantime I will close this bug.
When you have a sample giving ListBox problem opena new one.

Ciao
Eros