Author Topic: Launching DC V24 by OLE  (Read 888 times)

Juergen

  • Jr. Member
  • **
  • Posts: 94
Launching DC V24 by OLE
« on: February 15, 2015, 06:31:05 AM »
  Launching DC 24 with
 
        On Error Resume Next
        DcApp = GetObject(,"DesignCAD.Application")
        If DcApp Is Nothing Then
            DcApp = New DesignCAD.Application
        End If
      
fails, DC V23 is launched.

I have tried Dcad24 /regserver and running once as administrator. Dcd files
are assigned to V24, this works (but not lauching by OLE).

Renaming dcad23.exe helps.

This is also fine:

        If DcApp Is Nothing Then
            Dim SubKey As String = "DesignCAD.DCD-Document.24\shell\open\command"
            Dim rk As RegistryKey = Registry.ClassesRoot.OpenSubKey(SubKey)
            Dim DcPath As String = CType(rk.GetValue("", ""), String)
            Dim DcPath2 = DcPath.Remove(DcPath.Length - 3, 3)
            Process.Start(DcPath2)
            Thread.Sleep(2500)
            DcApp = GetObject(, "DesignCAD.Application")
        End If
      
I guess this is a matter of the registry.
Does someone know a better solution?

Kind regards,

Juergen

Juergen

  • Jr. Member
  • **
  • Posts: 94
Re: Launching DC V24 by OLE
« Reply #1 on: February 15, 2015, 09:10:35 AM »
I just noticed the problem only happens in case V23 is installed.
On another machine with DC21 and DC22 DesignCAD V24 is launched as expected.

May be V23 and V24 have the same GUID?

Juergen
« Last Edit: February 15, 2015, 09:40:30 AM by Juergen »

DrollTroll

  • Kindly Curmudgeon
  • Administrator
  • *****
  • Posts: 4121
Re: Launching DC V24 by OLE
« Reply #2 on: February 17, 2015, 08:01:16 AM »
Did you try running dcad24 /regserver in an Administrator-elevated command prompt?

To change the current COM settings, DesignCAD needs admin-level access to HKLM. This requires an admin-level command prompt (even if you're running on an Admin account). Thanks Microsoft!
2016 marks my 24th year in DesignCAD-Land!

Juergen

  • Jr. Member
  • **
  • Posts: 94
Re: Launching DC V24 by OLE
« Reply #3 on: February 17, 2015, 08:18:46 AM »
DT thanks!

Administrator-elevated command prompt are the magic words.  ;D

Kind regards,

Juergen