Quote Originally Posted by jsvenu View Post
As I said when we add a button to fThreaded form in activex dll project MyForms and try to add the usercontrol through the button as follows:
...
...we get the following error( in msgbox )when we run the app in conpiled mode and click on this button on displayed fThreaded form.

err:711,Invalid class string.
Looking for object with ProgID: ucTest.ctlTest,MyForms
No, I cannot reproduce that...
As said, this kind of threading is as safe as can be.

So (just in case), you should *not* include any of tricks "threading-support" modules -
neither into the AxExeThreading2-project, nor should they be included in MyForms-Project.
They are not needed at all.

My guess is, that you need to recompile the OCX-Project (or re-register the OCX).
Or your ProgID ("ucTest.ctlTest") is wrong.

If I try that with "wellknown ProgIDs" (for the IE-WebBrowserControl, or Krools CCR-OCX),
it works without any problem (in IDE and compiled).

Here is the complete code of fThreaded.frm in Ax-Dll MyForms:
Code:
Option Explicit

Private Sub Form_Load()
  Caption = Caption & " ThreadID: " & App.ThreadID
End Sub

Private Sub Command1_Click()
  Controls.Add("Shell.Explorer.2", "WebBrowser1").Visible = True
  Controls.Add("VBCCR16.TextBoxW", "TextBox1").Visible = True
End Sub
HTH

Olaf