Re: ABOUT DLL WITH VC++ IN IDL. HELP! [message #11691] |
Sat, 09 May 1998 00:00 |
rivers
Messages: 228 Registered: March 1991
|
Senior Member |
|
|
Hi,
> I have VC++5.0, I used it to create .dll files, but every time I ran
> idl call_external, it crashes. It seems IDL only call direct C instead of
> C++.
I am not sure what you mean by this. You can definitely use the VC++5.0
compiler, but the code which IDL calls directly must be C, not C++. However,
you can just write a thin wrapper layer in C (which you normally need to write
anyway because of the way IDL passes parameters), and your C wrapper can call
C++ functions. I have done this successfully.
I will repeat the recommendation in my last post, try to build the example in
the IDL external directory.
I just did this under IDL 5.0, Windows NT 4.0, VC++ 5.0
I simply typed the following commands:
# This command puts the VC++ programs in your path
c:"\program files\devstudio\vc\bin\vcvars32.bat"
c: # Go to c:
cd rsi\idl50\external\sharelib # Go to IDL example directory
del dlltst32.dll # Delete the RSI provided dll
copy makefile.win makefile # Copy the example makefile
nmake # Run make to compile and link
Now run the dll in IDL
IDL> cd, 'external\sharelib'
IDL> dlltst32
This worked fine for me.
____________________________________________________________
Mark Rivers (773) 702-2279 (office)
CARS (773) 702-9951 (secretary)
Univ. of Chicago (773) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars.uchicago.edu (e-mail)
or:
Argonne National Laboratory (630) 252-0422 (office)
Building 434A (630) 252-0405 (lab)
9700 South Cass Avenue (630) 252-1713 (beamline)
Argonne, IL 60439 (630) 252-0443 (FAX)
|
|
|
Re: ABOUT DLL WITH VC++ IN IDL. HELP! [message #11693 is a reply to message #11691] |
Fri, 08 May 1998 00:00  |
medimage
Messages: 3 Registered: April 1998
|
Junior Member |
|
|
In article <EsKE7u.2wz@midway.uchicago.edu>,
rivers@cars3.uchicago.edu wrote:
I have VC++5.0, I used it to create .dll files, but every time I ran
idl call_external, it crashes. It seems IDL only call direct C instead of
C++.
Any help, please!!!!
>
> There is an example provided in the idl50\external\sharelib directory.
> It includes an example makefile and .def file. I have been using
CALL_EXTERNAL
> under Windows NT 4.0 with no problem. Note that in IDL 5.1 RSI changed the
way
> strings are passed to CALL_EXTERNAL under Windows. The good news is that
they
> made it compatible with the way it works on Unix. The bad news is that you
> need 2 different DLLs if you want to support both IDL 5.1 and previous
versions
> of IDL.
>
> ____________________________________________________________
> Mark Rivers (773) 702-2279 (office)
> CARS (773) 702-9951 (secretary)
> Univ. of Chicago (773) 702-5454 (FAX)
> 5640 S. Ellis Ave. (708) 922-0499 (home)
> Chicago, IL 60637 rivers@cars.uchicago.edu (e-mail)
>
> or:
> Argonne National Laboratory (630) 252-0422 (office)
> Building 434A (630) 252-0405 (lab)
> 9700 South Cass Avenue (630) 252-1713 (beamline)
> Argonne, IL 60439 (630) 252-0443 (FAX)
>
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
|
|
|
Re: ABOUT DLL WITH VC++ IN IDL. HELP! [message #11700 is a reply to message #11693] |
Thu, 07 May 1998 00:00  |
rivers
Messages: 228 Registered: March 1991
|
Senior Member |
|
|
In article <35502831.1546E712@teb.upm.es>, Julio Gustavo Perez Fernandez <gustavo@teb.upm.es> writes:
> Hi!, my name is Gustavo. I am working in the Group of Telemedicine
> and Bioengineering at the Polytechnical University of Madrid, I am
> interested in building DLLs with VC++, to use them in IDL ver 5.0.If
> somebody could provide me with some information about how to do it.
> We are using CALL_EXTERNAL function but we have some troubles.
> Some questions:
> Do we have to use "__declspec(dllexport)" or ".def" ?
> What are the link options that we have to use?
> We would like to know if it is possible to link VC++ .LIB with a
> programm in IDL.
There is an example provided in the idl50\external\sharelib directory.
It includes an example makefile and .def file. I have been using CALL_EXTERNAL
under Windows NT 4.0 with no problem. Note that in IDL 5.1 RSI changed the way
strings are passed to CALL_EXTERNAL under Windows. The good news is that they
made it compatible with the way it works on Unix. The bad news is that you
need 2 different DLLs if you want to support both IDL 5.1 and previous versions
of IDL.
____________________________________________________________
Mark Rivers (773) 702-2279 (office)
CARS (773) 702-9951 (secretary)
Univ. of Chicago (773) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars.uchicago.edu (e-mail)
or:
Argonne National Laboratory (630) 252-0422 (office)
Building 434A (630) 252-0405 (lab)
9700 South Cass Avenue (630) 252-1713 (beamline)
Argonne, IL 60439 (630) 252-0443 (FAX)
|
|
|