Reusing CodeGuru Software
-
Hello, As you might know CodeGuru is an excellent web site were tones of controls and software in general is posted for free. For historical reasons the big majority of contributions are witten for MFC (VC 6.0), ATL, and alikes. If you surf it you'll colud find very valuable pieces of software. Most of them come in files .h and .cpp that integrate smoothly whith an MFC app. I would like to ask a question: Somebody knows a way or has tried to reuse this software from NET and C# using interop? Thanks, Josep L Colom
-
Hello, As you might know CodeGuru is an excellent web site were tones of controls and software in general is posted for free. For historical reasons the big majority of contributions are witten for MFC (VC 6.0), ATL, and alikes. If you surf it you'll colud find very valuable pieces of software. Most of them come in files .h and .cpp that integrate smoothly whith an MFC app. I would like to ask a question: Somebody knows a way or has tried to reuse this software from NET and C# using interop? Thanks, Josep L Colom
Basically most content from Cg and Cp don't expose (export) anything. They are classes to be added to your MFC-based VC++ projects. So that's a bit weird of a question. With C#, I can't really figure out what you could do out of most "MFC controls" code in Cg and Cp, since interop only allows you to import dll functions, not classes. (I don't know if this has been improved with VS.NET 2K3). With MC++, things get somewhat better. Watch out this article[^] (registration required). That said, MFC has its use in his context ("old" C++), and Windows Forms is simply the de facto .NET UI framework to use.
-
Basically most content from Cg and Cp don't expose (export) anything. They are classes to be added to your MFC-based VC++ projects. So that's a bit weird of a question. With C#, I can't really figure out what you could do out of most "MFC controls" code in Cg and Cp, since interop only allows you to import dll functions, not classes. (I don't know if this has been improved with VS.NET 2K3). With MC++, things get somewhat better. Watch out this article[^] (registration required). That said, MFC has its use in his context ("old" C++), and Windows Forms is simply the de facto .NET UI framework to use.
One way to reuse I taught was (if possible, but I don't know how) to convert those .h/.cpp clas(ses) to an ActiveX control. May be creating a new MFC ActiveX DLL project, and then, through interop to access this ActiveX (COM object). But may be I'm saying a nonsense thing..
-
One way to reuse I taught was (if possible, but I don't know how) to convert those .h/.cpp clas(ses) to an ActiveX control. May be creating a new MFC ActiveX DLL project, and then, through interop to access this ActiveX (COM object). But may be I'm saying a nonsense thing..
Josep L Colom wrote: One way to reuse I taught was (if possible, but I don't know how) to convert those .h/.cpp clas(ses) to an ActiveX control. May be creating a new MFC ActiveX DLL project, and then, through interop to access this ActiveX (COM object). Although that's true in theory, since ActiveX type libraries can be imported in the .NET world, I believe you should engage this way only as last option. Reasons are : - the marshaler (type library importer) has a few bugs, and as a consequence it's likely you have issues when calling exposed interfaces. - you have to build the ActiveX first, which means you have to provide implementation for IOleClientSite and some other containers as well. Got my point ? You'll end drop dead before you get a simple MFC owner drawn derived control, working fine in the .NET world.