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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. TAB Key problem in COM Client Vs C# Component

TAB Key problem in COM Client Vs C# Component

Scheduled Pinned Locked Moved C#
csharpquestionvisual-studiocom
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.
  • S Offline
    S Offline
    Sivakumar R
    wrote on last edited by
    #1

    Hi all, My requirement is to develop a Windows Control Library in C# and use that control in COM Client (VB6). Well! I was able to do all these succssfully. But while clicking TAB key on my control, when it is displayed in the COM Client, it does not behave as expected. ie, it is not moving it focuses to the next control. It doesn't look like it is recognizing the TAB key click event. I understand that it is a problem with message loop that the .NET control uses and the message loop that the COM client application provides are fundamentally different. How can I solve this problem? Please suggest me some code snippets. Thanks in Advance!!! Sivakumar R

    R 1 Reply Last reply
    0
    • S Sivakumar R

      Hi all, My requirement is to develop a Windows Control Library in C# and use that control in COM Client (VB6). Well! I was able to do all these succssfully. But while clicking TAB key on my control, when it is displayed in the COM Client, it does not behave as expected. ie, it is not moving it focuses to the next control. It doesn't look like it is recognizing the TAB key click event. I understand that it is a problem with message loop that the .NET control uses and the message loop that the COM client application provides are fundamentally different. How can I solve this problem? Please suggest me some code snippets. Thanks in Advance!!! Sivakumar R

      R Offline
      R Offline
      rudy net
      wrote on last edited by
      #2

      Sorry I can't help you but can you tell me how you created the COM object using C#? A while ago I tried it and I could only create a COM+ which was not visible from VB6, so I ended up creating my COM using VB.net instead of C# because the COM class was available only in VB.net. Thanks, Rudy.

      S 1 Reply Last reply
      0
      • R rudy net

        Sorry I can't help you but can you tell me how you created the COM object using C#? A while ago I tried it and I could only create a COM+ which was not visible from VB6, so I ended up creating my COM using VB.net instead of C# because the COM class was available only in VB.net. Thanks, Rudy.

        S Offline
        S Offline
        Sivakumar R
        wrote on last edited by
        #3

        I meant, using COM Interop I have imported the .C# component to COM component. These are the steps to create the COM Interop component in C# 1. Create a class library or windows control library project. 2. Add the required methods. 3. Goto Project-> Propeties and select Build 4. Check Register for COM Interop option 5. Compile the project 6. use the regasm.exe utility to register create type library and register the components with /codebase switch (ex : >regasm mycontrol.dll /tlb:mycontrol.tlb /codebase 7. Now the assembly is registered in your system. 8. Open the vb project and add reference for this component. 9. Now you can access the .NET component in vb6 as if you access other components. Thanks Sivakumar R

        R 1 Reply Last reply
        0
        • S Sivakumar R

          I meant, using COM Interop I have imported the .C# component to COM component. These are the steps to create the COM Interop component in C# 1. Create a class library or windows control library project. 2. Add the required methods. 3. Goto Project-> Propeties and select Build 4. Check Register for COM Interop option 5. Compile the project 6. use the regasm.exe utility to register create type library and register the components with /codebase switch (ex : >regasm mycontrol.dll /tlb:mycontrol.tlb /codebase 7. Now the assembly is registered in your system. 8. Open the vb project and add reference for this component. 9. Now you can access the .NET component in vb6 as if you access other components. Thanks Sivakumar R

          R Offline
          R Offline
          rudy net
          wrote on last edited by
          #4

          Thanks for the reply. I followed your steps and was able to create the COM; however, I can't see any of the methods of my COM object in VB6. I can only see the class. In vb.net this happened if I didn't declare the COMClass attribute which specifies the GUIDs for classId, interfaceId, and eventsId. Don't I need the same in C#? Thanks, Rudy.

          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