Solved

Calling Pascal units

Posted on 1997-03-01
1
250 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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.

772 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

10 Experts available now in Live!

Get 1:1 Help Now