Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem with Delphi when accessing C dll

Posted on 2003-11-05
6
Medium Priority
?
146 Views
Last Modified: 2010-04-05
How do I call a dll created in C? I was informed that the dll was created in C and calls some functions in java...

I declared a function to access the dll from delphi:

function FunctionName:PChar; external 'GivenDll.dll';

i get this error message the moment i run the application:

"The procedure entry point FunctionName could not be located in the dynamic link library GivenDll.dll"

Is there a problem with my codes? or did I miss something?

Also, how can I view the functions in the dll?

Please help....

Thanks
0
Comment
Question by:LORD_CHO
[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
  • 2
  • 2
6 Comments
 
LVL 5

Accepted Solution

by:
snehanshu earned 252 total points
ID: 9692142
LORD_CHO,
  Try using
 function FunctionName:PChar; stdcall; external 'GivenDll.dll';
...Snehanshu
0
 
LVL 5

Expert Comment

by:snehanshu
ID: 9692211
>>Also, how can I view the functions in the dll?
You could use PEViewer from
http://www.volweb.cz/pvones/delphi/
...Snehanshu
P.S.
  Win 95-98 had QuickView for this, not it is not shipped.
0
 
LVL 11

Assisted Solution

by:robert_marquardt
robert_marquardt earned 248 total points
ID: 9692220
stdcall is most probably needed, but it does not help locating the function.
It may be that the function is exported with a mangled name.
Have a look at the DLL. A hex dump should be good enough to spot if the function is named
'_FunctionName' or '_FunctionName@4' or something like that.
If so then change the import to

function FunctionName:PChar; stdcall; external 'GivenDll.dll' name '_FunctionName';

If calling with stdcall crashes then try cdecl instead.
0
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 9692225
If you want to call Java directly then have a look at this site
http://www.pacifier.com/~mmead/jni/delphi/
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

721 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