Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Problems picking proper type when calling DLL

Posted on 2000-04-11
1
Medium Priority
?
149 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 13

Accepted Solution

by:
Epsylon earned 150 total points
ID: 2705373
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

618 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