I have a resource file called TEST.RC.. This file contains the following like:
TEST RCDATA TEST.TXT
TEST.TXT looks like this
(Single line of numbers).
When I build (BRCC32.EXE) the RC file, I get a RES file. If I open this in a resource explorer, I can see I have a RT_RCDATA type resource called TEST and can see the text in it.
I want to now be able to use that in my C++ project. I've linked the RES file in using #pragma resource. I have the following code:
TResourceStream* resFile = new TResourceStream((int)HInstance, AnsiString("TEST"), "RT_RCDATA");
When it tries to create the resourcestream, an exception is raised. I've verified the resource file has been compiled into the EXE.
I am using BCB V6.
Does anyone have any suggestions at all as to why I would be getting this error? I'm sure its a conceptual error. I have this code working fine within Delphi 7.