From: Ajay Kalra on 2 Feb 2006 13:01 If you are making this a plug-in and the host application is also MFC, you should *not* be using a MFC Extension DLL because of likely conflicts with other modules in the system. You should then resort to a MFC Regular DLL which has its own set of resource IDs. You will need to use AFX_MANAGE_STATE to change the state as needed. ------- Ajay Kalra ajaykalra(a)yahoo.com
From: davejohansen@gmail.com on 2 Feb 2006 14:15 I am using this in an MFC application, so I'll need to use an MFC Regular DLL. Can you recommend a good example or tutorial on how to do this? Thanks, Dave
From: Ajay Kalra on 2 Feb 2006 17:41 I cannot think of a tutorial for this. All you really have to do it use the wizard and let it spit out the code. Nothing more is really needed. It even gives you hint about how to use AFX_MANAGE_STATE macros. There may be some tutorial for it on Codeproject/Codeguru or MSDN. Sorry I am not able to provide you specific links. -------- Ajay Kalra ajaykalra(a)yahoo.com
From: davejohansen@gmail.com on 2 Feb 2006 19:15 No problem. You've already been really helpful and thanks again for all of the help. Dave
From: Joseph M. Newcomer on 2 Feb 2006 19:48 I've done this for plugin technology; essentially, I defined a 2-way SendMessage interface between the DLLs and the application. Then what I did was create a class class CPlugin : public CDialog { public: // methods to plugin void SetBounds(int x, int y) { SendMessage(UWM_SET_BOUNDS, (WPARAM)x, (LPARAM)y);} BOOL QuerySomeSetting() { return (BOOL)SendMessage(UWM_QUERY_SOME_SETTING); } }; and I defined a set of messages that the plugin could send me. By hiding most of the down-messaging in a class, I got a nicer interface. Then each plugin returned an object of type CPlugin * instead of CDialog */ All messages were Registered Window Messages. Messages received by the parent included messages like /************************************************************************* * UWM_MAKE_NOISE * Inputs: * WPARAM: (WPARAM)(UINT) MIDI code of noise to make * LPARAM: (LPARAM)MAKELONG(volume, duration) * Result: LRESULT * Logically void, 0, always * Effect: * Plays a MIDI note at the indicated volume and duration *************************************************************************/ Then no matter what plugin I had, I had the same interface. joe On 2 Feb 2006 09:18:45 -0800, "davejohansen(a)gmail.com" <davejohansen(a)gmail.com> wrote: >Thanks for the advice. I am making this as sort of a plug-in system and >so there will be different types of Dialogs that the original >application will know nothing about before hand. If that's the case, >can I still use an MFC Extension DLL and export the CDialog class for >use in my main application? Because that definitely sounds like the >better method. >Also, is there an example or tutorial that you could point me to? I >found this article: >http://www.codeguru.com/Cpp/Cpp/cpp_mfc/tutorials/article.php/c4023 >but it's pretty sparse on the details and there's no real example to >show how it really works. >Thanks a ton, >Dave Johansen Joseph M. Newcomer [MVP] email: newcomer(a)flounder.com Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm
First
|
Prev
|
Pages: 1 2 Prev: GetScrollBarInfo() not working with "Internet Explorer_Server" win Next: CHTMLView and Flicker |