I am well aware on how to extract a resource from my exe and save it as a file, but the same code is not working for a DLL.
Here is my code:
Procedure myProcedure();
Var rStream: TResourceStream;
Var fStream: TFileStream;
Begin
rStream := TResourceStream.Create(HInstance, 'PROGRAM', 'EXE');
Try
fStream := TFileStream.Create('Program.exe', fmCreate);
Try
fStream.CopyFrom(rStream, 0);
Finally
fStream.Free;
End;
Finally
rStream.Free;
End;
End;
That code will take a resource from a program and extract the files in it and save them as a file on the computer. Works for EXE's
I never figured out how to read a resource from something and run it without saving it to the computer as a file. I would prefer to be able to run the resource directly from the program, but I am happy either way.
Why won't such a piece of code work for DLLS? I embedd the resource fine, but it wont extract.
Any information appreciated
Thanks,
The Lone Programmer
"Is The Juice Worth The Squeeze"
-The Girl Next Door