Solved

Problems picking proper type when calling DLL

Posted on 2000-04-11
1
142 Views
Last Modified: 2010-04-04
I'm calling a C++Builder DLL from Delphi.  The function I'm calling returns a value of type 'char*'.  In the import unit I made in Delphi, I have the type as 'PChar'.  When I run the Delphi executable, I get an access error.

I modified the import unit so that the type is 'string' and ran it again.  This time no access error, but nothing returns.
0
Comment
Question by:uhoang
1 Comment
 
LVL 13

Accepted Solution

by:
Epsylon earned 50 total points
Comment Utility
Using  'string' won't work. PChar should be right. Try to put 'cdecl' in the declaration in the import unit:

function SomeFunction(param: sometype): PChar; cdecl; external 'some.dll';

If this doesn't help try other directive too (stdcall, register, etc).
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now