Solved

Res Files From Dll

Posted on 2006-11-22
4
182 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

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…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 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