|
-
Dec 22nd, 2004, 02:36 PM
#1
Thread Starter
Frenzied Member
Metafiles
Hey,
I have the following code
Code:
void main()
{
printf("1st element: %d\n", Metas[0]);
hexe = GetModuleHandle(NULL);
reshandle = FindResource(hexe, MAKEINTRESOURCE(Metas[0]), "Metafile");
if (reshandle == NULL)
printf("Did not find resource.\n");
else
printf("reshandle: %d\n", reshandle);
hglobal = LoadResource(hexe, reshandle);
if (hglobal == NULL)
printf("Did not load resource\n");
else
printf("hglobal: %d\n", hglobal);
//istream* metastream = (istream*) LockResource(hglobal);
char *metastream = (char*) LockResource(hglobal);
if (metastream == NULL)
printf("could not lock resource\n");
system("PAUSE");
}
to my understanding, the LockResource function returns a pointer to the first byte of the resource.
I need to be able to convert the metastream file into istream format.
How would i go about doing that?
Thanks,
Don't anthropomorphize computers -- they hate it
-
Dec 23rd, 2004, 12:52 PM
#2
Re: Metafiles
It's always int main, never void main.
What you need is a stream buffer (a class derived from streambuf) that reads from the memory you provide to it. You might find one via Google or you can write it yourself. It's not hard.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
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
|