- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a set of home-brewed utilities in a library util.lib, compiled with CVF 6.6B. A couple of the routines use custom dialog boxes contained in a resource script util.rc.
There is no trouble using them in a programeg Prog.exe withoutits own resource script: add util.rc to the Project Resources. But whenit does have its own resource script (and it is allowed only one), I am reduced to opening util.rc in Notepad and copying and pasting to the program's resource file prog.rc.
I feel that I should be using a resource template to expedite matters but cannot see how to do it / don't know if it is possible.
Any comments / assistance etc would be welcome.
Alan
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use CVF 6.6C. It is possible to create a resource-only DLL. You can then allow an EXEcutable to access the resources in the DLL by including code to load the DLL, get a handle to the resource you wantto useand then use things like DLGINITWITHRESOURCEHANDLE . For example:
integer DLLhInstance, lret
character*128 Dialogresource
type (dialog) gdlg
include 'resource.fd'
! The abovefilemust contain definitions of your your resource ID's, like IDD_MY_DIALOG
! which is produced when you create your resource-only DLL.
Dialogresource='MyDialogresource.dll'C
DLLhInstance=LoadLibrary( Dialogresource )
! Initialise the dialog using the resource ID and the resource handle
lret = DlgInitwithresourcehandle(IDD_MY_DIALOG, DLLhInstance, gdlg)
Obvously, your .EXE has to then be accompanied by the DLL and its resource ID definition file, RESOURCE.FD (or whatever name you choose for it). However, to change the resources available, you then just have to rebuild the DLL and the resource.fd file will be automatically updated. As far as I know, this is the only way to make resources available to a DLL.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Anthony,
Many thanks. I will give it a go.
Alan

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page