mfc dll <-> app communication
-
little question. is there a chance to get a pointer back to the application. and to use the functions of the application? or to get data from the application. or is the only way to send messages? how could i communication between the dll and the application. i could call a dll function. but how is it if a export a view and wanna call a function from the mainframe or from the document class? any ideas?
-
little question. is there a chance to get a pointer back to the application. and to use the functions of the application? or to get data from the application. or is the only way to send messages? how could i communication between the dll and the application. i could call a dll function. but how is it if a export a view and wanna call a function from the mainframe or from the document class? any ideas?
-
little question. is there a chance to get a pointer back to the application. and to use the functions of the application? or to get data from the application. or is the only way to send messages? how could i communication between the dll and the application. i could call a dll function. but how is it if a export a view and wanna call a function from the mainframe or from the document class? any ideas?
Well you can pass a pointer from the app to the DLL and then it can use that. If the functions are in your CMainFrame class et.all. then you can use MFC functions in your DLL to get a ptr to these. Another alternative is "Calling an Exported Function in an EXE from Within a DLL" http://codeguru.earthweb.com/dll/ExportingFromExe.html[^] Neville Franks, Author of ED for Windows. www.getsoft.com Make money with our new Affilate program
-
little question. is there a chance to get a pointer back to the application. and to use the functions of the application? or to get data from the application. or is the only way to send messages? how could i communication between the dll and the application. i could call a dll function. but how is it if a export a view and wanna call a function from the mainframe or from the document class? any ideas?
As you import functions from DLL to your application, and not the other direction, application-defined classes should not be called by the DLL. Use MFC extension DLL to export a view class for your app's framework. Regards, BB
-
As you import functions from DLL to your application, and not the other direction, application-defined classes should not be called by the DLL. Use MFC extension DLL to export a view class for your app's framework. Regards, BB
-
1. Thou shalt not include
CMyApp
definition in a DLL. 2. You may useAfxGetApp()
to send messages to your app, but I personally don't like such solutions - this is not what DLLs are for. X| Regards, BB -
1. Thou shalt not include
CMyApp
definition in a DLL. 2. You may useAfxGetApp()
to send messages to your app, but I personally don't like such solutions - this is not what DLLs are for. X| Regards, BB