how to wrap a non "_stdcall" dll for vb

Can I write a dll that calls a compiled dll, so it can be used from vb.

Im running out of time so any help would be great.






Comments

  • : Can I write a dll that calls a compiled dll, so it can be used from vb.
    :
    : Im running out of time so any help would be great.
    :

    Do you want to write a vb dll that calls into a C++ dll, or did I misunderstand you?

    If I didn't you define calls into C++ dll from vb like this:

    Declare Function FunctionName Lib "DllName.dll" Alias "FunctionNameInDLL" (ByVal AllYourParameters As WhatEverTheyAre) As FunctionReturntype



    But this is more of a VB issue, actually ...

  • I was meaning c++

    I've got to use a dll that cant be used directly from VB
    because it hasn't used __stdcall.

    so I was wondering if I can write a dll (in c++) that wraps
    another dll (the one I need) so that its ok to use in vb.

    Im not to good at explaining myself!

    cheers
  • if you have the time, right a wrapper DLL that exposes one to one _stdcalls to the old DLL.

    say int __cdecl OldFunction1(int x); is the old function, write a new one like this:
    dllexport(__stdcall) int NewFunction1(int x)
    {
    return OldFunction1(x);
    }

    no automatic or time saving technique i know of
  • Thanks pingpong

    I got it sorted
    Made a dll with ATL com wizard and wrote the functions
    with _stdcall and declared within them the import functions
    with dllImport.

    cheers





  • Thanks pingpong

    I got it sorted
    Made a dll with ATL com wizard and wrote the functions
    with _stdcall and declared within them the import functions
    with dllImport.

    cheers





  • Thanks PingPong

    I got it sorted
    made a dll with ATL/Com wizard
    exposed export the functions with _stdcall
    and declared the imported functions with dllImport
    and passed the values on.

    cheers

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories