Click here to Skip to main content
15,890,512 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: For beginners introduction to CFormView, CView ? Pin
SajeeshCheviry19-Jan-13 7:37
SajeeshCheviry19-Jan-13 7:37 
QuestionUsing the OpenFileDialog in Console? Pin
Member 975216818-Jan-13 7:01
Member 975216818-Jan-13 7:01 
QuestionRe: Using the OpenFileDialog in Console? Pin
jeron118-Jan-13 7:32
jeron118-Jan-13 7:32 
AnswerRe: Using the OpenFileDialog in Console? Pin
Member 975216818-Jan-13 7:38
Member 975216818-Jan-13 7:38 
GeneralRe: Using the OpenFileDialog in Console? Pin
jeron118-Jan-13 8:07
jeron118-Jan-13 8:07 
SuggestionRe: Using the OpenFileDialog in Console? Pin
Member 975216818-Jan-13 8:33
Member 975216818-Jan-13 8:33 
QuestionHELP: how to load satellite DLL for a DLL Pin
andwan018-Jan-13 5:54
andwan018-Jan-13 5:54 
AnswerRe: HELP: how to load satellite DLL for a DLL Pin
andwan021-Jan-13 22:46
andwan021-Jan-13 22: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 18:19
professionalSharath C V17-Jan-13 18:19 
AnswerRe: Compiling libexif 0.6.21 Pin
CPallini17-Jan-13 21:55
mveCPallini17-Jan-13 21:55 
GeneralRe: Compiling libexif 0.6.21 Pin
Sharath C V18-Jan-13 15:51
professionalSharath C V18-Jan-13 15:51 
GeneralRe: Compiling libexif 0.6.21 Pin
CPallini18-Jan-13 23:18
mveCPallini18-Jan-13 23:18 
AnswerRe: Compiling libexif 0.6.21 Pin
Graham Breach17-Jan-13 22:41
Graham Breach17-Jan-13 22:41 
GeneralRe: Compiling libexif 0.6.21 Pin
Sharath C V18-Jan-13 15:49
professionalSharath C V18-Jan-13 15:49 
QuestionNeed Debugging tips: MFC static library DLL Pin
Clark Kent12317-Jan-13 8:06
professionalClark Kent12317-Jan-13 8:06 
AnswerRe: Need Debugging tips: MFC static library DLL Pin
Richard MacCutchan17-Jan-13 23:07
mveRichard MacCutchan17-Jan-13 23:07 
QuestionRe: Need Debugging tips: MFC static library DLL Pin
Clark Kent12318-Jan-13 3:03
professionalClark Kent12318-Jan-13 3:03 
AnswerRe: Need Debugging tips: MFC static library DLL Pin
David Knechtges18-Jan-13 3:43
David Knechtges18-Jan-13 3:43 
GeneralRe: Need Debugging tips: MFC static library DLL Pin
Clark Kent12318-Jan-13 4:19
professionalClark Kent12318-Jan-13 4:19 
AnswerRe: Need Debugging tips: MFC static library DLL Pin
Richard MacCutchan18-Jan-13 4:11
mveRichard MacCutchan18-Jan-13 4:11 
GeneralRe: Need Debugging tips: MFC static library DLL Pin
Clark Kent12318-Jan-13 4:18
professionalClark Kent12318-Jan-13 4:18 
GeneralRe: Need Debugging tips: MFC static library DLL Pin
Richard MacCutchan18-Jan-13 4:23
mveRichard MacCutchan18-Jan-13 4:23 
GeneralRe: Need Debugging tips: MFC static library DLL Pin
Clark Kent12318-Jan-13 4:32
professionalClark Kent12318-Jan-13 4:32 
AnswerRe: Need Debugging tips: MFC static library DLL Pin
Alan Balkany18-Jan-13 5:21
Alan Balkany18-Jan-13 5:21 
QuestionHow to detect USB Device and sends data Pin
002comp16-Jan-13 21:24
002comp16-Jan-13 21: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.