Results 1 to 40 of 113

Thread: VB Multithread Library (Generic Multithreading)

Threaded View

  1. #11
    Addicted Member
    Join Date
    Apr 2017
    Location
    India
    Posts
    238

    Re: VB Multithread Library (Generic Multithreader)

    Quote Originally Posted by Krool View Post
    Here is a solution to use the VBMThread11.DLL Registration-Free. (Side-by-side)
    Keep in mind that this technology needs at minimum Windows XP SP2 or Windows Server 2003.

    Big thanks goes to 'the trick' for the solution with "comInterfaceExternalProxyStub" in the manifest.

    Tutorial:
    The "Development" machine needs to register VBMThread11.DLL as usual and use the components for e.g. in a Std-EXE project.
    The source project needs to include the Side-by-side resources. (see below)
    Then on the "End user" machine you only need the VBMThread11.DLL and the .exe (Std-EXE project) on the same folder.
    It will work then without any registration.

    The source code of "VBMThread11SideBySide.res" is:

    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
       <file name="VBMThread11.DLL">
          <typelib tlbid="{1A02D9E1-9609-40B3-8AFE-727D8A144707}" version="1.0" flags="" helpdir="" />
          <comClass clsid="{AAE10FA6-5E20-4FA7-9649-678DC3971353}" tlbid="{1A02D9E1-9609-40B3-8AFE-727D8A144707}" threadingModel="Apartment" progid="VBMThread11.Thread" description="" />
       </file>
       <comInterfaceExternalProxyStub
          name = "_Thread"
          iid="{71154E34-A914-4E30-A4BA-5CE94A6D9C46}"
          proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"
          baseInterface="{00000000-0000-0000-C000-000000000046}"
          tlbid="{1A02D9E1-9609-40B3-8AFE-727D8A144707}">
       </comInterfaceExternalProxyStub>
       <comInterfaceExternalProxyStub
          name = "__Thread"
          iid="{403717A2-9E4E-4FEC-B77A-62DC68B9C294}"
          proxyStubClsid32="{00020420-0000-0000-C000-000000000046}"
          baseInterface="{00000000-0000-0000-C000-000000000046}"
          tlbid="{1A02D9E1-9609-40B3-8AFE-727D8A144707}">
       </comInterfaceExternalProxyStub>
       <comInterfaceExternalProxyStub
          name = "_ThreadData"
          iid="{55A8AC17-7DB5-468D-93BD-86E8B97C53A5}"
          proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"
          baseInterface="{00000000-0000-0000-C000-000000000046}"
          tlbid="{1A02D9E1-9609-40B3-8AFE-727D8A144707}">
       </comInterfaceExternalProxyStub>
       <comInterfaceExternalProxyStub
          name = "_IThread"
          iid="{68F61D7E-21CD-41E6-AFEC-C3820C6743D5}"
          proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"
          baseInterface="{00000000-0000-0000-C000-000000000046}"
          tlbid="{1A02D9E1-9609-40B3-8AFE-727D8A144707}">
       </comInterfaceExternalProxyStub>
       <comInterfaceExternalProxyStub
          name = "_IThreadStatusCallback"
          iid="{09256C4A-7A89-40F6-BBEE-3D5445942C4A}"
          proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"
          baseInterface="{00000000-0000-0000-C000-000000000046}"
          tlbid="{1A02D9E1-9609-40B3-8AFE-727D8A144707}">
       </comInterfaceExternalProxyStub>
    </assembly>
    In the attachment I have added the same as a compiled resource.
    Dear Krool,

    First of all, I wish to inform that this is the first time I have found the need to go in for MultiThreading. So, while searching in the net, I landed first on Olaf's solution - at https://www.vbforums.com/showthread....-(simple-Demo) - which led to https://www.vbforums.com/showthread....rot-Rendering) - which provides a DLL route also to achieve MultiThreading. I have not explored these solutions yet.

    Point A)
    Coming to your solution, kindly educate/clarify on the following. I am asking these for clear understanding on the fundamental things, during development and deployment.
    --
    1. Registering VBMThread11.DLL alone is enough as far as I keep working on my "Development" machine. Right?

    2. My source project needs to include the Side-by-side resource ONLY in the case of the ""End user" machine. Right? And this inclusion is required so that registration of the DLL can be avoided in user-end. Right? In other words, if DLL registration is done in user-end also, then inclusion of your side-by-side resource ("VBMThread11SideBySide.res") in my project is not required. Right?

    3. Even in my "Development" system, if I include your side-by-side resource ("VBMThread11SideBySide.res") in my project, then registering of the DLL is not necessary in my "Development" system too. Right?
    --

    Though I will be eventually including your side-by-side resource in my project so that registration is avoided at user-end, still for my understanding purpose, I request you to educate me on the above 3 questions, so that I get a clear understanding of the fundamental matters.

    Point B)
    Coming to the task of including your side-by-side resource in my source project, how exactly should I do that? I am asking this because I already have an existing .res file in my project and VB6 allows to add only one resource file at any time.

    Further, when I open my project's existing .res file in Notepad, I find that its top few lines are almost exactly the same as the contents## I find in the 'Resources.res' file in the "..\..\VBMThread11Demo\Resources" directory of yours. Thereafter, the details in my .res file pertain to the other files (quite many) I have added to it later on, via the VB6 IDE.

    The top few lines of contents##, as far as I have understood over the years, pertain to the 'Visual Styles' aspect. So, what I need to add now to my project are only the contents of your "VBMThread11SideBySide.res" file. Right? But, how do I add the contents of your "VBMThread11SideBySide.res" file into my already existing .res file? What is the correct procedure so that the added contents do what they are supposed to do. Kindly please let me know.

    I used "Add Custom Resource" in the 'VB Resource editor' to add "VBMThread11SideBySide.res" to my .res file. After that, when my .res file is viewed in Notepad, I see that the contents of "VBMThread11SideBySide.res" gets added at the very end of my .res file. Is this correct? Will this be enough for safe deployment of my app at user-end? If not, kindly let me know the correct procedure.

    I also read some years back that the .res file size should be a multiple of 4096 or something like ,that. I don't know in relation to what I read that info. Should that be the case for my .res file too after adding the contents of "VBMThread11SideBySide.res" to it. If so, how to ensure that correct size for my .res? Kindly educate.

    Point C)
    Well, apart from the above procedure which I request you to let me know, if I use Olaf's "DirectCom.DLL' method, then that will also automatically register your "VBMThread11.DLL" in end-user machine. Right? If so, no need to add the contents of "VBMThread11SideBySide.res" to my .res file. Right?

    I take this opportunity to once again thank you for all your fabulous free contributions so far. God Bless you! God Bless all!

    Kind Regards.

    (##)
    --
    ÿÿ ÿÿ ˜ ÿÿ ÿÿ 0 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <dependency>
    <dependentAssembly>
    <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" language="*" processorArchitecture="*" publicKeyToken="6595b64144ccf1df"/>
    </dependentAssembly>
    </dependency>
    </assembly>
    --

    Edit 1:
    - While using "Add Custom Resource", I did move the added content to "#24" and gave '2' for ID since the earlier manifest contents (for Visual Styles) I have under "#24" has the ID '1' already.
    - While waiting to see the perfectly right procedure from you, I did try ResourceHacker; added the contents of "VBMThread11SideBySide.res" below the already existing contents of ID 1 under "#24"; saved into a new .res file (say aaa.res); deleted the existing .res in my project; tried to add aaa.res to my project but it did not get added. Probably the DWord alignment was not present.
    - Will try the code given by LaVolpe (at https://www.vbforums.com/showthread....=1#post5485439) soon.

    Edit 2:
    Tried the code given by LaVolpe. Seems to do the same thing as I did manually using "Add Custom Resource" except that the combined .res file got by using LaVolpe's code was few bytes lesser than the updated .res file I got after I manually modified it using "Add Custom Resource".
    Last edited by softv; Nov 16th, 2023 at 12:42 PM.

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