Dragan and Cetin great thanks !
On my computer (W2000prof SP2 POLISH) this code (exactly as I wrote) crashes every time in VFP developer environment. (This code is simplfied version of my application code). When I run it outside VFP (with VFP runtimes) all is OK. If it is not reproducible on every machine I can narrow my investigations.
I remember that in VFP6 I must wait till SP3 until POLISH collating sequence start working on WIN POLISH (on WIN English all was OK). I hope that it isn't the case.
>>Hi !
>>Can somebody check if this code work. On my computer with win2000 profesional it crashes with C0000005 error.
>>*-
>>oForm.AddObject("combobox1","combobox")
>>oForm.combobox1.ControlSource = "xxx" && this works
>>oForm.combobox1.ControlSource = "" && this DOESN'T WORK (C5..)oForm.combobox1.enabled = .t. && this DOESN'T WORK ALSO
>>*-
>>(if i manualy create form and add combo, setting ControlSource through properties window doesn't work ALSO. Write down eg. "XXX" ENTER and next delete XXX and press ENTER)
>
>I've run this:
>
oform=createobject('form')
>oForm.AddObject("combobox1","combobox")
>oForm.combobox1.ControlSource = "xxx"
>oForm.combobox1.ControlSource = ""
>oForm.combobox1.enabled = .t.
>And it just worked. Does it have to be a .scx instantiated form? I also tried with oForm.show after line 1, and oForm.combobox1.visible=.t. right after adding the combo. When I set the controlsource to xxx, in the debugger I see the variable xxx being created with a value of "".
>
>Are you sure there's nothing else on this form which may have created an unstable environment, and that this combo just tips it over.