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. Create .NET COM dll as existing C++ COM

Create .NET COM dll as existing C++ COM

Scheduled Pinned Locked Moved C#
csharpc++comhelp
6 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.
  • M Offline
    M Offline
    MrKBA
    wrote on last edited by
    #1

    Hi, I have to create .NET COM dll which will be used fro existing client applications. So what I need is : - create interface with SAME NAME AND GUID - create class implementing this interface ann have SAME NAME AND GUID as one in c++ - client should not rebuild or recompiled (save compatibility) Any help please

    P 1 Reply Last reply
    0
    • M MrKBA

      Hi, I have to create .NET COM dll which will be used fro existing client applications. So what I need is : - create interface with SAME NAME AND GUID - create class implementing this interface ann have SAME NAME AND GUID as one in c++ - client should not rebuild or recompiled (save compatibility) Any help please

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Extract the type library from your COM DLL. Use tlbimp.exe to import this typelibrary (it will create this as a separate assembly which you might want to reintegrate back into your code using a tool such as Reflector).

      This space for rent

      M 1 Reply Last reply
      0
      • P Pete OHanlon

        Extract the type library from your COM DLL. Use tlbimp.exe to import this typelibrary (it will create this as a separate assembly which you might want to reintegrate back into your code using a tool such as Reflector).

        This space for rent

        M Offline
        M Offline
        MrKBA
        wrote on last edited by
        #3

        thank you for response but can you tell me how extracting tlb from c++ com because tlbExp not works

        P L 2 Replies Last reply
        0
        • M MrKBA

          thank you for response but can you tell me how extracting tlb from c++ com because tlbExp not works

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          Really? Your first thought wasn't to go to Google for this[^]?

          This space for rent

          1 Reply Last reply
          0
          • M MrKBA

            thank you for response but can you tell me how extracting tlb from c++ com because tlbExp not works

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            A Batch file to make it more easy to Register the COM visible assembly and create the tlb: RegMyComVisible.bat

            echo off
            cd %~dp0

            rem The following two path you Need to adjust to your needs
            set regasm_tool= "C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe"
            set assembly= "C:\YourProject\YourComVisible.dll"

            rem unregister previous version
            %regasm_tool% %assembly% /u

            rem Register actual Version and create a YourComVisible.tlb
            %regasm_tool% %assembly% /codebase /tlb

            pause

            Make sure to run it as admin: Right Click RegMyComVisible.bat and select "Run As Admin". I hope it helps.

            M 1 Reply Last reply
            0
            • L Lost User

              A Batch file to make it more easy to Register the COM visible assembly and create the tlb: RegMyComVisible.bat

              echo off
              cd %~dp0

              rem The following two path you Need to adjust to your needs
              set regasm_tool= "C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe"
              set assembly= "C:\YourProject\YourComVisible.dll"

              rem unregister previous version
              %regasm_tool% %assembly% /u

              rem Register actual Version and create a YourComVisible.tlb
              %regasm_tool% %assembly% /codebase /tlb

              pause

              Make sure to run it as admin: Right Click RegMyComVisible.bat and select "Run As Admin". I hope it helps.

              M Offline
              M Offline
              MrKBA
              wrote on last edited by
              #6

              But my COM dll is C++ dll and couldn't be registred as you say .

              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