Can i call main application function from Dll?

Locked Can i call main application function from Dll?

  • Thursday, June 10, 2010 12:52 PM
     
     

    Hi all,

    I need to call one of a function which is in my main application from the dll.Is there any metheod to do it?Here is how i'm doing:

    Main application function:

    CMainAppClass{

    Public:

    MainApp(); };

    MainApp()

    {

    Function defination

    }

     

    In dll Class:

    CmainAppClass obj;

    obj.MainApp();

    While i'm doing like this i'm getting an error saying "CMainAppClass undeclare class"...Here would like to tell you that i'm including the main application header file in dll.

    I'm able to make the reverse i.e. calling the dll functions in main application,its working fine.

    Kindly give the answer is there any method to do so?? 


    Jyotiranjan

All Replies

  • Thursday, June 10, 2010 1:17 PM
     
     

    Jyotiranjan wrote:

    I need to call one of a function which is in my main application from  the dll.Is there any metheod to do it?

    I'm able to make the reverse i.e. calling the dll functions in main  application,its working fine.

    Have the main app call some DLL function and pass a callback pointer:

    http://en.wikipedia.org/wiki/Callback_(computer_science)


    Igor Tandetnik