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

x
?
Solved

A resource DLL

Posted on 1997-04-06
1
Medium Priority
?
276 Views
Last Modified: 2010-08-05
Hello,
I use Visual C++ 5.0 (moved from 4.2)
I have created a new "project" which is a regular DLL
(not MFC) and I want it to be a "resource" bank for my
application. which means- ALL resourced will be in it and
nowhere else, so i can create a multi-language app that
uses a different DLL for any langauge.

I have added resources to this DLL, all's ok. but when I
compile it, it stops with a link error and says something
about a "DllInit" something function which is missing...
what function am i suppose to add, and most important-
WHERE, WHAT FILE should I add to my Resources DLL....

Thanks.
0
Comment
Question by:magid
1 Comment
 
LVL 23

Accepted Solution

by:
chensu earned 150 total points
ID: 1162612
In addition to all the resources, you should also add a .C or .CPP file which includes the following function,

#include <windows.h>

BOOL APIENTRY DllMain( HANDLE hModule,
                        DWORD ul_reason_for_call,
                        LPVOID lpReserved )
{
    /*switch( ul_reason_for_call ) {
    case DLL_PROCESS_ATTACH:
    ...
    case DLL_THREAD_ATTACH:
    ...
    case DLL_THREAD_DETACH:
    ...
    case DLL_PROCESS_DETACH:
    ...
    }*/
    return TRUE;
}

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

916 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