CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 1999
    Location
    Columbus, Ohio, USA
    Posts
    32

    Calling functions in VB app

    We have a system developed in VC++ 6.0, but need a DLL or something else
    from another company to make use of their functionality.

    Their system is a combination of Visual Basic with a dll written in C.
    The unfortunate part is that a lot of the functionality that they would like to
    have in the dll is currently residing in the VB code. A lot of what the VB code
    does for them involves database lookups of rates and pricing information.
    Doing the database access in C++ is much more difficult for them, so they
    haven't moved that functionality there yet. If we tell them that we absolutely
    must have a dll and a dll only, they're then facing significant rewriting of the
    system and they're not sure of how long such an effort will take. So, my
    question for you is whether our system could call their executable via COM
    instead of a dll.

    I haven't worked much with COM, so I do not know what kind of solution I
    need here. I do however realize that they can use COM to register functions
    from the VB application that my app can call via COM.

    Am I right in assuming this?

    ***
    "Delaying decisions" is too often a euphemism for
    "avoiding thinking."
    - Bjarne Stroustrup

  2. #2
    Join Date
    May 1999
    Location
    Texas, USA
    Posts
    568

    Re: Calling functions in VB app

    Yes you are right to go through COM. If you are new at it, then I suggest go
    the #import route.
    To see the generated files, do this at the top of some file in your project.

    #import "Path to dll\some.dll" no_namespace

    Hopefully you will not get any errors, those can be very cryptic. There should be
    some TLH file in your DEBUG or RELEASE dir ( depending on what environment you
    are currently working in ). This will show the wrappers for the COM interfaces and
    functions. After you get to this point send me an e-mail, and I can help you with the
    rest of the way.

    Wayne

    [email protected]


  3. #3
    Join Date
    May 1999
    Location
    Columbus, Ohio, USA
    Posts
    32

    Re: Calling functions in VB app

    Are you suggesting that I #import the other company's VB Application .exe? That surely can only be done if they have made their application also a COM server with the proper registration of functions, etc?

    William Dicks


    ***
    "Delaying decisions" is too often a euphemism for
    "avoiding thinking."
    - Bjarne Stroustrup

  4. #4
    Join Date
    May 1999
    Location
    Texas, USA
    Posts
    568

    Re: Calling functions in VB app

    I apoligize, I thought the VB was the DLL. What they can do is to use the code stick it in a VB 'class' and
    recompile it as an Active X Dll which then you could use through COM.

    Wayne


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

Featured