CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    Sep 2007
    Location
    Bangalore,India
    Posts
    164

    Smile dll loading itself launching the application

    Dear Friends
    I am loading a dll from another exe mfc application. for that i have exposed one api 'runAppli' in the dll as extern "C". Then I am loading the dll using LoadLibrary. By loading the dll itself the dll application is launched. I am surprised. I should call the api 'runAppli' and then the application should launch but its not happening. How come it is happening please give some suggestions.

    Code:
    // in the all
    extern "C" BOOL __declspec(dllexport) runAppli(CString filename)
    {
        AFX_MANAGE_STATE(AfxGetStaticModuleState());
    	if(filename.IsEmpty())
    	return false;
    	view->ShowWindow(SW_SHOW);
    	view->loadProfile(filename);
    	view->domainSetUpForProfile();
    	view->drawLines();
    	view->drawArcs();
    	view->drawProfile();
        return true;
    }
    
    //in the client exe application
    
    void CClientRevolutionProjDlg::OnBnClickedButton1()
    {
    HINSTANCE hinstLib;
    hinstLib = LoadLibrary(L"C:\\Users\\sujan.dasmahapatra\\Documents\\Projects\\Bhagavan_SurfaceRevolution\\RevolutionProj\\debug\\RevolutionProj.dll");
    }
    By simply loading the dll the dll application is launching.. why ??? Thanks Sujan
    Last edited by Marc G; January 13th, 2012 at 02:57 AM. Reason: Fixed code tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured