Click here to Skip to main content
15,847,077 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I have a windows application(.exe) in visual c++ so I must convert it to dll. I change to my project the configuration type->dynamic library(.dll) and To use of mfc->use mfc in a shared dll. When I build the project creates MYDLL.dll. I create a console application to test MYDLL but I dont how to call MYDLL. Could you help me?

My source code of MYDLL:
C++
BEGIN_MESSAGE_MAP(CStressTestApp, CWinApp)
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
 END_MESSAGE_MAP()


CStressTestApp::CStressTestApp()
{
}


CStressTestApp theApp;


BOOL CStressTestApp::InitInstance()
{

    InitCommonControls();  
    
    CWinApp::InitInstance(); 
    
    AfxEnableControlContainer(); 
    
    
    SetRegistryKey(_T("¥»Ύχ AppWizard ©²£¥ΝΊΐ³¥Ξµ{¦΅"));
    CStressTestDlg dlg;
    m_pMainWnd = &dlg;
    INT_PTR nResponse = dlg.DoModal();
    if (nResponse == IDOK)
    {
    }
    else if (nResponse == IDCANCEL)
    {
    }
    
    return FALSE;
}
Posted
Updated 3-Jul-12 3:33am
v2
Comments
[no name] 3-Jul-12 8:27am    
A better question is why are you screaming at people that you want to get help from?
Tim Corey 3-Jul-12 8:34am    
I fixed the formatting on your article to remove the all-caps text and to clean up how it looked. Please do not use all-caps, since that is the equivalent of screaming.
Richard MacCutchan 3-Jul-12 9:53am    
This will not work as a dll; you have application specific code in there. The first question you need to answer is "why do I need a DLL?". Once you have answered that you can spend some time analysing the problem you are trying to solve and deciding which functions can usefully be moved into the DLL.
Sergey Alexandrovich Kryukov 3-Jul-12 11:42am    
Exactly!
--SA

1 solution

to make dll, u need to write application independent code.
and need to give references to that file
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900