List Info

Thread: Trouble accessing a dll written in Delphi




Trouble accessing a dll written in Delphi
user name
2006-08-10 13:40:45
I have a VB.Net 2005 project that I need to access a third
party dll that
was written in Delphi.  I have tried registering the dll and
tried the
Declare statement.  Is there any other way to access a dll? 
Has anyone
worked with dlls written in Delphi before?  If it would
help, I could send
the dll (very small) and a function or two that are in the
dll for somebody
to experiment with.

The dll won't register as ActiveX, and one of my declare
statements is:

Public Declare Ansi Function CheckVersionConfigFile Lib
"C:\MyRefs\HowardIndustries.dll" (ByVal
ConfigDirectory As String) As String

The declaration in Delphi (given as documentation of the
function) is:

function
CheckVersionConfigFile(ConfigDirectory:AnsiString):ShortStri
ng

Any ideas?

Kelly

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Trouble accessing a dll written in Delphi
user name
2006-08-10 18:17:40
Kelly,

Try using either the Unicode part of the declare.
If the version of Delphi it was compiled under is fairly
new, it may require
Unicode strings.
I ran into a similar situation with one of the Win32 dlls. 
I couldn't get
it to work until I specified Unicode.

Your syntax looks correct, though.

Thanks,
Mike


On 8/10/06, Kelly Baker <kbakerhoward-ind.com> wrote:
>
> I have a VB.Net 2005 project that I need to access a
third party dll that
> was written in Delphi.  I have tried registering the
dll and tried the
> Declare statement.  Is there any other way to access a
dll?  Has anyone
> worked with dlls written in Delphi before?  If it would
help, I could send
> the dll (very small) and a function or two that are in
the dll for
> somebody
> to experiment with.
>
> The dll won't register as ActiveX, and one of my
declare statements is:
>
> Public Declare Ansi Function CheckVersionConfigFile Lib
> "C:\MyRefs\HowardIndustries.dll" (ByVal
ConfigDirectory As String) As
> String
>
> The declaration in Delphi (given as documentation of
the function) is:
>
> function
CheckVersionConfigFile(ConfigDirectory:AnsiString):ShortStri
ng
>
> Any ideas?
>
> Kelly
>
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com

>

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )