Re: Syntax for R. Franks extproc_define() in IDL 6.1 [message #43730] |
Fri, 22 April 2005 16:32 |
darmstr
Messages: 9 Registered: April 2005
|
Junior Member |
|
|
Karl,
Thanks! The msvcrt.dll example ran and made the mysin function behave
as native to IDL:
IDL> print,mysin(!dpi/2.d0)
1.0000000
Which is the correct answer!
Now if I can make this fly with the Tek scope's dll I'll be in
business. I'll let you know. Thanks to all respondents for the advice.
Darrell
|
|
|
Re: Syntax for R. Franks extproc_define() in IDL 6.1 [message #43732 is a reply to message #43730] |
Fri, 22 April 2005 15:58  |
Karl Schultz
Messages: 341 Registered: October 1999
|
Senior Member |
|
|
On Fri, 22 Apr 2005 14:43:51 -0700, darmstr wrote:
> My lack of experience with dll's etc. is going to be obvious here, but
> did you do the rebuild using IDL's make_dll, or did you have to do any
> of the compilations using a C compiler?
>
I think that extproc pre-dates make_dll. The package comes with Visual
Studio 6 project files. So the easiest way to do it is to rebuild
the project with either VS 6 or VS 7. Anyway, I've e-mailed the files I
ended up with to you. Hope they work for you.
Karl
|
|
|
Re: Syntax for R. Franks extproc_define() in IDL 6.1 [message #43734 is a reply to message #43732] |
Fri, 22 April 2005 15:06  |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
You'll need a c compiler, even if you use make_dll. I'm sure the
package comes with a makefile of some sort which should get you well
along your way.
This I know many of us can help you with so if you get stuck, just ask.
-Rick
darmstr@sandia.gov wrote:
> My lack of experience with dll's etc. is going to be obvious here, but
> did you do the rebuild using IDL's make_dll, or did you have to do any
> of the compilations using a C compiler?
>
> Darrell
>
|
|
|
|
Re: Syntax for R. Franks extproc_define() in IDL 6.1 [message #43736 is a reply to message #43735] |
Fri, 22 April 2005 14:39  |
Karl Schultz
Messages: 341 Registered: October 1999
|
Senior Member |
|
|
On Fri, 22 Apr 2005 12:58:10 -0700, darmstr wrote:
> OK, nobody attempted my first question about using the extproc_define()
> procedure on the Tektronix scope - not specific enough I suppose. I
> think I've narrowed it down a bit as I'm now beyond the
> "crashes-IDL-everytime-I-try-it" stage. The problem may be a simple
> matter of correct syntax, but I'm not sure. If I enter
>
> result=EXTPROC_DEFINE("mysin","msvcrt.dll","sin","d(d) ",/CDECL)
>
> exactly as shown from the examples in the readme file at IDL's command
> prompt, IDL crashes. If I'm doing something totally stupid, ridicule is
> perfectly acceptable, as long as I get things to work in the end.
>
> For whatever it's worth, here are a few other variants and their
> results:
>
> IDL> test=EXTPROC_DEFINE(mysin,'msvcrt.dll',sin,d(d),/CDECL)
> % Variable is undefined: D. (no surprise here)
> % Execution halted at: $MAIN$
>
> IDL> test=EXTPROC_DEFINE(mysin,'msvcrt.dll',sin,'d(d)',/CDECL)
> % Internal error: bad param in IDL_KWCleanup.
> % Execution halted at: $MAIN$
>
> Pretty much any other way one can enter the above - using single
> quotes, double quotes, combinations of ' and ", variables predefined as
> strings (e.g., then enter: err =
> EXTPROC_DEFINE(idlname,dllfilename,dllfuncname,funcsig)[,/CD ECL]), or
> whatever else, crashes IDL.
>
> Any ideas?
Did you rebuild the libraries from the source or just try to use the
pre-compiled binaries?
I rebuilt the libraries and the above "mysin" example works ok.
The binaries are pretty old. It looks like they were built against IDL
5.2.
The probable cause of your problems is that the definition of IDL_STRING
changed between IDL 5.2 and now. I also tried running the precompiled
binaries under a debugger. I'm not certain, but it looks like the crash I
saw occured when the lib was dealing with a string, and that would explain
things.
I think you'll have better luck if you rebuild the libraries.
Karl
|
|
|
Re: Syntax for R. Franks extproc_define() in IDL 6.1 [message #43738 is a reply to message #43736] |
Fri, 22 April 2005 14:33  |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
I can't really help much but I have to ask if you are using a
pre-compiled .dlm or did you compile it yourself? Just wondering since
I know this .dlm has been around for a while and I would expect issues
if you were using a precompiled .dll that is packaged with the library.
See. Not very helpful, but we have to start with the obvious first :)
-Rick
darmstr@sandia.gov wrote:
> OK, nobody attempted my first question about using the extproc_define()
> procedure on the Tektronix scope - not specific enough I suppose. I
> think I've narrowed it down a bit as I'm now beyond the
> "crashes-IDL-everytime-I-try-it" stage. The problem may be a simple
> matter of correct syntax, but I'm not sure. If I enter
>
> result=EXTPROC_DEFINE("mysin","msvcrt.dll","sin","d(d) ",/CDECL)
>
> exactly as shown from the examples in the readme file at IDL's command
> prompt, IDL crashes. If I'm doing something totally stupid, ridicule is
> perfectly acceptable, as long as I get things to work in the end.
>
> For whatever it's worth, here are a few other variants and their
> results:
>
> IDL> test=EXTPROC_DEFINE(mysin,'msvcrt.dll',sin,d(d),/CDECL)
> % Variable is undefined: D. (no surprise here)
> % Execution halted at: $MAIN$
>
> IDL> test=EXTPROC_DEFINE(mysin,'msvcrt.dll',sin,'d(d)',/CDECL)
> % Internal error: bad param in IDL_KWCleanup.
> % Execution halted at: $MAIN$
>
> Pretty much any other way one can enter the above - using single
> quotes, double quotes, combinations of ' and ", variables predefined as
> strings (e.g., then enter: err =
> EXTPROC_DEFINE(idlname,dllfilename,dllfuncname,funcsig)[,/CD ECL]), or
> whatever else, crashes IDL.
>
> Any ideas?
>
> Darrell
>
|
|
|