Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Res Files From Dll

Posted on 2006-11-22
4
Medium Priority
?
187 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
3 Comments
 
LVL 4

Accepted Solution

by:
Meldrachaun earned 1200 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Suggested Courses

772 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