Results 1 to 5 of 5

Thread: How to use msvbvm60.dll exported functions directly in NON-VB6 languages

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2023
    Posts
    3

    How to use msvbvm60.dll exported functions directly in NON-VB6 languages

    Hello trick,

    I know how to call exports from msvbvm60.dll using vb6 applications by defining these exports in activex dll or standard dll from the examples in your code bank http://www.vbforums.com/search.php?d...&childforums=1.

    How to use msvbvm60.dll exported functions in NON-VB6 languages directly for example in c/c++ without the need for vb6 application.

    The following code for export rtcSin succeeds.
    Code:
    #include <windows.h>
    #include <stdio.h>
     
    typedef double (WINAPI *rtcdouble)(double);
     
    int main()
    {
        HMODULE hModule;
        rtcdouble rtcSin;
        double result;
        
        printf("rtcSin Example\n\n");
     
        hModule=LoadLibrary("msvbvm60.dll");
        rtcSin=(rtcdouble)GetProcAddress(hModule,"rtcSin");
     
        result=rtcSin(1.57);
        printf("Sin(pi/2)=%lf\n", result);
     
        return 0;
    }
    But if I use the same for export rtcInputBox etc it fails.
    Is there any generic way to call msvbvm60.dll any exported functions directly in c/c++ without fail for which I thank you.


    Avyan
    Last edited by avyan; Apr 17th, 2023 at 08:08 AM. Reason: for providing code which I tried

  2. #2

    Thread Starter
    New Member
    Join Date
    Apr 2023
    Posts
    3

    Re: How to use msvbvm60.dll exported functions directly in NON-VB6 languages

    Hello trick,

    After loading MSVBVM60.dll using LoadLibrary
    can we create VB.Global object in the c/c++
    using CoCreateInstance so that I can run rtcInputBox API of MSVBVM60.dll.


    Code:
    HINSIANCE HMSVBVM=LoadLibrary("msvbvm60.dll");//fine
    
    //From HMSVBVM Create VB.Global object using CoCreateInstance  //How
    
    //call rtcInputBox  //fine

    How can we create VB.Global object using HMSVBVM .


    avyan

  3. #3
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    6,093

    Re: How to use msvbvm60.dll exported functions directly in NON-VB6 languages

    Maybe try CreateIExprSrvObj and CoInitialize like when you initialize the runtime in a new thread in VB6?

    Anyway, it's clear you're smkperu/jsvenu, so why the new alias?

  4. #4

    Thread Starter
    New Member
    Join Date
    Apr 2023
    Posts
    3

    Re: How to use msvbvm60.dll exported functions directly in NON-VB6 languages

    Hello fafalone,

    Maybe try CreateIExprSrvObj and CoInitialize like when you initialize the runtime in a new thread in VB6?
    Already tried does'nt work unless you create a vb6 activex dll object using CoCreateInstance.
    In order to avoid using vb6 exe I wanted to directly get VB.Global object from msvbvm60.dll and use CoCreateInstance to instantiate
    it in my c/c++ code.

    avyan

  5. #5
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    39,261

    Re: How to use msvbvm60.dll exported functions directly in NON-VB6 languages

    You're right. Closed.
    My usual boring signature: Nothing

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