Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Reusing CodeGuru Software

Reusing CodeGuru Software

Scheduled Pinned Locked Moved C#
c++questioncsharpcomlounge
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Josep L Colom
    wrote on last edited by
    #1

    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

    S 1 Reply Last reply
    0
    • J 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

      S Offline
      S Offline
      Stephane Rodriguez
      wrote on last edited by
      #2

      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.

      J 1 Reply Last reply
      0
      • S Stephane Rodriguez

        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.

        J Offline
        J Offline
        Josep L Colom
        wrote on last edited by
        #3

        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..

        S 1 Reply Last reply
        0
        • J Josep L Colom

          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..

          S Offline
          S Offline
          Stephane Rodriguez
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups