wrapping unmanaged classes for controls
-
I would like to wrap an mfc control class (Chris Maunder's MFC Grid control) to be used in C#. Does anyone know of a link to teach me how to do this? I kind of understand the part about wrapping classes, but what about so that it actually displays on the form at runtime and design time. Forgive me if I sound stupid, but I've only been learning C# for a few days now (since Friday). I think I've got the basics, but I'd like to be able to do this so that I can use the control in C#. Any help is appreciated. Thanks!! If I write code in my sleep, does that make me brilliant, or just a lazy programmer? My articles www.stillwaterexpress.com BlackDice - the programmer formerly known as bdiamond
-
I would like to wrap an mfc control class (Chris Maunder's MFC Grid control) to be used in C#. Does anyone know of a link to teach me how to do this? I kind of understand the part about wrapping classes, but what about so that it actually displays on the form at runtime and design time. Forgive me if I sound stupid, but I've only been learning C# for a few days now (since Friday). I think I've got the basics, but I'd like to be able to do this so that I can use the control in C#. Any help is appreciated. Thanks!! If I write code in my sleep, does that make me brilliant, or just a lazy programmer? My articles www.stillwaterexpress.com BlackDice - the programmer formerly known as bdiamond
You know, until I saw this question, I hadn't read the source for the C Maunder Grid Control. The MFC Grid Control is an impressive body of work (and, I didn't read it all the way through on first reading). I've never been in a project where you would have to wrap so many disparate types, but, it's probably best not to EVEN TRY to display that monster on a .NET Form. I'm fairly new to .NET, and, in particular the Interop marshaler, but, I don't think you could wrap the "mfc control class" (because there isn't one). It's not a COM component, and consequently, has no type library. If you wanted to pursue this strategy, you'd have to wrap each individual type that C Maunder uses in his implementation, and marshaling all that data into .NET accurately would surely drive you to (well, what's the worst thing you can imagine?). Run Time Callable Wrappers are generally for small cohesive units, like classes and interfaces and objects that are type compatible from managed to unmanaged. User defined types often require special custom marshaling routines, and much of this is trial and error. However, I'll bet Microsoft likes the C Maunder MFC Grid Control (they have spies everywhere), and, I wouldn't be surprised if they have a highly elite team of .NET code fiends working on the advanced version as we forum. The overriding concern here is: Just how different are MFC and .NET? I would recommend the book: ".NET and COM: The Complete Interoperability Guide", by Adam Nathan (everything I know, I learned from this book). To use this control in .NET, you'd have to re-write the entire thing to be compatible with the Common Language Runtime types. I think this would be a very cool commercial project. I wonder if Chris has franchised the concept yet.
-
I would like to wrap an mfc control class (Chris Maunder's MFC Grid control) to be used in C#. Does anyone know of a link to teach me how to do this? I kind of understand the part about wrapping classes, but what about so that it actually displays on the form at runtime and design time. Forgive me if I sound stupid, but I've only been learning C# for a few days now (since Friday). I think I've got the basics, but I'd like to be able to do this so that I can use the control in C#. Any help is appreciated. Thanks!! If I write code in my sleep, does that make me brilliant, or just a lazy programmer? My articles www.stillwaterexpress.com BlackDice - the programmer formerly known as bdiamond
I wouldn't try to wrap this class. You will be better off using the Windows.Forms.DataGrid class as your base implementation (powerful class by the way) and extending it for any further functionality that you desire. Remember, the DataGrid is different for Windows and Web namespaces respectively.
R.Bischoff
Tengas un buen dia
-
I would like to wrap an mfc control class (Chris Maunder's MFC Grid control) to be used in C#. Does anyone know of a link to teach me how to do this? I kind of understand the part about wrapping classes, but what about so that it actually displays on the form at runtime and design time. Forgive me if I sound stupid, but I've only been learning C# for a few days now (since Friday). I think I've got the basics, but I'd like to be able to do this so that I can use the control in C#. Any help is appreciated. Thanks!! If I write code in my sleep, does that make me brilliant, or just a lazy programmer? My articles www.stillwaterexpress.com BlackDice - the programmer formerly known as bdiamond
Hi all, I will release a product in next week which can wrapping alomst all MFC CWnd as a WinForm Ctrl, if any one need, please let me know, my e-mail is sunhui@mail.apptemplate.com