Results 1 to 40 of 172

Thread: using VbTrickThreading-master examples without the typelibs for Callback and Marshal

Hybrid View

  1. #1
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,454

    Re: using VbTrickThreading-master examples without the typelibs for Callback and Mar

    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

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2015
    Posts
    356

    Re: using VbTrickThreading-master examples without the typelibs for Callback and Mar

    Quote Originally Posted by Schmidt View Post
    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
    Dear Olaf,

    I already corrected the ProgID to MyForms.ucTest in the post #136 but I was getting the same error which I solved by using Trick's post
    http://www.vbforums.com/showthread.p...-Marshal/page2 #71
    Thankyou for the example.

    regards,
    JSVenu

  3. #3
    PowerPoster
    Join Date
    Jan 2020
    Posts
    5,541

    Re: using VbTrickThreading-master examples without the typelibs for Callback and Mar

    Why haven't you moved in these two days?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width