RC file question

Started by John Montenigro, December 06, 2006, 07:21:30 PM

Previous topic - Next topic

John Montenigro

Initially, Module1.rc contained only:

RTFHELPp RCDATA DISCARDABLE "FVCproctheory.RTF"
RTFHELPt RCDATA DISCARDABLE "FVCtool.RTF"
RTFHELPa RCDATA DISCARDABLE "FVCcontactauthor.RTF"  


and it compiled OK. Then I added:

TXTHELPp RCDATA DISCARDABLE "FVCproctheory.txt"
TXTHELPt RCDATA DISCARDABLE "FVCtool.txt"
TXTHELPa RCDATA DISCARDABLE "FVCcontactauthor.txt"


and it reports an error generating the RES. (Any one of those lines generates the error.)

I don't see the difference, and I have been reading through the RC.HLP, the MSDN, and I haven't been able to figure out the problem!

I've mixed the sequence, the capitalization, whatever I could think of, but
the one set is OK, the other is not.

Just for yuks, I copied the following code from MSDN
(http://msdn2.microsoft.com/en-us/library/aa381030.aspx)  

chem MENU
{
   POPUP "&Elements"
   {
        MENUITEM "&Oxygen", 200
        MENUITEM "&Carbon", 201, CHECKED
        MENUITEM "&Hydrogen", 202
        MENUITEM SEPARATOR
        MENUITEM "&Sulfur", 203
        MENUITEM "Ch&lorine", 204
   }
   POPUP "&Compounds"
   {
        POPUP "&Sugars"
        {
           MENUITEM "&Glucose", 301
           MENUITEM "&Sucrose", 302, CHECKED
           MENUITEM "&Lactose", 303, MENUBREAK
           MENUITEM "&Fructose", 304
        }
        POPUP "&Acids"
        {
             "&Hydrochloric", 401
             "&Sulfuric", 402
        }
   }
}


but it won't compile either.

Despite having read all this material, it seems I still have no clue about how to make this happen.

Anyone see what I'm doing wrong?

-John

P.S. Module1.rc has always been in my FF project; I originally did "Add Module"... It's been fine all along, and I can make it stop being fine just by adding one line of that second set.

.

TechSupport

I am not sure if this has ever happened to me although I do seem to remember something similar at one time (not sure). Whenever I encounter the RES could not be created error, I do the following:

(1) Delete all of the CODEGEN_* files and then re-compile using a full compile (press F5).

(2) Ensure that all of the identifiers in the resource file are unique. For example, if you have two "TXTHELPp" identifiers listed then it will error.

(3) Make sure that the text files actually exist. If they don't then you'll get an error.

(4) Try using the full path names to see if that makes any difference. For example: "C:\FireFly\Projects\MyProject\FVCproctheory.txt"

I did create a sample project and created three text files using your file names. It all compiled fine. Odd.

John Montenigro

First 3 suggestions did nothing.

#4 worked. So I checked my files, and found the problem.

When I first started working with FF, I tried to exercise "version control" by copying all files to a new subdir with each major change. Somewhere along the line, things got out of synch, and FF was looking in one place for the RTF and TXT files, and I thought they were in another.

Now I've got everything cleaned up, and we're both happy. But configuration management is still a concern for me.

Does FF generate any kind of list that shows which files it used in the compile, and what their locations are? (like the list we see upon successful compilation, but saved to a file...) I'm thinking this would be helpful to verify that I'm sending the right files out to users in the field.

To ensure I don't send the app out with a critical file missing, I'm thinking that I'll wrap up each external .DLL etc. into a Resource. When the app first runs, it will check to see that all the files are there; if not, it will unpack them from the resource area...

Is this a good strategy?

-John

By the way, before making any major change to a file, I now do a "generational backup": move form.frm as form_bakxx.frm to a backup (/BAK) subdir...




.

TechSupport

Quote from: John MontenigroDoes FF generate any kind of list that shows which files it used in the compile, and what their locations are? (like the list we see upon successful compilation, but saved to a file...)
No, FireFly does not create any such file listing. All of the code and related binary (e.g. icons, bitmaps) are output to CODEGEN_*.* files. That's about it. There could be many other types of files that you'll need to send to customers: DLL's for 3rd party tools (e.g. grid, print preview), ini files, readme's, help files, etc... Hard for FireFly to track all of that.

QuoteTo ensure I don't send the app out with a critical file missing, I'm thinking that I'll wrap up each external .DLL etc. into a Resource. When the app first runs, it will check to see that all the files are there; if not, it will unpack them from the resource area...

Is this a good strategy?
What I do is have my programs do a check on startup for critical files. If one or more are missing then I simply display a warning message and advise to reinstall the program. I then exit the program.