Cannot create dialog box

Cannot create dialog box

Postby Maurilio Viana » Mon Sep 25, 2006 1:03 pm

Hi!

I have a lot of pain of "fivewin/3 error" and I stay without it since I used Borland resources in FW/Clipper. But this time I couldn't run :) as follow:

I have a strange problem with a modal dialog using TxBrowse control.
I included a new dialog in my RC file and a dialog stop to open. The resource dialog name is "SELECIONA" and have a combobox, a get, a TxBrowse, OK and Cancel buttons.

I duplicate "SELECIONA" to "SELEC_PRINC" dialog (in same RC file), changed into my PRG and recompiled. I didn't changes into dialog, I only duplicated. It worked fine. Then I deleted SELECIONA (because SELEC_PRINC worked) and SELEC_PRINC stop to work!!!

I use FWH 2.7 March with xHB Builder March and I don't use any Borland style resource.

Any idea to solve or debug were is the problem?

Thanks a lot!
Maurilio
User avatar
Maurilio Viana
 
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil

Postby Antonio Linares » Mon Sep 25, 2006 3:54 pm

Maurilio,

Please open the EXE with the resources workshop and check that the resources are properly placed inside.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Maurilio Viana » Tue Sep 26, 2006 11:13 am

Antonio,

Yes, the resource is inside exe correctly.
When I add a dialog to resources it fail, if I add a blank dialog named SEL* (SEL_TEMP, SEL_XXX, etc) it work.

In all times when the dialog open OK and when occur Fivewin/3 error I checked and the dialog is inside exe. And I change nothing in code or dialog, only add or delete an empty dialog as I said...

I couldn't isolate the problem into a self contained prg :(

Best regards,
Maurilio
User avatar
Maurilio Viana
 
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil

Postby Antonio Linares » Tue Sep 26, 2006 11:25 am

Maurilio,

We have found on some ocasions that the dialog name is not fine for Windows. Try to change it to a different name.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Maurilio Viana » Tue Sep 26, 2006 11:32 am

Antonio,
I'll change the name and do any tests.
Any news I post here.

Thanks!

Maurilio
User avatar
Maurilio Viana
 
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil

Postby Maurilio Viana » Wed Sep 27, 2006 4:34 pm

Antonio,

I renamed the resource and don't worked :(
If I add or delete a resource into rc file it work fine.
To avoid app exiting I place 'activate dialog' inside a try/end...

Do you have any naming rule that I can follow to avoid this type of error?

Regards,
Maurilio
User avatar
Maurilio Viana
 
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil

Postby E. Bartzokas » Wed Sep 27, 2006 7:02 pm

Maurilio Viana wrote:Antonio,

I renamed the resource and don't worked :(
If I add or delete a resource into rc file it work fine.
To avoid app exiting I place 'activate dialog' inside a try/end...

Do you have any naming rule that I can follow to avoid this type of error?

Regards,
Maurilio


Hi Maurilio,
The subject issue is a pain in the butt indeed.
I have come into a serious straggling with FWH, dealing with the Error 3, cannot create dialog box, and here is how I finally managed to get it going...
1. The name of the resource, even if correct, does not always work,
although with Workshop there is no error.
2. The more important thing is to define these in the beginning of your MAIN prg file, because most of the time, dialogs cannot be created because their respective controls have not been registered. For example, if you use a TWBROWSE control in a dialog, it is almost sure that it will not work, unless you define each control:
Here's a copy of what I register in my main prg. Just below the local, private functions:
TWindow():Register()
TWBrowse():Register()
TBitmap():Register()
TFolder():Register()
TTabs():Register()
TDialog():Register()
TMeter():Register()
TMetafile():Register()
TComboBox():Register()

More about the resource name...
Unfortunatelly, there is no rule that I have come up with...
It seems that Windows does not "like" some names, although there is nothing wrong with the names, and most important, they worked fine in the 16-bit environment....
So, if a dialog I use (from resource, in the stand-alone exe file), does not work, the next thing I do is to add the letter "Z", or "Q" or something like that infront of the resource's name, and retry running the program.

Important: The same thing (with names) happens with other kinds of resource, especially with the bitmaps... Another pain in the butt...
You can try the same approach described above (add an extra character infront of the resource's name.

I hope that this helped you...
Kind regards
Evans
User avatar
E. Bartzokas
 
Posts: 114
Joined: Tue Feb 14, 2006 8:13 am
Location: Corinth, Greece

Postby Maurilio Viana » Wed Sep 27, 2006 7:35 pm

Evans,

Thanks for your words.
The only different thing into these my "deffective resource" is a txbrowse control.
Based on what you said I must do in my main program:

TxBrowse():Register()

Is this right?

Regards
Maurilio
User avatar
Maurilio Viana
 
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil

Postby E. Bartzokas » Wed Sep 27, 2006 8:03 pm

Maurilio Viana wrote:Evans,

Thanks for your words.
The only different thing into these my "deffective resource" is a txbrowse control.
Based on what you said I must do in my main program:

TxBrowse():Register()

Is this right?

Regards
Maurilio


More or less YES.
I don't use TXBROWSE, however, you can try it, and in most cases you will have no problems with your dialogs using this control.

Kind regards
Evans
User avatar
E. Bartzokas
 
Posts: 114
Joined: Tue Feb 14, 2006 8:13 am
Location: Corinth, Greece


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 79 guests