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. Visual Basic
  4. COM INTEROP SERVICES

COM INTEROP SERVICES

Scheduled Pinned Locked Moved Visual Basic
helpcomcsharpwindows-admin
3 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
    Juvil John
    wrote on last edited by
    #1

    I made a VB.NET Control used in VB6 Application... I checked the Register Object fo Com Interop in the project properties. after compiling placed it in a testing machine tried registering it and gives an error "The DLLRegisterServer entry point was not found. File Cannot be registered." so i placed this code inside the control guessing this would somehow solve the problem... ------------------------------------------------------------------------------------- Public Class ComRegistration #Region "COM Registration " ' This function is called when registered _ Private Shared Sub ComRegister(ByVal t As Type) Dim keyName As String = "CLSID\" & t.GUID.ToString("B") Dim key As RegistryKey = Registry.ClassesRoot.OpenSubKey(keyName, True) key.CreateSubKey("Control").Close() Dim subkey As RegistryKey = key.CreateSubKey("MiscStatus") subkey.SetValue("", "131457") subkey = key.CreateSubKey("TypeLib") Dim libid As Guid = Marshal.GetTypeLibGuidForAssembly(t.Assembly) subkey.SetValue("", libid.ToString("B")) subkey = key.CreateSubKey("Version") Dim ver As Version = t.Assembly.GetName().Version Dim version As String = String.Format("{0}.{1}", ver.Major, ver.Minor) If version = "0.0" Then version = "1.0" subkey.SetValue("", version) End Sub ' This is called when unregistering _ Private Shared Sub ComUnregister(ByVal t As Type) ' Delete entire CLSID\{clsid} subtree Dim keyName As String = "CLSID\" + t.GUID.ToString("B") Registry.ClassesRoot.DeleteSubKeyTree(keyName) End Sub #End Region ------------------------------------------------------------------------------------ after compiling the project and registering it in a testing machine still doesnt work... Can anyone help me? I might have missed something...

    D 1 Reply Last reply
    0
    • J Juvil John

      I made a VB.NET Control used in VB6 Application... I checked the Register Object fo Com Interop in the project properties. after compiling placed it in a testing machine tried registering it and gives an error "The DLLRegisterServer entry point was not found. File Cannot be registered." so i placed this code inside the control guessing this would somehow solve the problem... ------------------------------------------------------------------------------------- Public Class ComRegistration #Region "COM Registration " ' This function is called when registered _ Private Shared Sub ComRegister(ByVal t As Type) Dim keyName As String = "CLSID\" & t.GUID.ToString("B") Dim key As RegistryKey = Registry.ClassesRoot.OpenSubKey(keyName, True) key.CreateSubKey("Control").Close() Dim subkey As RegistryKey = key.CreateSubKey("MiscStatus") subkey.SetValue("", "131457") subkey = key.CreateSubKey("TypeLib") Dim libid As Guid = Marshal.GetTypeLibGuidForAssembly(t.Assembly) subkey.SetValue("", libid.ToString("B")) subkey = key.CreateSubKey("Version") Dim ver As Version = t.Assembly.GetName().Version Dim version As String = String.Format("{0}.{1}", ver.Major, ver.Minor) If version = "0.0" Then version = "1.0" subkey.SetValue("", version) End Sub ' This is called when unregistering _ Private Shared Sub ComUnregister(ByVal t As Type) ' Delete entire CLSID\{clsid} subtree Dim keyName As String = "CLSID\" + t.GUID.ToString("B") Registry.ClassesRoot.DeleteSubKeyTree(keyName) End Sub #End Region ------------------------------------------------------------------------------------ after compiling the project and registering it in a testing machine still doesnt work... Can anyone help me? I might have missed something...

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You don't need that code in your component. You can't use REGSVR32 to register a COM exposed .NET component. You have to use REGASM[^] for that.

      Dave Kreskowiak Microsoft MVP - Visual Basic

      J 1 Reply Last reply
      0
      • D Dave Kreskowiak

        You don't need that code in your component. You can't use REGSVR32 to register a COM exposed .NET component. You have to use REGASM[^] for that.

        Dave Kreskowiak Microsoft MVP - Visual Basic

        J Offline
        J Offline
        Juvil John
        wrote on last edited by
        #3

        Ok now thats a big help... thanks... :D

        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