Click here to Skip to main content
15,850,446 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: For beginners introduction to CFormView, CView ? Pin
SajeeshCheviry19-Jan-13 8:37
SajeeshCheviry19-Jan-13 8:37 
QuestionUsing the OpenFileDialog in Console? Pin
Member 975216818-Jan-13 8:01
Member 975216818-Jan-13 8:01 
QuestionRe: Using the OpenFileDialog in Console? Pin
jeron118-Jan-13 8:32
jeron118-Jan-13 8:32 
AnswerRe: Using the OpenFileDialog in Console? Pin
Member 975216818-Jan-13 8:38
Member 975216818-Jan-13 8:38 
GeneralRe: Using the OpenFileDialog in Console? Pin
jeron118-Jan-13 9:07
jeron118-Jan-13 9:07 
SuggestionRe: Using the OpenFileDialog in Console? Pin
Member 975216818-Jan-13 9:33
Member 975216818-Jan-13 9:33 
QuestionHELP: how to load satellite DLL for a DLL Pin
andwan018-Jan-13 6:54
andwan018-Jan-13 6:54 
AnswerRe: HELP: how to load satellite DLL for a DLL Pin
andwan021-Jan-13 23:46
andwan021-Jan-13 23:46 
I think I got it working:

From VC2005 there's a function called AddResourceInstance() to chain DLLs. However am still using VC6 so this function doesn't exist.

So I just copied some code from a DLL project. The DLL main file contains these lines:

C++
static AFX_EXTENSION_MODULE NEAR extensionDLL = { NULL, NULL };
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
    AfxInitExtensionModule(extensionDLL, hInstance);
    new CDynLinkLibrary(extensionDLL);
}


This dynamically loads the DLL. If we put some of this code into the EXE project like so:

C++
HINSTANCE hDll2 = LoadLibrary(szFilename2);
AfxInitExtensionModule(extensionDLL,hDll2);
new CDynLinkLibrary(extensionDLL);

After the AfxSetResourceHandle(hDll); //setting satellite DLL overriding EXE resources

Originally, the EXE would be the resource container, but AfxSetResourceHandle(satelliteDLL) will set loaded DLL as default resource container, overriding the EXE like.

We use the above extension DLL to chain (add-on) another resource DLL.

The only issues now is freeing the library/memory..
QuestionCompiling libexif 0.6.21 Pin
Sharath C V17-Jan-13 19:19
professionalSharath C V17-Jan-13 19:19 
AnswerRe: Compiling libexif 0.6.21 Pin
CPallini17-Jan-13 22:55
mveCPallini17-Jan-13 22:55 
GeneralRe: Compiling libexif 0.6.21 Pin
Sharath C V18-Jan-13 16:51
professionalSharath C V18-Jan-13 16:51 
GeneralRe: Compiling libexif 0.6.21 Pin
CPallini19-Jan-13 0:18
mveCPallini19-Jan-13 0:18 
AnswerRe: Compiling libexif 0.6.21 Pin
Graham Breach17-Jan-13 23:41
Graham Breach17-Jan-13 23:41 
GeneralRe: Compiling libexif 0.6.21 Pin
Sharath C V18-Jan-13 16:49
professionalSharath C V18-Jan-13 16:49 
QuestionNeed Debugging tips: MFC static library DLL Pin
Clark Kent12317-Jan-13 9:06
professionalClark Kent12317-Jan-13 9:06 
AnswerRe: Need Debugging tips: MFC static library DLL Pin
Richard MacCutchan18-Jan-13 0:07
mveRichard MacCutchan18-Jan-13 0:07 
QuestionRe: Need Debugging tips: MFC static library DLL Pin
Clark Kent12318-Jan-13 4:03
professionalClark Kent12318-Jan-13 4:03 
AnswerRe: Need Debugging tips: MFC static library DLL Pin
David Knechtges18-Jan-13 4:43
David Knechtges18-Jan-13 4:43 
GeneralRe: Need Debugging tips: MFC static library DLL Pin
Clark Kent12318-Jan-13 5:19
professionalClark Kent12318-Jan-13 5:19 
AnswerRe: Need Debugging tips: MFC static library DLL Pin
Richard MacCutchan18-Jan-13 5:11
mveRichard MacCutchan18-Jan-13 5:11 
GeneralRe: Need Debugging tips: MFC static library DLL Pin
Clark Kent12318-Jan-13 5:18
professionalClark Kent12318-Jan-13 5:18 
GeneralRe: Need Debugging tips: MFC static library DLL Pin
Richard MacCutchan18-Jan-13 5:23
mveRichard MacCutchan18-Jan-13 5:23 
GeneralRe: Need Debugging tips: MFC static library DLL Pin
Clark Kent12318-Jan-13 5:32
professionalClark Kent12318-Jan-13 5:32 
AnswerRe: Need Debugging tips: MFC static library DLL Pin
Alan Balkany18-Jan-13 6:21
Alan Balkany18-Jan-13 6:21 
QuestionHow to detect USB Device and sends data Pin
002comp16-Jan-13 22:24
002comp16-Jan-13 22:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.