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. Managed C++/CLI
  4. How to create C# Control for any language

How to create C# Control for any language

Scheduled Pinned Locked Moved Managed C++/CLI
csharptutorialc++question
12 Posts 3 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.
  • A Andy Rama

    Hi all, How to create a C# control (using VC# 2008 .Net) which can be used in any language (mainly in VC++ 2008 .Net)? Please guide me. I appreciate any and all comments and suggestions. Thanks in advance. Regards, Aniket A. Salunkhe

    P Offline
    P Offline
    Paul Conrad
    wrote on last edited by
    #3

    Any control you create in C#, or even VB.NET, can be used by the other .NET languages. You have to add a reference to the .dll containing your control.

    "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

    A 1 Reply Last reply
    0
    • P Paul Conrad

      Any control you create in C#, or even VB.NET, can be used by the other .NET languages. You have to add a reference to the .dll containing your control.

      "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

      A Offline
      A Offline
      Andy Rama
      wrote on last edited by
      #4

      Hi, Thanks to you both for reply.

      Paul Conrad wrote:

      can be used by the other .NET languages

      I am using VC++.Net 2008, but I am doing MFC Application.

      Paul Conrad wrote:

      add a reference to the .dll containing your control

      How to add reference to .dll in MFC Application using VC++.Net 2008? And even after adding reference in MFC Application, how to add/use custom ActiveX Control? Scenario is, ActiveX Control in VC#.Net 2008 as 'Windows Form Control Library'. Application in VC++.Net 2008 as 'MFC Application' (as I am doing DirectShow programming in it). When I try to add my ActiveX Control through 'Insert ActiveX Control', it doesn't show it in that list. When I try to register the control using 'regsvr32.exe' it shows error as, DllRegisterServer Failed Thanks & Regards, Aniket A. Salunkhe

      modified on Friday, September 19, 2008 3:32 AM

      P 1 Reply Last reply
      0
      • M Mark Salsbery

        What is a C# control? If you build a library using C#, then all public classes in that library can be consumed by any of the .NET languages.

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        A Offline
        A Offline
        Andy Rama
        wrote on last edited by
        #5

        Hi, Thanks for reply.

        Mark Salsbery wrote:

        consumed by any of the .NET languages.

        I want to add my 'Windows Form Control Library' (i.e. VC#.Net 2008 ActiveX Control) in my MFC Application of VC++.Net 2008. Thanks & Regards, Aniket A. Salunkhe

        M 1 Reply Last reply
        0
        • A Andy Rama

          Hi, Thanks to you both for reply.

          Paul Conrad wrote:

          can be used by the other .NET languages

          I am using VC++.Net 2008, but I am doing MFC Application.

          Paul Conrad wrote:

          add a reference to the .dll containing your control

          How to add reference to .dll in MFC Application using VC++.Net 2008? And even after adding reference in MFC Application, how to add/use custom ActiveX Control? Scenario is, ActiveX Control in VC#.Net 2008 as 'Windows Form Control Library'. Application in VC++.Net 2008 as 'MFC Application' (as I am doing DirectShow programming in it). When I try to add my ActiveX Control through 'Insert ActiveX Control', it doesn't show it in that list. When I try to register the control using 'regsvr32.exe' it shows error as, DllRegisterServer Failed Thanks & Regards, Aniket A. Salunkhe

          modified on Friday, September 19, 2008 3:32 AM

          P Offline
          P Offline
          Paul Conrad
          wrote on last edited by
          #6

          Aniket Salunkhe wrote:

          How to add reference to .dll in MFC Application using VC++.Net 2008? And even after adding reference in MFC Application, how to add/use custom ActiveX Control?

          That's really fun. I suggest you google that one, it's involved and there's articles how to achieve it.

          "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

          1 Reply Last reply
          0
          • A Andy Rama

            Hi, Thanks for reply.

            Mark Salsbery wrote:

            consumed by any of the .NET languages.

            I want to add my 'Windows Form Control Library' (i.e. VC#.Net 2008 ActiveX Control) in my MFC Application of VC++.Net 2008. Thanks & Regards, Aniket A. Salunkhe

            M Offline
            M Offline
            Mark Salsbery
            wrote on last edited by
            #7

            Aniket Salunkhe wrote:

            i.e. VC#.Net 2008 ActiveX Control

            I don't know about ActiveX controls, but an ActiveX control written in c# should work just like any other ActiveX control... that's what they're designed to do :) Mark

            Mark Salsbery Microsoft MVP - Visual C++ :java:

            A 2 Replies Last reply
            0
            • M Mark Salsbery

              Aniket Salunkhe wrote:

              i.e. VC#.Net 2008 ActiveX Control

              I don't know about ActiveX controls, but an ActiveX control written in c# should work just like any other ActiveX control... that's what they're designed to do :) Mark

              Mark Salsbery Microsoft MVP - Visual C++ :java:

              A Offline
              A Offline
              Andy Rama
              wrote on last edited by
              #8

              Hi, Is there any way to design '.ocx' in VC#.net? Because I can't register '.dll' VC# activeX control. Thanks & Best Regards, Aniket A. Salunkhe

              1 Reply Last reply
              0
              • M Mark Salsbery

                Aniket Salunkhe wrote:

                i.e. VC#.Net 2008 ActiveX Control

                I don't know about ActiveX controls, but an ActiveX control written in c# should work just like any other ActiveX control... that's what they're designed to do :) Mark

                Mark Salsbery Microsoft MVP - Visual C++ :java:

                A Offline
                A Offline
                Andy Rama
                wrote on last edited by
                #9

                Hi all, I found something to work with MFC application, http://msdn.microsoft.com/en-us/library/b1kyh79x.aspx[^] Thanks for your support too. Now I am trying to integrate it with my MFC Application & Control, as I want to add mutiple control dynamically in MFC Dialog. But I appreciate any other better suggestions. Thanks & Best Regards, Aniket A. Salunkhe

                M 1 Reply Last reply
                0
                • A Andy Rama

                  Hi all, I found something to work with MFC application, http://msdn.microsoft.com/en-us/library/b1kyh79x.aspx[^] Thanks for your support too. Now I am trying to integrate it with my MFC Application & Control, as I want to add mutiple control dynamically in MFC Dialog. But I appreciate any other better suggestions. Thanks & Best Regards, Aniket A. Salunkhe

                  M Offline
                  M Offline
                  Mark Salsbery
                  wrote on last edited by
                  #10

                  I guess I'm confused - do you need an ActiveX control or a Windows Forms control?

                  Mark Salsbery Microsoft MVP - Visual C++ :java:

                  A 1 Reply Last reply
                  0
                  • M Mark Salsbery

                    I guess I'm confused - do you need an ActiveX control or a Windows Forms control?

                    Mark Salsbery Microsoft MVP - Visual C++ :java:

                    A Offline
                    A Offline
                    Andy Rama
                    wrote on last edited by
                    #11

                    Mark Salsbery wrote:

                    ActiveX control or a Windows Forms control

                    What is difference between these 2? I want to create a UserControl in C#. eg Analog Clock Control in C# with some properties.

                    M 1 Reply Last reply
                    0
                    • A Andy Rama

                      Mark Salsbery wrote:

                      ActiveX control or a Windows Forms control

                      What is difference between these 2? I want to create a UserControl in C#. eg Analog Clock Control in C# with some properties.

                      M Offline
                      M Offline
                      Mark Salsbery
                      wrote on last edited by
                      #12

                      ActiveX controls are OLE (COM) objects. Windows Forms controls are based on classes in the System.Windows.Forms namespace of the .NET framework. There's tons of documentation on creating and using both... Introduction to ActiveX Controls[^] Developing Custom Windows Forms Controls with the .NET Framework[^]

                      Mark Salsbery Microsoft MVP - Visual C++ :java:

                      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