Retrofitting an MFC app to ActiveX
-
Sorry if this is the incorrect forum - there are several that are labelled not MFC, but non that are specifically MFC or ActiveX. The company where I have just started working would like to enable a part of their program to be usable over the web. As a proof of concept I took the MFC client/server demo by Hans Dietrich and attempted to port the client part of it an ActiveX control. To aid me I have found Steve Zimmerman's port of the Scribble tutorial from MInD (0497). My knowledge of MFC and ActiveX is very minimal at best. I have been trying my best but getting no further to getting a working demo running, despite the apparent simplicity of it. The problem seems to be that the client part of Han's code is the fact that it is done as a CDialog app while the Scribble demo is done as a CFrame. Also the ActiveX initialisation is hidden away inside InitInstance. It's all very frustrating. What I would like is either a link to a demo/tutorial where someone converts a simple MFC app to ActiveX - Steve Zimmerman's article isn't very in depth and adds to much clutter that confuses the issue. Or I would like a very clear tutorial. A lot of the tutorials I have read are very terse or don't touch any of the concepts that I would like to know about. While I don't want to be spoon-fed I would like a few pointers to where I can find the information or specific terms I should be searching for. Thanks, Graham Reeds.
-
Sorry if this is the incorrect forum - there are several that are labelled not MFC, but non that are specifically MFC or ActiveX. The company where I have just started working would like to enable a part of their program to be usable over the web. As a proof of concept I took the MFC client/server demo by Hans Dietrich and attempted to port the client part of it an ActiveX control. To aid me I have found Steve Zimmerman's port of the Scribble tutorial from MInD (0497). My knowledge of MFC and ActiveX is very minimal at best. I have been trying my best but getting no further to getting a working demo running, despite the apparent simplicity of it. The problem seems to be that the client part of Han's code is the fact that it is done as a CDialog app while the Scribble demo is done as a CFrame. Also the ActiveX initialisation is hidden away inside InitInstance. It's all very frustrating. What I would like is either a link to a demo/tutorial where someone converts a simple MFC app to ActiveX - Steve Zimmerman's article isn't very in depth and adds to much clutter that confuses the issue. Or I would like a very clear tutorial. A lot of the tutorials I have read are very terse or don't touch any of the concepts that I would like to know about. While I don't want to be spoon-fed I would like a few pointers to where I can find the information or specific terms I should be searching for. Thanks, Graham Reeds.
This is as good as any place to ask, ActiveX is realy a ATL/COM thing thou. I realy could not explane it with out actualy doing it, and then I would probably need a good book on ATL/COM handy. In VC6, I would probably start by creating an ActiveX control shell, using the "MFC ActiveX ControlWizard", and then porting the code into it piece mill (testing as I went), if possible. Sorry, I do not know any totorials on porting like this. Most assume that you are building an ActiveX control from the start. Good luck! INTP Every thing is relative...
-
This is as good as any place to ask, ActiveX is realy a ATL/COM thing thou. I realy could not explane it with out actualy doing it, and then I would probably need a good book on ATL/COM handy. In VC6, I would probably start by creating an ActiveX control shell, using the "MFC ActiveX ControlWizard", and then porting the code into it piece mill (testing as I went), if possible. Sorry, I do not know any totorials on porting like this. Most assume that you are building an ActiveX control from the start. Good luck! INTP Every thing is relative...
John R. Shaw wrote:
In VC6, I would probably start by creating an ActiveX control shell, using the "MFC ActiveX ControlWizard", and then porting the code into it piece mill (testing as I went), if possible.
That's the problem - ones done in a Dialog and it seems you can only use dialogs as a dialog in ActiveX. C# is a lot nicer as it hides all the cruft away and you can get on with the coding. However MFC generates zillion comments and macros which I have no idea what they all do. Some articles delete them while others say to leave them alone. Now Borland Builder (5 or 6) doesn't seem so bad...
-
John R. Shaw wrote:
In VC6, I would probably start by creating an ActiveX control shell, using the "MFC ActiveX ControlWizard", and then porting the code into it piece mill (testing as I went), if possible.
That's the problem - ones done in a Dialog and it seems you can only use dialogs as a dialog in ActiveX. C# is a lot nicer as it hides all the cruft away and you can get on with the coding. However MFC generates zillion comments and macros which I have no idea what they all do. Some articles delete them while others say to leave them alone. Now Borland Builder (5 or 6) doesn't seem so bad...
Generalizing/Seperating is a problem, in MFC you can create an CRichEditView. But the CRichEditView is the top of the food chain, at the bottom is the actual RichEdit control. You can use the control seperate from the the view (like in a dialog), but you would might have to provide your own programmers interface. CRichEditView provides a programmers interface that provides wrapping for the CRichEditCtrl programmers interface, which provides wrapping for the actual RichEdit control interface (IRichEditOle). The RichEdit control is not dependent on MFC (as far as I know). The general idea is to seperate the code that actualy does the work from the type of window where the results are displayed, if possible. Yes, I know it sounds very complicate (and it is), but that is what it amounts to. Personaly I hate dealing with COM at the lowest level, that's why wizards are so important. Imagine trying to write all that code youself. If you can and are allowed to convert the code into C#, provided it will make life easier, then go ahead. From what I have seen, sooner or later, some one will be asking if there is a programmer that can convert the C# code to C++. I know none of this realy helps you, but I thought I would give you my general veiws on the subject. INTP Every thing is relative...