|
-
April 12th, 1999, 08:29 AM
#1
[RESOLVED] Resources
If I add a file as a internal resource with say ID_MYFILE
how can I convert this resource into a string suitable for passing to a function which previously required a path to a file? Can it be done?
-
April 12th, 1999, 08:45 AM
#2
Re: Resources
do you mean CString((LPCSTR)ID_) constructor or CString::LoadString() functionality?
t!
-
April 12th, 1999, 08:50 AM
#3
Re: Resources
You tell me!
I have a function FunctionLoadInit(char *pathtofile)
At the moment I pass a string.
I though I might be able to insert the file as a resource, give it an ID and somehow use this as the parameter, but it must be a string.
I am trying to avoid having to issue a seperate file with my program, thats all.
-
April 12th, 1999, 09:08 AM
#4
Re: Resources
maybe i still do not understand (why cathegory dialog?)
you want read data from resource given by its name (string)
try to look ak FindResource and LoadResource funtions (RT_RCDATA?)
maybe this helps you
t!
-
April 12th, 1999, 09:12 AM
#5
Re: Resources
Hi
I put in in this category because I am doing a dialog based application.
The embeded resource needs to be treated as it it were a standard file.
For example, if you embed a BITMAP, you can use MAKEINTRESOURCE
-
April 12th, 1999, 11:48 AM
#6
Re: Resources
If the contents of the file can be treated as a standard resource you can do this.
Another way to look at this is if you can imbed your file in the resource script as a
string then a call to LoadString should work. I doubt any of the other resource types
would be very helpful. Watch out for binary data in the file - could cause difficulties.
Just give the file an id like any other resource and pass this to the LoadString member
of a CString object.
-
April 12th, 1999, 07:43 PM
#7
Re: Resources
Do you want the contents of the file or the name of the file in the resource?
-
April 13th, 1999, 01:18 AM
#8
Re: Resources
Hi
I want the contents of the file.
Basically, I want to add the binary file as a resource, therefore it is embeded in the program, but I then need some way of accessing this data as a binary file.
I could use LoadResource/FindResource to get a HGLOBAL, but I don't have a clue of how to treat this as the equivalent of a binary file stream with read/write facilities.
Any ideas?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|