Resource Binding Problem (I Think)

Resource Binding Problem (I Think)

Postby arpipeline » Sun Apr 26, 2009 9:07 pm

I am having a situation with resources that has me stumped. I have about 580 total dialogs and some are randomly generating Cannot Create Dialog Fivewin/3 errors. Here's the thing: the dialogs are built correctly because if I bind them individually, they work. The error occurs when they are grouped together. Presently, the same two or three dialogs are throwing the error when grouped with the other 577. When I separate them out, the three load fine so it's not a strange control problem. Here is an example of one of them that fails to bind in the group, but works on its own (as you can see it's pretty simple) I've even tried renaming it:

DLG_STDCATEDIT DIALOG 29, 52, 430, 247
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Category Edit Table"
FONT 8, "MS Sans Serif"
{
LISTBOX 101, 9, 10, 95, 210, LBS_NOTIFY | LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT | WS_BORDER | WS_VSCROLL | WS_TABSTOP
CONTROL "", 102, "TWBrowse", 0 | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP, 111, 9, 309, 211
PUSHBUTTON "&New", 103, 110, 226, 50, 14
PUSHBUTTON "&Edit", 104, 162, 226, 50, 14
PUSHBUTTON "&Copy", 105, 214, 226, 50, 14
PUSHBUTTON "&Delete", 106, 266, 226, 50, 14
PUSHBUTTON "&Print", 107, 318, 226, 50, 14
PUSHBUTTON "Close", 108, 370, 226, 50, 14
}

I've tried the FW FindResource function and it returns 0 on the suspect dialogs, and it returns a number like 9397322 for the ones that load correctly. So I suspect that the problem is with the xHB linker somehow dropping the dialogs from the list. I have tried both compiled .res and straight .rc with the same results. I've even tried three different resource compilers thinking that might help, but it doesn't matter.

The *same* set of dialogs have worked for years in Clipper 5.2e + Blinker 7.0. My next step is to try straight xHarbour or Harbour, but I have reasons for using xHB and I don't want to give up.

Has anyone seen this problem and resolved it?

Thanks
User avatar
arpipeline
 
Posts: 36
Joined: Thu Oct 26, 2006 5:23 pm
Location: United States

Re: Resource Binding Problem (I Think)

Postby ukoenig » Sun Apr 26, 2009 9:44 pm

I added Your Resource as a test to one ( big ) of my own Resources without problem ( no compile error ).
Maybe a solution to save the 3 RC's as a single resource.
Next load with Workshop the working Main-RC-File and add / load inside Workshop the 3 separeted RC-Files.
Don't put them together as a Text-File with a Text-Editor.
A few month ago, I had to do the same with one of my RC-files. After that it was OK.

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Resource Binding Problem (I Think)

Postby arpipeline » Sun Apr 26, 2009 9:51 pm

Uwe,

I tried that too. In fact that's the original way I had them. I actually tried combining them only after I had problems. The thing that puzzles me is the .res issue. Even if I have separate .rc files, aren't they ultimately bound to the exe as a single .res anyway? It's just troubling to say the least. I almost have my 16-bit app converted and I cannot figure this out. I am in the process of trying BCC55 and Xharbour just to see if the problem is with xHB only.
User avatar
arpipeline
 
Posts: 36
Joined: Thu Oct 26, 2006 5:23 pm
Location: United States

Re: Resource Binding Problem (I Think)

Postby ukoenig » Sun Apr 26, 2009 10:09 pm

The RC-file ( text ) gets compiled as a RES-File.
I work with xHarbour as well.
Another solution could be, to create the 3 bad RC's new inside the Main-RC.
Just start with 1, to see what happens and if it works.
Inside a corrupt RC, it is hard sometimes, to find out what happens.
Maybe try, to save the Resource-file as a DLL and call the DLL inside Your application ?

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Resource Binding Problem (I Think)

Postby arpipeline » Sun Apr 26, 2009 10:25 pm

Yep, that's why I went the single .res route outside of xHB when the trouble started.

The .res and .rc's both load into Pelles C and other Resource editors I've tried, and all dialogs are there and testing fine -- no errors loading. I'm certain the problem occurs during the linking process, because as I stated before, FindWindow() reports the suspect dialogs as missing. Perhaps the DLL will work.

Thanks
User avatar
arpipeline
 
Posts: 36
Joined: Thu Oct 26, 2006 5:23 pm
Location: United States

Re: Resource Binding Problem (I Think)

Postby hag » Sun Apr 26, 2009 11:13 pm

I had a problem with too many resources in the rc file. I have over 600 in the rc/res file. However it wouldn't let me compile.
Solved my problem by placing serveral rc in one dll and closed and called as needed within the program. Mybe this is the way to go.
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: Resource Binding Problem (I Think)

Postby arpipeline » Sun Apr 26, 2009 11:25 pm

I just tried it with a DLL from the single .rc *and* .res file and it too failed. I am going to try Visual Studio next. What did you use to build the DLL?
User avatar
arpipeline
 
Posts: 36
Joined: Thu Oct 26, 2006 5:23 pm
Location: United States

Re: Resource Binding Problem (I Think)

Postby arpipeline » Mon Apr 27, 2009 12:21 am

Okay, I think I've got the problem licked. It appears that using multiple underscores "_" in the dialog names is confusing the function used to locate a resource. This is my best guess. The way I figured this out was to start eliminating the dialogs just before one that was failing. I hit one named something like this DLG_NAME_SUBNAME_SUBSUBNAME and when I deleted it, things started working until I hit another similar named dialog. Once I renamed all the dialogs with three or more underscores, I have a working application.

I am going to confirm this by carefully examining all the application's dialog (580 will take some time) and report back, but so far so good.

Thanks for your help.

PS - One huge .rc file :wink:
User avatar
arpipeline
 
Posts: 36
Joined: Thu Oct 26, 2006 5:23 pm
Location: United States


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 93 guests