GetProcAddress and usage in VB question ?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 1 of 4 123 ... LastLast
Results 1 to 15 of 49

Thread: GetProcAddress and usage in VB question ?

Hybrid View

  1. #1
    Geoff (CADS) Guest

    GetProcAddress and usage in VB question ?

    Two parts to the question really.
    Part 1 - How do I create a DLL from Visual Basic that exports functions (as
    C++ does with __stdcall) ?
    I don't think it's possible from what I've read in MSDN, as VB only seems to
    create COM DLL's.

    Part 2 - I can load a DLL into VB using LoadLibrary, and I can get the
    pointer to the function I want to
    call, but how do I use it ?

    The reason for using LoadLibrary is that I'm writing a system that uses DLLs
    as plug-ins that can be
    written by third parties (hence I can't Declare them).
    The calling convention and parameters will always be the same.

    ANY help greatly appreciated

    Geoff




  2. #2
    Jonathan Wood Guest

    Re: GetProcAddress and usage in VB question ?

    Geoff,

    > Two parts to the question really.
    > Part 1 - How do I create a DLL from Visual Basic that exports functions

    (as
    > C++ does with __stdcall) ?
    > I don't think it's possible from what I've read in MSDN, as VB only seems

    to
    > create COM DLL's.


    You are correct.

    > Part 2 - I can load a DLL into VB using LoadLibrary, and I can get the
    > pointer to the function I want to
    > call, but how do I use it ?
    >
    > The reason for using LoadLibrary is that I'm writing a system that uses

    DLLs
    > as plug-ins that can be
    > written by third parties (hence I can't Declare them).
    > The calling convention and parameters will always be the same.


    VB provides no direct support for that. Although there are some APIs that
    can be used, they only handle a couple of combinations of arguments and
    return types.

    A more complete solution is the CallPtr library posted on our web site. It's
    free, documented and it will allow you to call a pointer to a function with
    any arguments and return types.

    --
    Jonathan Wood
    SoftCircuits Programming
    http://www.softcircuits.com



  3. #3
    Peter Young Guest

    Re: GetProcAddress and usage in VB question ?

    Geoff,

    > Part 1 - How do I create a DLL from Visual Basic that exports functions

    (as
    > C++ does with __stdcall) ?


    While you can't do this natively in VB, Desaware's SpyWorks package has a
    tool that will get you there. www.desaware.com

    > Part 2 - I can load a DLL into VB using LoadLibrary, and I can get the
    > pointer to the function I want to
    > call, but how do I use it ?


    A guy by the name of Michael Culley wrote a slick little routine to do this.
    The only place I've found it is in a module available at
    http://www.w-s-s.de/ Look for InstallOCX.bas.

    I've used both of these with success.

    HTH,

    Peter Young

    Geoff (CADS) <geoff@cads.co.uk> wrote in message
    news:393bbaf3$1@news.devx.com...
    > Two parts to the question really.
    > Part 1 - How do I create a DLL from Visual Basic that exports functions

    (as
    > C++ does with __stdcall) ?
    > I don't think it's possible from what I've read in MSDN, as VB only seems

    to
    > create COM DLL's.
    >
    > Part 2 - I can load a DLL into VB using LoadLibrary, and I can get the
    > pointer to the function I want to
    > call, but how do I use it ?
    >
    > The reason for using LoadLibrary is that I'm writing a system that uses

    DLLs
    > as plug-ins that can be
    > written by third parties (hence I can't Declare them).
    > The calling convention and parameters will always be the same.
    >
    > ANY help greatly appreciated
    >
    > Geoff
    >
    >
    >




  4. #4
    Geoff (CADS) Guest

    Re: GetProcAddress and usage in VB question ?

    Thank you both for the (extremely) quick response. I really didn't think
    I'd be able to
    do it without writing a C wrapper dll.



    Peter Young <pyoung@mr.net> wrote in message news:393bc754@news.devx.com...
    > Geoff,
    >
    > > Part 1 - How do I create a DLL from Visual Basic that exports functions

    > (as
    > > C++ does with __stdcall) ?

    >
    > While you can't do this natively in VB, Desaware's SpyWorks package has a
    > tool that will get you there. www.desaware.com
    >
    > > Part 2 - I can load a DLL into VB using LoadLibrary, and I can get the
    > > pointer to the function I want to
    > > call, but how do I use it ?

    >
    > A guy by the name of Michael Culley wrote a slick little routine to do

    this.
    > The only place I've found it is in a module available at
    > http://www.w-s-s.de/ Look for InstallOCX.bas.
    >
    > I've used both of these with success.
    >
    > HTH,
    >
    > Peter Young
    >
    > Geoff (CADS) <geoff@cads.co.uk> wrote in message
    > news:393bbaf3$1@news.devx.com...
    > > Two parts to the question really.
    > > Part 1 - How do I create a DLL from Visual Basic that exports functions

    > (as
    > > C++ does with __stdcall) ?
    > > I don't think it's possible from what I've read in MSDN, as VB only

    seems
    > to
    > > create COM DLL's.
    > >
    > > Part 2 - I can load a DLL into VB using LoadLibrary, and I can get the
    > > pointer to the function I want to
    > > call, but how do I use it ?
    > >
    > > The reason for using LoadLibrary is that I'm writing a system that uses

    > DLLs
    > > as plug-ins that can be
    > > written by third parties (hence I can't Declare them).
    > > The calling convention and parameters will always be the same.
    > >
    > > ANY help greatly appreciated
    > >
    > > Geoff
    > >
    > >
    > >

    >
    >




  5. #5
    Michael \(michka\) Kaplan Guest

    Re: GetProcAddress and usage in VB question ?

    Actually, you are very wrong. Matt Curland wrote up a method for doing this
    NATIVELY earlier this year in VBPJ. I believe in the February 2000 issue?

    --
    MichKa
    "Cause it's a bittersweet symphony, thats life..." -- The Verve

    random junk of dubious value, at the multilingual,
    no scripts required, http://www.trigeminal.com/

    "Peter Young" <pyoung@mr.net> wrote in message
    news:393bc754@news.devx.com...
    > Geoff,
    >
    > > Part 1 - How do I create a DLL from Visual Basic that exports functions

    > (as
    > > C++ does with __stdcall) ?

    >
    > While you can't do this natively in VB, Desaware's SpyWorks package has a
    > tool that will get you there. www.desaware.com
    >
    > > Part 2 - I can load a DLL into VB using LoadLibrary, and I can get the
    > > pointer to the function I want to
    > > call, but how do I use it ?

    >
    > A guy by the name of Michael Culley wrote a slick little routine to do

    this.
    > The only place I've found it is in a module available at
    > http://www.w-s-s.de/ Look for InstallOCX.bas.
    >
    > I've used both of these with success.
    >
    > HTH,
    >
    > Peter Young
    >
    > Geoff (CADS) <geoff@cads.co.uk> wrote in message
    > news:393bbaf3$1@news.devx.com...
    > > Two parts to the question really.
    > > Part 1 - How do I create a DLL from Visual Basic that exports functions

    > (as
    > > C++ does with __stdcall) ?
    > > I don't think it's possible from what I've read in MSDN, as VB only

    seems
    > to
    > > create COM DLL's.
    > >
    > > Part 2 - I can load a DLL into VB using LoadLibrary, and I can get the
    > > pointer to the function I want to
    > > call, but how do I use it ?
    > >
    > > The reason for using LoadLibrary is that I'm writing a system that uses

    > DLLs
    > > as plug-ins that can be
    > > written by third parties (hence I can't Declare them).
    > > The calling convention and parameters will always be the same.
    > >
    > > ANY help greatly appreciated
    > >
    > > Geoff
    > >
    > >
    > >

    >
    >




  6. #6
    Michael \(michka\) Kaplan Guest

    Re: GetProcAddress and usage in VB question ?

    Jonathan,

    Matt Curland has written up a native solution for calling function pointers
    in VB.

    --
    MichKa
    "Cause it's a bittersweet symphony, thats life..." -- The Verve

    random junk of dubious value, at the multilingual,
    no scripts required, http://www.trigeminal.com/

    "Jonathan Wood" <jwood@softcircuits.com> wrote in message
    news:393bc124@news.devx.com...
    > Geoff,
    >
    > > Two parts to the question really.
    > > Part 1 - How do I create a DLL from Visual Basic that exports functions

    > (as
    > > C++ does with __stdcall) ?
    > > I don't think it's possible from what I've read in MSDN, as VB only

    seems
    > to
    > > create COM DLL's.

    >
    > You are correct.
    >
    > > Part 2 - I can load a DLL into VB using LoadLibrary, and I can get the
    > > pointer to the function I want to
    > > call, but how do I use it ?
    > >
    > > The reason for using LoadLibrary is that I'm writing a system that uses

    > DLLs
    > > as plug-ins that can be
    > > written by third parties (hence I can't Declare them).
    > > The calling convention and parameters will always be the same.

    >
    > VB provides no direct support for that. Although there are some APIs that
    > can be used, they only handle a couple of combinations of arguments and
    > return types.
    >
    > A more complete solution is the CallPtr library posted on our web site.

    It's
    > free, documented and it will allow you to call a pointer to a function

    with
    > any arguments and return types.
    >
    > --
    > Jonathan Wood
    > SoftCircuits Programming
    > http://www.softcircuits.com
    >
    >




  7. #7
    Jonathan Wood Guest

    Re: GetProcAddress and usage in VB question ?

    Michael,

    > Matt Curland has written up a native solution for calling function

    pointers
    > in VB.


    One that works regardless of the argument and returns types expected by the
    function?

    How did he do that?

    --
    Jonathan Wood
    SoftCircuits Programming
    http://www.softcircuits.com




  8. #8
    Peter Young Guest

    Re: GetProcAddress and usage in VB question ?


    Michael,

    > Actually, you are very wrong. Matt Curland wrote up a method for doing

    this
    > NATIVELY earlier this year in VBPJ. I believe in the February 2000 issue?


    I am wrong about what? All I said was that Michael Culley wrote a routine to
    do this. His routine *is* VB-native, and is used precisely for what Geoff
    wanted to do.

    -Peter





  9. #9
    Michael Culley Guest

    Re: GetProcAddress and usage in VB question ?


    Mickha,

    If it is the article I am thinking about (and I'm pretty sure it is), my
    solution and matts solution where completely different. I don't think you
    have seen both solutions.

    I have extended the code that I originally wrote. It will now call declspec's
    in dll's and in VB, COM functions and subs and those other types of functions
    that I can't remember the name of. It can use any parameters (AFAIK). It's
    still the same basic idea.

    Its not on my web site at the moment, but I will put it up tonight. Otherwise
    email me.

    Michael Culley

    "Michael \(michka\) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com> wrote:
    >Actually, you are very wrong. Matt Curland wrote up a method for doing this
    >NATIVELY earlier this year in VBPJ. I believe in the February 2000 issue?
    >
    >--
    >MichKa
    >"Cause it's a bittersweet symphony, thats life..." -- The Verve
    >
    >random junk of dubious value, at the multilingual,
    >no scripts required, http://www.trigeminal.com/
    >
    >"Peter Young" <pyoung@mr.net> wrote in message
    >news:393bc754@news.devx.com...
    >> Geoff,
    >>
    >> > Part 1 - How do I create a DLL from Visual Basic that exports functions

    >> (as
    >> > C++ does with __stdcall) ?

    >>
    >> While you can't do this natively in VB, Desaware's SpyWorks package has

    a
    >> tool that will get you there. www.desaware.com
    >>
    >> > Part 2 - I can load a DLL into VB using LoadLibrary, and I can get the
    >> > pointer to the function I want to
    >> > call, but how do I use it ?

    >>
    >> A guy by the name of Michael Culley wrote a slick little routine to do

    >this.
    >> The only place I've found it is in a module available at
    >> http://www.w-s-s.de/ Look for InstallOCX.bas.
    >>
    >> I've used both of these with success.
    >>
    >> HTH,
    >>
    >> Peter Young
    >>
    >> Geoff (CADS) <geoff@cads.co.uk> wrote in message
    >> news:393bbaf3$1@news.devx.com...
    >> > Two parts to the question really.
    >> > Part 1 - How do I create a DLL from Visual Basic that exports functions

    >> (as
    >> > C++ does with __stdcall) ?
    >> > I don't think it's possible from what I've read in MSDN, as VB only

    >seems
    >> to
    >> > create COM DLL's.
    >> >
    >> > Part 2 - I can load a DLL into VB using LoadLibrary, and I can get the
    >> > pointer to the function I want to
    >> > call, but how do I use it ?
    >> >
    >> > The reason for using LoadLibrary is that I'm writing a system that uses

    >> DLLs
    >> > as plug-ins that can be
    >> > written by third parties (hence I can't Declare them).
    >> > The calling convention and parameters will always be the same.
    >> >
    >> > ANY help greatly appreciated
    >> >
    >> > Geoff
    >> >
    >> >
    >> >

    >>
    >>

    >
    >



  10. #10
    Michael Culley Guest

    Re: GetProcAddress and usage in VB question ?


    Oops,

    The other type of function I was thinking of was declspec. What I meant to
    say was that it will do stdCall functions in Dlls and VB, and declspecs in
    dlls.

    Michael Culley

    "Michael Culley" <m_culley@one.net.au> wrote:
    >
    >Mickha,
    >
    >If it is the article I am thinking about (and I'm pretty sure it is), my
    >solution and matts solution where completely different. I don't think you
    >have seen both solutions.
    >
    >I have extended the code that I originally wrote. It will now call declspec's
    >in dll's and in VB, COM functions and subs and those other types of functions
    >that I can't remember the name of. It can use any parameters (AFAIK). It's
    >still the same basic idea.
    >
    >Its not on my web site at the moment, but I will put it up tonight. Otherwise
    >email me.
    >
    >Michael Culley
    >
    >"Michael \(michka\) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com>

    wrote:
    >>Actually, you are very wrong. Matt Curland wrote up a method for doing

    this
    >>NATIVELY earlier this year in VBPJ. I believe in the February 2000 issue?
    >>
    >>--
    >>MichKa
    >>"Cause it's a bittersweet symphony, thats life..." -- The Verve
    >>
    >>random junk of dubious value, at the multilingual,
    >>no scripts required, http://www.trigeminal.com/
    >>
    >>"Peter Young" <pyoung@mr.net> wrote in message
    >>news:393bc754@news.devx.com...
    >>> Geoff,
    >>>
    >>> > Part 1 - How do I create a DLL from Visual Basic that exports functions
    >>> (as
    >>> > C++ does with __stdcall) ?
    >>>
    >>> While you can't do this natively in VB, Desaware's SpyWorks package has

    >a
    >>> tool that will get you there. www.desaware.com
    >>>
    >>> > Part 2 - I can load a DLL into VB using LoadLibrary, and I can get

    the
    >>> > pointer to the function I want to
    >>> > call, but how do I use it ?
    >>>
    >>> A guy by the name of Michael Culley wrote a slick little routine to do

    >>this.
    >>> The only place I've found it is in a module available at
    >>> http://www.w-s-s.de/ Look for InstallOCX.bas.
    >>>
    >>> I've used both of these with success.
    >>>
    >>> HTH,
    >>>
    >>> Peter Young
    >>>
    >>> Geoff (CADS) <geoff@cads.co.uk> wrote in message
    >>> news:393bbaf3$1@news.devx.com...
    >>> > Two parts to the question really.
    >>> > Part 1 - How do I create a DLL from Visual Basic that exports functions
    >>> (as
    >>> > C++ does with __stdcall) ?
    >>> > I don't think it's possible from what I've read in MSDN, as VB only

    >>seems
    >>> to
    >>> > create COM DLL's.
    >>> >
    >>> > Part 2 - I can load a DLL into VB using LoadLibrary, and I can get

    the
    >>> > pointer to the function I want to
    >>> > call, but how do I use it ?
    >>> >
    >>> > The reason for using LoadLibrary is that I'm writing a system that

    uses
    >>> DLLs
    >>> > as plug-ins that can be
    >>> > written by third parties (hence I can't Declare them).
    >>> > The calling convention and parameters will always be the same.
    >>> >
    >>> > ANY help greatly appreciated
    >>> >
    >>> > Geoff
    >>> >
    >>> >
    >>> >
    >>>
    >>>

    >>
    >>

    >



  11. #11
    Michael \(michka\) Kaplan Guest

    Re: GetProcAddress and usage in VB question ?

    My point is that the claim was made in your posting that there WAS no native
    way to do this.


    --
    MichKa
    "Cause it's a bittersweet symphony, thats life..." -- The Verve

    random junk of dubious value, at the multilingual,
    no scripts required, http://www.trigeminal.com/

    "Michael Culley" <m_culley@one.net.au> wrote in message
    news:393c7fbc$1@news.devx.com...
    >
    > Oops,
    >
    > The other type of function I was thinking of was declspec. What I meant to
    > say was that it will do stdCall functions in Dlls and VB, and declspecs in
    > dlls.
    >
    > Michael Culley
    >
    > "Michael Culley" <m_culley@one.net.au> wrote:
    > >
    > >Mickha,
    > >
    > >If it is the article I am thinking about (and I'm pretty sure it is), my
    > >solution and matts solution where completely different. I don't think you
    > >have seen both solutions.
    > >
    > >I have extended the code that I originally wrote. It will now call

    declspec's
    > >in dll's and in VB, COM functions and subs and those other types of

    functions
    > >that I can't remember the name of. It can use any parameters (AFAIK).

    It's
    > >still the same basic idea.
    > >
    > >Its not on my web site at the moment, but I will put it up tonight.

    Otherwise
    > >email me.
    > >
    > >Michael Culley
    > >
    > >"Michael \(michka\) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com>

    > wrote:
    > >>Actually, you are very wrong. Matt Curland wrote up a method for doing

    > this
    > >>NATIVELY earlier this year in VBPJ. I believe in the February 2000

    issue?
    > >>
    > >>--
    > >>MichKa
    > >>"Cause it's a bittersweet symphony, thats life..." -- The Verve
    > >>
    > >>random junk of dubious value, at the multilingual,
    > >>no scripts required, http://www.trigeminal.com/
    > >>
    > >>"Peter Young" <pyoung@mr.net> wrote in message
    > >>news:393bc754@news.devx.com...
    > >>> Geoff,
    > >>>
    > >>> > Part 1 - How do I create a DLL from Visual Basic that exports

    functions
    > >>> (as
    > >>> > C++ does with __stdcall) ?
    > >>>
    > >>> While you can't do this natively in VB, Desaware's SpyWorks package

    has
    > >a
    > >>> tool that will get you there. www.desaware.com
    > >>>
    > >>> > Part 2 - I can load a DLL into VB using LoadLibrary, and I can get

    > the
    > >>> > pointer to the function I want to
    > >>> > call, but how do I use it ?
    > >>>
    > >>> A guy by the name of Michael Culley wrote a slick little routine to do
    > >>this.
    > >>> The only place I've found it is in a module available at
    > >>> http://www.w-s-s.de/ Look for InstallOCX.bas.
    > >>>
    > >>> I've used both of these with success.
    > >>>
    > >>> HTH,
    > >>>
    > >>> Peter Young
    > >>>
    > >>> Geoff (CADS) <geoff@cads.co.uk> wrote in message
    > >>> news:393bbaf3$1@news.devx.com...
    > >>> > Two parts to the question really.
    > >>> > Part 1 - How do I create a DLL from Visual Basic that exports

    functions
    > >>> (as
    > >>> > C++ does with __stdcall) ?
    > >>> > I don't think it's possible from what I've read in MSDN, as VB only
    > >>seems
    > >>> to
    > >>> > create COM DLL's.
    > >>> >
    > >>> > Part 2 - I can load a DLL into VB using LoadLibrary, and I can get

    > the
    > >>> > pointer to the function I want to
    > >>> > call, but how do I use it ?
    > >>> >
    > >>> > The reason for using LoadLibrary is that I'm writing a system that

    > uses
    > >>> DLLs
    > >>> > as plug-ins that can be
    > >>> > written by third parties (hence I can't Declare them).
    > >>> > The calling convention and parameters will always be the same.
    > >>> >
    > >>> > ANY help greatly appreciated
    > >>> >
    > >>> > Geoff
    > >>> >
    > >>> >
    > >>> >
    > >>>
    > >>>
    > >>
    > >>

    > >

    >




  12. #12
    Michael \(michka\) Kaplan Guest

    Re: GetProcAddress and usage in VB question ?

    You should read the article!

    Yes, he did do that.

    --
    MichKa
    "Cause it's a bittersweet symphony, thats life..." -- The Verve

    random junk of dubious value, at the multilingual,
    no scripts required, http://www.trigeminal.com/

    "Jonathan Wood" <jwood@softcircuits.com> wrote in message
    news:393c2330$1@news.devx.com...
    > Michael,
    >
    > > Matt Curland has written up a native solution for calling function

    > pointers
    > > in VB.

    >
    > One that works regardless of the argument and returns types expected by

    the
    > function?
    >
    > How did he do that?
    >
    > --
    > Jonathan Wood
    > SoftCircuits Programming
    > http://www.softcircuits.com
    >
    >
    >




  13. #13
    Michael \(michka\) Kaplan Guest

    Re: GetProcAddress and usage in VB question ?

    Actually I was addressing the claim that there was no native way to do it:

    --
    MichKa
    "Cause it's a bittersweet symphony, thats life..." -- The Verve

    random junk of dubious value, at the multilingual,
    no scripts required, http://www.trigeminal.com/

    "Peter Young" <pyoung@mr.net> wrote in message
    news:393c275c@news.devx.com...
    >
    > Michael,
    >
    > > Actually, you are very wrong. Matt Curland wrote up a method for doing

    > this
    > > NATIVELY earlier this year in VBPJ. I believe in the February 2000

    issue?
    >
    > I am wrong about what? All I said was that Michael Culley wrote a routine

    to
    > do this. His routine *is* VB-native, and is used precisely for what Geoff
    > wanted to do.
    >
    > -Peter
    >
    >
    >
    >




  14. #14
    Michael Culley Guest

    Re: GetProcAddress and usage in VB question ?


    Michka

    I think peter meant that there is no built in command to do this.

    But if you want to get picky, Matts example used a type library which IS
    another language.

    Michael Culley

    "Michael \(michka\) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com> wrote:
    >My point is that the claim was made in your posting that there WAS no native
    >way to do this.
    >
    >
    >--
    >MichKa
    >"Cause it's a bittersweet symphony, thats life..." -- The Verve
    >
    >random junk of dubious value, at the multilingual,
    >no scripts required, http://www.trigeminal.com/
    >
    >"Michael Culley" <m_culley@one.net.au> wrote in message
    >news:393c7fbc$1@news.devx.com...
    >>
    >> Oops,
    >>
    >> The other type of function I was thinking of was declspec. What I meant

    to
    >> say was that it will do stdCall functions in Dlls and VB, and declspecs

    in
    >> dlls.
    >>
    >> Michael Culley
    >>
    >> "Michael Culley" <m_culley@one.net.au> wrote:
    >> >
    >> >Mickha,
    >> >
    >> >If it is the article I am thinking about (and I'm pretty sure it is),

    my
    >> >solution and matts solution where completely different. I don't think

    you
    >> >have seen both solutions.
    >> >
    >> >I have extended the code that I originally wrote. It will now call

    >declspec's
    >> >in dll's and in VB, COM functions and subs and those other types of

    >functions
    >> >that I can't remember the name of. It can use any parameters (AFAIK).

    >It's
    >> >still the same basic idea.
    >> >
    >> >Its not on my web site at the moment, but I will put it up tonight.

    >Otherwise
    >> >email me.
    >> >
    >> >Michael Culley
    >> >
    >> >"Michael \(michka\) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com>

    >> wrote:
    >> >>Actually, you are very wrong. Matt Curland wrote up a method for doing

    >> this
    >> >>NATIVELY earlier this year in VBPJ. I believe in the February 2000

    >issue?
    >> >>
    >> >>--
    >> >>MichKa
    >> >>"Cause it's a bittersweet symphony, thats life..." -- The Verve
    >> >>
    >> >>random junk of dubious value, at the multilingual,
    >> >>no scripts required, http://www.trigeminal.com/
    >> >>
    >> >>"Peter Young" <pyoung@mr.net> wrote in message
    >> >>news:393bc754@news.devx.com...
    >> >>> Geoff,
    >> >>>
    >> >>> > Part 1 - How do I create a DLL from Visual Basic that exports

    >functions
    >> >>> (as
    >> >>> > C++ does with __stdcall) ?
    >> >>>
    >> >>> While you can't do this natively in VB, Desaware's SpyWorks package

    >has
    >> >a
    >> >>> tool that will get you there. www.desaware.com
    >> >>>
    >> >>> > Part 2 - I can load a DLL into VB using LoadLibrary, and I can get

    >> the
    >> >>> > pointer to the function I want to
    >> >>> > call, but how do I use it ?
    >> >>>
    >> >>> A guy by the name of Michael Culley wrote a slick little routine to

    do
    >> >>this.
    >> >>> The only place I've found it is in a module available at
    >> >>> http://www.w-s-s.de/ Look for InstallOCX.bas.
    >> >>>
    >> >>> I've used both of these with success.
    >> >>>
    >> >>> HTH,
    >> >>>
    >> >>> Peter Young
    >> >>>
    >> >>> Geoff (CADS) <geoff@cads.co.uk> wrote in message
    >> >>> news:393bbaf3$1@news.devx.com...
    >> >>> > Two parts to the question really.
    >> >>> > Part 1 - How do I create a DLL from Visual Basic that exports

    >functions
    >> >>> (as
    >> >>> > C++ does with __stdcall) ?
    >> >>> > I don't think it's possible from what I've read in MSDN, as VB only
    >> >>seems
    >> >>> to
    >> >>> > create COM DLL's.
    >> >>> >
    >> >>> > Part 2 - I can load a DLL into VB using LoadLibrary, and I can get

    >> the
    >> >>> > pointer to the function I want to
    >> >>> > call, but how do I use it ?
    >> >>> >
    >> >>> > The reason for using LoadLibrary is that I'm writing a system that

    >> uses
    >> >>> DLLs
    >> >>> > as plug-ins that can be
    >> >>> > written by third parties (hence I can't Declare them).
    >> >>> > The calling convention and parameters will always be the same.
    >> >>> >
    >> >>> > ANY help greatly appreciated
    >> >>> >
    >> >>> > Geoff
    >> >>> >
    >> >>> >
    >> >>> >
    >> >>>
    >> >>>
    >> >>
    >> >>
    >> >

    >>

    >
    >



  15. #15
    Geoff (CADS) Guest

    Re: GetProcAddress and usage in VB question ?

    Any chance of posting this as I don't have access to the VBPJ site ?
    Thanks

    Geoff


    Michael Culley <m_culley@one.net.au> wrote in message
    news:393c67db$1@news.devx.com...
    >
    > Mickha,
    >
    > If it is the article I am thinking about (and I'm pretty sure it is), my
    > solution and matts solution where completely different. I don't think you
    > have seen both solutions.
    >
    > I have extended the code that I originally wrote. It will now call

    declspec's
    > in dll's and in VB, COM functions and subs and those other types of

    functions
    > that I can't remember the name of. It can use any parameters (AFAIK). It's
    > still the same basic idea.
    >
    > Its not on my web site at the moment, but I will put it up tonight.

    Otherwise
    > email me.
    >
    > Michael Culley
    >
    > "Michael \(michka\) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com>

    wrote:
    > >Actually, you are very wrong. Matt Curland wrote up a method for doing

    this
    > >NATIVELY earlier this year in VBPJ. I believe in the February 2000 issue?
    > >
    > >--
    > >MichKa
    > >"Cause it's a bittersweet symphony, thats life..." -- The Verve
    > >
    > >random junk of dubious value, at the multilingual,
    > >no scripts required, http://www.trigeminal.com/
    > >
    > >"Peter Young" <pyoung@mr.net> wrote in message
    > >news:393bc754@news.devx.com...
    > >> Geoff,
    > >>
    > >> > Part 1 - How do I create a DLL from Visual Basic that exports

    functions
    > >> (as
    > >> > C++ does with __stdcall) ?
    > >>
    > >> While you can't do this natively in VB, Desaware's SpyWorks package has

    > a
    > >> tool that will get you there. www.desaware.com
    > >>
    > >> > Part 2 - I can load a DLL into VB using LoadLibrary, and I can get

    the
    > >> > pointer to the function I want to
    > >> > call, but how do I use it ?
    > >>
    > >> A guy by the name of Michael Culley wrote a slick little routine to do

    > >this.
    > >> The only place I've found it is in a module available at
    > >> http://www.w-s-s.de/ Look for InstallOCX.bas.
    > >>
    > >> I've used both of these with success.
    > >>
    > >> HTH,
    > >>
    > >> Peter Young
    > >>
    > >> Geoff (CADS) <geoff@cads.co.uk> wrote in message
    > >> news:393bbaf3$1@news.devx.com...
    > >> > Two parts to the question really.
    > >> > Part 1 - How do I create a DLL from Visual Basic that exports

    functions
    > >> (as
    > >> > C++ does with __stdcall) ?
    > >> > I don't think it's possible from what I've read in MSDN, as VB only

    > >seems
    > >> to
    > >> > create COM DLL's.
    > >> >
    > >> > Part 2 - I can load a DLL into VB using LoadLibrary, and I can get

    the
    > >> > pointer to the function I want to
    > >> > call, but how do I use it ?
    > >> >
    > >> > The reason for using LoadLibrary is that I'm writing a system that

    uses
    > >> DLLs
    > >> > as plug-ins that can be
    > >> > written by third parties (hence I can't Declare them).
    > >> > The calling convention and parameters will always be the same.
    > >> >
    > >> > ANY help greatly appreciated
    > >> >
    > >> > Geoff
    > >> >
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center