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

Thread: [VB6] VBCDeclFix - The Add-in allows you to use Cdecl functions in VB6 IDE.

  1. #41
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,742

    Re: [VB6] VBCDeclFix - The Add-in allows you to use Cdecl functions in VB6 IDE.

    how do you make this add-in with 3600 lines code,
    do you work in microsoft?

  2. #42

  3. #43
    Hyperactive Member
    Join Date
    Jan 2015
    Posts
    323

    Re: [VB6] VBCDeclFix - The Add-in allows you to use Cdecl functions in VB6 IDE.

    hello the trick.
    can you tranport this addin for office vba to use?

  4. #44

  5. #45
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,742

    Re: [VB6] VBCDeclFix - The Add-in allows you to use Cdecl functions in VB6 IDE.

    Quote Originally Posted by loquat View Post
    hello the trick.
    can you tranport this addin for office vba to use?
    USE ASM,it's support vb6 ide,exe,excel vba

    Bind Cdecl Api To vb6 Function(stdcall),support run in IDE-VBForums
    https://www.vbforums.com/showthread....ort-run-in-IDE

    code in userform1:
    Code:
    Dim h As Long
    Dim CdeclApi_Add As Long
      
    Private Sub CommandButton1_Click()
    If CdeclApi_Add = 0 Then
     
        h = LoadLibrary(Application.ActiveWorkbook.Path & "\cdecl.dll")
        CdeclApi_Add = GetProcAddress(h, "Add")
        If h = 0 Or CdeclApi_Add = 0 Then MsgBox "can't find dll": Exit Sub
    
        FixCdecl GetAddress(AddressOf VB_Add), CdeclApi_Add, 2
    End If
    
    Dim a As Long, b As Long, c As Long
    a = 44
    b = 55
    
    c = VB_Add(a, b)
    MsgBox "c=" & c
    
    End Sub
    
    Private Sub UserForm_Terminate()
        RestoreFunctionMemory
        FreeLibrary h
    
    End Sub
    Last edited by xiaoyao; Mar 6th, 2021 at 09:52 AM.

  6. #46
    New Member
    Join Date
    Mar 2021
    Location
    Singapore
    Posts
    12

    Re: [VB6] VBCDeclFix - The Add-in allows you to use Cdecl functions in VB6 IDE.

    Thanks for your great job!
    I want to know if it can direct use chromedriver.exe in vb6?
    thanks a lot.
    Joh.

  7. #47
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,742

    Re: [VB6] VBCDeclFix - The Add-in allows you to use Cdecl functions in VB6 IDE.

    may be have simple way:
    c= cdeclapi_add(11,22)
    call VB_AddEsp(8)
    sub VB_AddEsp(espvalue as long)'args=2,espvalue=4
    'asm:add esp,espvalue
    end sub

  8. #48

  9. #49
    New Member
    Join Date
    Mar 2021
    Location
    Singapore
    Posts
    12

    Re: [VB6] VBCDeclFix - The Add-in allows you to use Cdecl functions in VB6 IDE.

    Quote Originally Posted by The trick View Post
    How to use this driver in C/C++? The same approach i think will be in VB6 as well.


    Stop!

    Thank you for your reply.
    I tested your Add-in, it worked great. For a long time, vb6 has always faced the threat of being eliminated. It is precisely because of a group of selfless contributors like you that make vb6's life continue, and which give courages and helps for many developers. The discussion of CDeclFix in the group gave me an idea, whether this method can be used as a universal and widely accepted method to break through the limitations of vb6 functions.It may need to use a large number of practical examples to practice.
    For example, I am currently testing the automatic operation of the browser. The most commonly used in vb6 is seleniumbasic, but Seleniumbasic has not been updated, and the so-called seleniumbaisc3.14 on the Internet is not open source, potential safety hazards would be exist.
    whether or not without relying on seleniumbasic, directly use C# or other versions of selenium in vb6 to drive chromedriver.exe? But I have almost no idea in this regard.
    If it can be realized by CDeclFix method, then it further proves VBCDeclFix's great contribution to the vitality of vb6.
    Can you give me some suggestions, or try to explore it?

    Thank you again for your kind reply!
    Joh.

  10. #50
    Hyperactive Member
    Join Date
    Jan 2015
    Posts
    323

    Re: [VB6] VBCDeclFix - The Add-in allows you to use Cdecl functions in VB6 IDE.

    Quote Originally Posted by The trick View Post
    What's the VBA version?
    vba 7.0 or 7.1, x86 will be ok
    maybe you can transport to one of the version and told us how to finish the others.

  11. #51
    Hyperactive Member
    Join Date
    Jan 2015
    Posts
    323

    Re: [VB6] VBCDeclFix - The Add-in allows you to use Cdecl functions in VB6 IDE.

    i have one question, does the compiled exe or dll need this addin at all?

  12. #52

  13. #53
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,943

    Re: [VB6] VBCDeclFix - The Add-in allows you to use Cdecl functions in VB6 IDE.

    I removed a series of posts that were unrelated to the topic of this thread aside from what appeared to be an attempt to provide an alternative solution. If anybody has a different solution to this problem, they are free to start a thread of their own, but they should not attempt to subvert this one.
    My usual boring signature: Nothing

  14. #54
    Frenzied Member
    Join Date
    Oct 2008
    Posts
    1,181

    Re: [VB6] VBCDeclFix - The Add-in allows you to use Cdecl functions in VB6 IDE.

    Quote Originally Posted by The trick View Post
    The Add-in allows you to use Cdecl functions in VB6 both declared in type libraries and using the CDecl keyword.

    If you have ever tried to use CDECL-functions declared in a TLB then you know that debugging (in IDE) is impossible. The project just has crashed and doesn't even start although compilation to native code works without any issues. A similar problem occurs when using the CDecl keyword - VB6 always generates the code with the 0x31 error (Bad Dll Calling Convention) so you can use such functions neither IDE nor compiled executable. This Add-in fixes this behavior and you can debug your code in IDE and compile the code to an executable file.
    https://github.com/thetrik/VBCDeclFix
    This is great, but how to I install it? I don't know how to install VB6 addons. Is it supposed to come with a setup.exe file? I only found the DLL file by itself.

  15. #55
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,854

    Re: [VB6] VBCDeclFix - The Add-in allows you to use Cdecl functions in VB6 IDE.

    Just register it and it should be available from the Add-In menu option.

  16. #56
    Lively Member
    Join Date
    Aug 2017
    Posts
    75

    Re: [VB6] VBCDeclFix - The Add-in allows you to use Cdecl functions in VB6 IDE.

    Quote Originally Posted by The trick View Post
    No. The Add-in is for VB6-IDE only.
    I'm trying to use lib libcurl.dll, it works perfectly in the IDE, but not in the exe, do you have any suggestions?

    Private Declare Function curl_easy_init CDecl Lib "libcurl.dll" () As Long
    Private Declare Function curl_easy_setopt CDecl Lib "libcurl.dll" (ByVal curl_easy_init As Long, ByVal OpTS As Long, Data As Any) As Long
    Private Declare Function curl_easy_perform CDecl Lib "libcurl.dll" (ByVal curl_easy_init As Long) As Long
    Private Declare Function curl_easy_cleanup CDecl Lib "libcurl.dll" (ByVal curl_easy_init As Long) As Long
    Private Declare Function curl_slist_append CDecl Lib "libcurl.dll" (ByVal curl_list_handle As Long, ByVal lpStr As String) As Long
    Private Declare Function curl_slist_free_all CDecl Lib "libcurl.dll" (ByVal curl_list_handle As Long) As Long
    Private Declare Function curl_easy_escape CDecl Lib "libcurl.dll" (ByVal curl_easy_init As Long, ByVal lpStr As String, ByVal strsize As Long) As Long
    For information
    So it worked
    Private Declare Function curl_easy_init Lib "libcurl.dll" () As Long
    not like this
    Private Declare Function curl_easy_init CDecl Lib "libcurl.dll" () As Long

  17. #57
    Hyperactive Member
    Join Date
    Jan 2015
    Posts
    323

    Re: [VB6] VBCDeclFix - The Add-in allows you to use Cdecl functions in VB6 IDE.

    i found some cdecl dll that will crash vb6ide, such as libchardet.dll ver1.0.6

  18. #58

  19. #59
    Hyperactive Member
    Join Date
    Jan 2015
    Posts
    323

    Re: [VB6] VBCDeclFix - The Add-in allows you to use Cdecl functions in VB6 IDE.

    hello the trick, can you tell me is there some patch operations that we can make to the vba6.dll itself.
    i m still working on how to transport this addin to vba x86

  20. #60
    Frenzied Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,289

    Re: [VB6] VBCDeclFix - The Add-in allows you to use Cdecl functions in VB6 IDE.

    Some times the difference of IDE from compiled version has to do with the use of variants. A variant with long value, may work by reference to a long value, in a call, at IDE but not at the compiled version. So look all the types of passed parameters and function's declarations (signature).

  21. #61
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,742

    Re: [VB6] VBCDeclFix - The Add-in allows you to use Cdecl functions in VB6 IDE.

    CAN'T LOAD Connect.Dsr ON CHINESE VB6
    AND CAN'T REGSVR32 CDeclFix.dll

  22. #62
    PowerPoster
    Join Date
    Jan 2020
    Posts
    3,742

    Re: [VB6] VBCDeclFix - The Add-in allows you to use Cdecl functions in VB6 IDE.

    Quote Originally Posted by MacroJohn View Post
    Thank you for your reply.
    I tested your Add-in, it worked great. For a long time, vb6 has always faced the threat of being eliminated. It is precisely because of a group of selfless contributors like you that make vb6's life continue, and which give courages and helps for many developers. The discussion of CDeclFix in the group gave me an idea, whether this method can be used as a universal and widely accepted method to break through the limitations of vb6 functions.It may need to use a large number of practical examples to practice.
    For example, I am currently testing the automatic operation of the browser. The most commonly used in vb6 is seleniumbasic, but Seleniumbasic has not been updated, and the so-called seleniumbaisc3.14 on the Internet is not open source, potential safety hazards would be exist.
    whether or not without relying on seleniumbasic, directly use C# or other versions of selenium in vb6 to drive chromedriver.exe? But I have almost no idea in this regard.
    If it can be realized by CDeclFix method, then it further proves VBCDeclFix's great contribution to the vitality of vb6.
    Can you give me some suggestions, or try to explore it?

    Thank you again for your kind reply!
    Joh.
    LIKE vbrichclien6,WebView2Loader.dll

    Someone needs to keep updating. In fact, the Google debugging protocol is an HTTP request or websocket communication.
    Implementing 3-5 features is not difficult, but to implement hundreds or thousands of interfaces, a development team needs to keep up with Google's upgrades.

Page 2 of 2 FirstFirst 12

Tags for this Thread

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