Quote Originally Posted by The trick View Post
This problem is related to registering your Ax-component not module. Just register it properly.
Hello trick,

It does'nt matter whether I use

Dim x As ATLSIMPLEOBJDENOLib.atlsimpleobjforvb or Dim x As Object in the simplevbatlclient standard exe project already attached

If I comment

Set x = CreateActiveXObjectInNewThread2("ATLSIMPLEOBJDENOLib.atlsimpleobjforvb", , asyncid)

and use

Set x = New atlsimpleobjforvb

the simplevbatlclient project works fine .

This implies that the atl component is registered properly in the already attached atlsimpleobjdeno atl project.

What I observed was that CLSIDFromProgID returns < 0 making Err.Raise 5 being called in modMultiThreading2.bas in CreateActiveXObjectInNewThread2 function

Code:
' // Create new ActiveX object in the new thread by ProgID
Public Function CreateActiveXObjectInNewThread2( _
                ByRef sProgID As String, _
                Optional ByVal pIID As Long, _
                Optional ByRef lAsynchId As Long) As IUnknown
    Dim tClsId  As tCurGUID
    
    If CLSIDFromProgID(StrPtr(sProgID), tClsId) < 0 Then
        Err.Raise 5
    End If
    
    Set CreateActiveXObjectInNewThread2 = CreateActiveXObjectInNewThread(VarPtr(tClsId), pIID, lAsynchId)
    
End Function
I tried to compile simplevbatlclient in admin mode and also run the Project1.exe in admin mode but I get same error.

thanks