On Fri, May 15, 2009 at 12:47 AM, Alex Takeshita
<alex_takesh...@yahoo.com.br> wrote:
> Hi, how can I use your OpenSSL include in my software developed in Visual
> Basic 6?
>
> Do you have any tutorial or tips for me? I'm a little lost!
>
> Thanks for your attention!


<does that Stan Laurel thing with the hair>

wow. VB6. That's long ago I ran into that bugger...

well... using OpenSSL in VB6 can be done, theoretically at least by
declaring external functions in VB6 as you would for any external
functions situated in a DLL you wish to use (which implies you'd need
to build OpenSSL in DLL form: it then comes as two DLLs: libcrypto and
libeay.

However, *I* would take a little more roundabout route, because
schlepping those SSL_CTX and other structure references inside VB code
wouldn't be my prime choice. I'm sure it can be done, but you'll
definitely hit a snag or two along the way. Hint: this basic approach
would require you not only to understand VB6 but also all the
intricacies of how it interfaces with external DLLs and how you can
make VB keep external pointers, handles, etc. intact and stored in VB
variables.

The more maintainable alternative (IMHO) would be to write a bit of C
(or C++) code in a 'wrapper DLL' which provides functions ready for
use by VB6 and its variable types (such as VARIANTs) and probably also
offload some of the functionaility into the C wrapper DLL, but that's
a matter of taste.


In short: if you never interfaced VB6 code to external DLLs before,
directly jacking OpenSSL into VB6 is not advisable.

There's going to be enough on your plate without that bit added as
well. (e.g. how to transfer errors into VB code properly: OpenSSL
offers a very handy error stack, but VB6 has its own ideas about what
is easy and this will take some code which is easier done in 'C': e.g.
a BIO to write the error stack dump to, then push the BIO-stored
message content into a VARIANT/String and feed that to VB. Given good
control over the error formatting and still keeps an easy interface
into VB.

The 'wrapper DLL' approach takes some preplanning as you need to
determine what part of the OpenSSL you wish to use in order to reduce
the amount of work.
I don't know of a readily-available solution for this (and haven't looked now).




-- 
Met vriendelijke groeten / Best regards,

Ger Hobbelt

--------------------------------------------------
web:    http://www.hobbelt.com/
        http://www.hebbut.net/
mail:   g...@hobbelt.com
mobile: +31-6-11 120 978
--------------------------------------------------
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to