Solved

Calling Pascal units

Posted on 1997-03-01
1
252 Views
Last Modified: 2010-04-15
Have code written in Pascal in a unit format. Would like to call the units from C. I would appreciate a simple example of how to do this. Thanks , JSS
0
Comment
Question by:jsulliva030197
1 Comment
 

Accepted Solution

by:
hooptie earned 50 total points
ID: 1249596
None of the C/C++ compilers that I have worked with can access .TPU's as is.  You'll need to recompile the units as .OBJ files and add them to your project window.  Once that is done, you'll need to declare each prototype (function) as an external function with the EXTERN definition.

Be careful though -- Pascal handles function names, pointers, and strings rather differently than C does.  I'd recommend that you be aware of these differences prior to calling the functions because it CAN BE a hair-pulling experience.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

777 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