Technology & Programming Enthusiast blog

<
OMNITECHIE
 

C++/CLI programming in mixed mode

March 31, 2008 14:57 by Rickron

C++/CLI programming in mixed mode is an interesting beast  by this time. Obviously I try to avoid the complicated case like low level interop or hosting a .net control into a CView (they offer secretly something for that, a class I just find , CWinFormsControl in the afxwinforms.h). Because when I am talking abour mixed mode programming I think it is meant  also for IJW programming. Ok IJW stand for "It Just Work" .. hey yes it is another microsoft beloved acronym. My most interesting use is to obviously wrap a native library, it is not a secret in the programming industry, this is probably the first intended use of this c++ feature: FIND  A WAY TO REUSE EXISTING CODE EASILY and this is what c++/cli achieve. In a better way even in vs2008. Just think about the useful STL/CLR stl adaptation or the various marshaling library available. In fact it should recently fix probably some strange runtime behavior when mixing compiling STL in mixed mode or even the debugger going crazy (but I didn't test the debugger in this case, I should). The most interesting try out was with extension mfc dll. I was amazed to see how easy it was to convert one into a "regular" one ( yes it depends how much you care with strange warning , but as long it works..,,)and compiling it for the "managed" purpose obviously. Only drawback that I didn't  see "workarounded" in any forum is the almost obligatory use of the AFX_MANAGE_STATE macro that get boring to add anywhere when you are using a gdi resource i guess (just say any where if you want to avoir trouble). And very difficult to diagnose . My next article in mixed-mode programming should be to see how it fit to use generic. A recent problem I got when you define a class as "ref" (managed) you cannot have multiple inheritance (without interface as well). I have read somewhere that the T generic parameter could not appear into the base classe. Another thing going right into the next OMNITECHIE laboratory test for your own pleasure.

Rick


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Categories:
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Related posts

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

September 7. 2008 05:55