Page 1 of 1
Access violation with many includes
Posted: Tue Aug 26, 2008 4:17 pm
by James Bott
I am starting a new thread due to a change in topic in another thread. Here is the original question:
--------------
Seem to have hit a wall. I have a main.rc file with many includes. Maybe 600.
About 14 won't compile. I get and access violation.
So I added a main2.rc with the 14 includes included in main.rc. Same access violation.
Any thoughts?
Thank you
Harvey
----------------
Yikes, 600! What are they all? How many are RC files? What eactly does the error say? Can you combine some of those includes into the same file?
Regards,
James
Posted: Tue Aug 26, 2008 4:22 pm
by James Bott
Yes 600. Some may be due to my ineffieient programing over the years. The program is very complex. After I finish conversion to 32bits. I'll let you have a copy NC.
all rc files. Just says "access violation" when compiling. If I comment out the items at the bottom of this list it compiles.
Then your only option may be to combine some of them into one file. There must be a maximum number of include files allowed and you have exceded it.
If you are using an include file for each dialog (as workshop wants to do) you can eliminate any of them by changing the ID reference to use the actual numeric ID rather than the manifest constant located in the include file.
Regards,
James
Posted: Tue Aug 26, 2008 4:25 pm
by hag
I think I understand. Can you send me an example.
Posted: Tue Aug 26, 2008 4:40 pm
by James Bott
Harvey,
When you create a dialog, Workshop will generate an include file something like this:
#define ID_DATE 110
#define ID_CLIENT 120
#define ID_ARTICLE 130
#define ID_AMOUNT 140
#define ID_TOTAL 150
#define ID_NOTES 160
Then in your code you write something like this:
redefine get var dData ID ID_DATE...
You can rewrite the line like this:
redefine get var dData ID 120 ...
You will have to do the same for all the #defines in the include file. Then you can just eliminate the include file.
Regards,
James
Posted: Tue Aug 26, 2008 4:42 pm
by hag
Try it later today when I get back home.
Thanks for all your help.
Posted: Wed Aug 27, 2008 1:51 am
by hag
I created a small dll for the items the main.rc file will not compile. Everything is working fine even the manifest. You've been a great help.
Posted: Wed Aug 27, 2008 5:15 am
by James Bott
Glad to hear you got it working.
James
Posted: Wed Aug 27, 2008 6:59 am
by StefanHaupt
Harvey,
an access violation can also happen if you have an icon file with several included icons inside and with a color depth which is not supported by the resource compiler of borland.
Delete the unsupported icons out of the icon file and it will work
If I remember right, 8bit and 24bit colors are supported. So all icons files from vista canĀ“t be used in their original form.