Solved

Res Files From Dll

Posted on 2006-11-22
4
180 Views
Last Modified: 2010-04-05
I have a dll that contains a reference to several RES files.

I can obtain the data from the res files using TResourceStream.Create and TResourceStream.SaveToFile.

How can I make the data from the res files available to the aplication at runtime as if the res file had been included in the exe using the {$R *.Res] directive?

The res files contain btrieve table structures and I don't want to have to recompile the app each time a field or index is changed hence the use of a dll

I've tried LoadResource and some other stuff but I can't get it to work!!

All help greatly recieved.
0
Comment
Question by:147break
4 Comments
 
LVL 4

Accepted Solution

by:
Meldrachaun earned 300 total points
ID: 18110483
The first parameter to LoadResource is the handle to the module where the resource resides.  To get the data from a DLL, you need the handle to the DLL.  If you load the DLL using the LoadLibrary command, call LoadResource with the handle you get from LoadLibrary.  If you are using static binding for the DLL (i.e. just using the external keyword in function or procedure definitions), get the handle to the DLL by calling GetModuleHandle, passing in the name of the DLL as a parameter.
0
 

Author Comment

by:147break
ID: 18616210
Many thanks for your reply.
Sorry for the delay in responding. I have not had time to look in to this yet but am replying to keep
the queston active. I hope to look at this shortly.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 21135798
Forced accept.

Computer101
EE Admin
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Comparing dates in Delphi. Greater than/ Less than 3 208
Base1 Encode/Decode 3 81
RESTRequest Parameter 4 41
DBCtrlGrid, Delphi, Scroll 8 33
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question