` Printed Icetips Article

Icetips Article



Par2: Using Clarion DLLs in VC++
1998-10-26 -- Dusty Hester
 
There are a few tricks to get VC++ to call a Clarion DLL.  Granted I haven't
done this in C4, but I can't imagine it has changed that much from CW2.003.

1)  All clarion functions should be displayed as Pascal
2)  When passing *cstrings, the Clarion prototype is long, and the C++
prototype is *cstring.  The Clarion long will receive the address of the
string, you can then use memcpy to actually get the string into one of your
variables.
3)  C++ expects name mangling...I always used the Name attibute on my
Clarion function to mimic what the C++ compiler is looking for.
4)  You have to create your own .lib file.  You will do this by creating a
.def file, specs are in the C++ docs, and using the Lib tool to create a
.lib from it.

I hope this is enough to get you started in the right direction.  Again, I
haven't done this in almost a year, so some of this may be outdated, but I
doubt it.



Printed November 21, 2024, 7:20 am
This article has been viewed/printed 35214 times.