Creatable COM class, make singleton

  • Thread starter Thread starter Alexander Israel
  • Start date Start date
A

Alexander Israel

Guest
Hello, I have a creatable COM class in VB. The object created in VBA (xlam) but if loaded number of times become frozen in low resources system. Is there a way to use singleton? My try was not successful. Seems Public Sub New have to be present as is and can't be private or replaced by a public method with output.

Any ideas appreciated in advance.

Here is how the COM class starts in .NET:


Imports System.Runtime.InteropServices
Imports CIT.COMtoolsExtension
Imports System.IO
Imports System.Data
Imports System.Linq
Imports System.Data.DataRow
Imports System.Windows
<ProgIdAttribute("CIT.TikQuery17"), _
ComClass(TikQuery17.ClassId, TikQuery17.InterfaceId, TikQuery17.EventsId)> _
Public Class TikQuery17
Implements IDisposable
#Region "COM GUIDs"
' These GUIDs provide the COM identity for this class
' and its COM interfaces. If you change them, existing
' clients will no longer be able to access the class.
Public Const ClassId As String = "b6b16dd7-12ce-4746-8317-b10461cfb81a"
Public Const InterfaceId As String = "60f044d3-0d3f-435f-9dce-76c6be9ac8ce"
Public Const EventsId As String = "dde8f4da-aeb6-4d7b-8b24-be56a169f1f3"
#End Region
' A creatable COM class must have a Public Sub New()
' with no parameters, otherwise, the class will not be
' registered in the COM registry and cannot be created
' via CreateObject.
Public Sub New()
MyBase.New()
End Sub
Public Property PeriodsForm As frmPeriods = Nothing

Public Function ShowQCform(ByRef ErrCode As Integer, ByRef TargetPath As String) As Object





Alexander




Alexander Israel

Continue reading...
 
Back
Top