Solved

Res Files From Dll

Posted on 2006-11-22
4
176 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now