Page 2 of 2 FirstFirst 12
Results 41 to 54 of 54

Thread: New code for simulating multithreading in VB6...

  1. #41
    Junior Member
    Join Date
    May 2008
    Posts
    24

    Re: New code for simulating multithreading in VB6...

    Dear mr woka,is it possible to connect to other application too??Thanks a lot..

  2. #42
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: New code for simulating multithreading in VB6...

    @Wokawidget: Thanks a lot for this multithreading project...

    I will try experimenting with it....

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  3. #43
    New Member
    Join Date
    Sep 2010
    Posts
    2

    Re: Simulating multithreading in VB6 - error if using manifest

    Although WokaWidget's multithreading code is quite old now, it is ideal for what I am doing (spread a large VB6 number-crunching simulation across multiple processor cores).

    Had it all working in the IDE and compiled, but then when I add a manifest file, the mobjgateway DLL immediately crashes with an error on SetWindowsLong

    This problem is simple to reproduce with WokaWidgets vbGateway2\Demo\Project1 code. Just add a standard 'XP' manifest (as project1.exe.manifest containing the usual mscomctl assembly for XP look). Start up project1.exe and bingo - you get an error 'Unable to hook window', which is generated by SetWindowLong in sub HookWindow in mobjgateway.vbp

    SO... Can anyone tell me what the manifest is screwing up and why? Then point me at how to resolve it???

    Thanks

    (The original zip file is at http://www.vbforums.com/attachment.p...1&d=1089126436)

  4. #44

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: New code for simulating multithreading in VB6...

    Wow. Never seen than before.
    I have never really done any work in anger with manifest files and vb6 I am afraid.
    But why it should cause an error of that nature is a bit of a mystery.

    Can you post a screen shot of the error...and the function, including all the functions lines of code, where this occured.

    cheers,

    woka

    ps Glad you like it

  5. #45

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Re: New code for simulating multithreading in VB6...

    While I do love my vbGateway code...it's a little bit outdated now thanks to .NET.
    You know you can do in .NET in a few lines of code what this entire project does?

    Woka

  6. #46
    New Member
    Join Date
    Sep 2010
    Posts
    2

    Re: Simulating multithreading in VB6 - doesn't work with manifest file

    Woka,

    Here are the full details of the problem with vbGateway. I have stripped out all the code down to the bare minimum - even removing the .startlink

    The test code

    Code:
    Option Explicit
    Private WithEvents mobjGateway As Gateway
    Private Sub Form_Load()
        Set mobjGateway = New Gateway
    End Sub
    Procedure: The attached zip file contains the vbp and also the manifest file. The second zip is the original Woka gateway code with vbGateway2

    1. Compile vbGateway2 and register the dll

    2. Compile SimpleDemo (after adding the wokawidget gateway reference of course)

    3. Now run SimpleDemo.exe and you will see -


    This seems to be from vbGateway2 'HookWindow' -
    Code:
    Public Sub HookWindow(ByRef pobjGateway As Gateway)
    Dim lngOldWndProc       As Long
        lngOldWndProc = SetWindowLong(pobjGateway.hWnd, GWL_WNDPROC, AddressOf WndProc)
        If lngOldWndProc > 0 Then
            pobjGateway.OldWndProc = lngOldWndProc
            If mcolItems Is Nothing Then
                Set mcolItems = New Collection
            End If
            mcolItems.Add ObjPtr(pobjGateway), CreateKey(pobjGateway.hWnd)
        Else
            Err.Raise vbObjectError, App.EXEName, "Unable to hook window."
        End If
    End Sub
    4. Now rename SimpleDemo.exe.manifest as, say, TTSimpleDemo.exe.manifest. Start SimpleDemo again - it works fine

    5. Now put SimpleDemo.exe.manifest back again and edit SimpleDemo.vbp to remove the 'Set mobjGateway = New Gateway' statement. Compile and run again - it works fine as well. (By the way, the reason the 'DoesNothing' button is there is simply to show that the manifest is working and doesn't have an error (i.e. you see the XP-style button).

    I have no idea why the manifest is screwing up the gateway - I always thought it simply forces use of the 6.0 version of MSCOMCTL (along with InitCommonControls in the code, which I have also stripped out in this test).

    Help!!
    Attached Files Attached Files

  7. #47
    Member
    Join Date
    Jun 2009
    Posts
    62

    Re: New code for simulating multithreading in VB6...

    Hi
    Im trying to test this code but when i open vbgateway2.vbp then i get this message in vb6:
    Unable to set version compatible component: c:/program files/student works/common/compatible/vbgateway2.dll

    How to fix it?

  8. #48
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: New code for simulating multithreading in VB6...

    Quote Originally Posted by Breathless View Post
    Hi
    Im trying to test this code but when i open vbgateway2.vbp then i get this message in vb6:
    Unable to set version compatible component: c:/program files/student works/common/compatible/vbgateway2.dll
    Try using the version in post 46 if the one in post #1 is causing the problem or vice-verse. If the source code of the dll is included recompile it with the version compatibility set to none. Save the project then recompile using "Binary Compatibility" using the previous dll you just created as the reference.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  9. #49
    Member
    Join Date
    Jun 2009
    Posts
    62

    Re: New code for simulating multithreading in VB6...

    Quote Originally Posted by Nightwalker83 View Post
    Try using the version in post 46 if the one in post #1 is causing the problem or vice-verse. If the source code of the dll is included recompile it with the version compatibility set to none. Save the project then recompile using "Binary Compatibility" using the previous dll you just created as the reference.
    Hi thank you for interesting my problem.
    The point is this error Message is appearing when i open source code of this dll. There are no compiled dll in this package. Other test projects in this package are opening but they require this dll. If i compile it althought this error message then using it as a reference i get actixeX error.

    I done what you suggested but it dosnt help. There are still the same error. What can i else do?

  10. #50
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: New code for simulating multithreading in VB6...

    Make sure you unselect the dll reference in the main projects (project that uses the dll) then save it and re reference the dll again.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  11. #51
    Member
    Join Date
    Jun 2009
    Posts
    62

    Re: New code for simulating multithreading in VB6...

    Good point thanks now i can open and test project from /demo/ folder. It works great. But i still have problems with demos in /Multithreading/ folder.
    DemoUi - there are still errors with activex obkect when i click search.
    Set objsearch = CreateObject("searchThread.clsNewSearch")
    This is highlighten

    ThreadUI - no errors, but nothing happens when i Run this project.

    What can i do to run it?

  12. #52
    Member
    Join Date
    Jun 2009
    Posts
    62

    Re: New code for simulating multithreading in VB6...

    Nobody?

  13. #53
    New Member
    Join Date
    Jan 2014
    Posts
    1

    Re: Simulating multithreading in VB6 - doesn't work with manifest file

    Well - over three years later your post helped me. I had a manifest file which didn't take effect in the IDE so everything worked. Outside the IDE - crash with the same message you mentioned. I can live without the manifest!

  14. #54
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: New code for simulating multithreading in VB6...

    `If lngOldWndProc > 0 Then` in `HookWindow` code seems to be awfully wrong. Has to be `If lngOldWndProc <> 0 Then` for sure.

    Whether this will fix issue with manifests is a separate question :-))

    cheers,
    </wqw>

Page 2 of 2 FirstFirst 12

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