OK--that makes lots of sense.  I was thinking "impossible" when you were
leaning more along the lines of "impractical".  I can see where if the C/C++
header files changed a lot, maintaining the Delphi interfaces would be a
real pain.  Doable, but painful. 

Thanks for the reply.

David Cornelius
Cornelius Concepts, Inc.
http://corneliusconcepts.com
Software Development, Databases, Websites
 
________________________________

From: Thomas Hruska [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 06, 2006 10:55 PM
To: delphi-en@yahoogroups.com
Subject: Re: [delphi-en] Delphi -> C++ (was SMTP Error)



David Cornelius wrote:
> Thomas,
> 
> Your response raises a question in me. You say that the only way to make
> calls to OpenSSL from Delphi is through a DLL written C/C++. I'm curious
> why you say that.
> 
> It is my understanding that Delphi has directives to make its compiled
code
> look and act just like C/C++. You can reverse the way procedure parameters
> are put on the stack to look list C. You can use null-terminated strings
> like C. You can even drop to assembly if you must. Indeed, all Windows
> APIs are written in C/C++/Asm and Delphi is a huge collection of Pascal
> interfaces to those APIs.
> 
> How is the OpenSSL library different from all those?

Macros and structures. I suppose you could expand the macros in Delphi, 
but the macros have this tendency to change between versions of OpenSSL, 
so every version of OpenSSL that comes out would have to be carefully 
analyzed to make sure nothing is broken when you compile the next time. 
The structures can also change, but usually you don't have to 
recompile C/C++ code except for breaking changes. The only danger with 
the structures is if you access the members directly. Mostly it is just 
the macros that cause problems. Also, the .h files use a lot of 
#define's. OpenSSL's source code is a mess when it comes to anything 
other than C/C++ (IMO).

This is also why VB and .NET users don't interface directly with OpenSSL 
and most people use specialized intermediate DLLs written in C or C++ to 
interface with OpenSSL. Someone built a Delphi interface to OpenSSL 
called 'MySSL', but the website is long gone. So, it probably CAN be 
done but would take an inordinate amount of effort to do so.

Basically, the OpenSSL developers really didn't anticipate 
cross-language needs. A COM DLL written in C++ that implements 
IDispatch and exports every call from OpenSSL would probably solve a lot 
of the problems people experience and simplify coding efforts, but I 
brought that up on the openssl-users list a while back and it got shot 
down for some reason.

--
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197




-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/delphi-en/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to