Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

SafeArray Mixed Language Problem

Intel_C_Intel
Employee
321 Views
I'm trying to populate a C++ SAFEARRAY of strings in a FORTRAN rotuine then return it to the C++.
The debugger says I have a bad argument, but I can't seem to figure out how to fix it.
Can someone have a look at the attached program please, and give me some pointers?
Thanks so much,
Dan
0 Kudos
4 Replies
Jugoslav_Dujic
Valued Contributor II
321 Views
Not that I'm familiar with this, but nevertheless...

The main problem is that you're creating a SafeArray of Variants but you're trying to put BSTRs in there. Also, I fixed run-time libraries so that you don't get a linker warning.

HTH
Jugoslav
0 Kudos
Intel_C_Intel
Employee
321 Views
Thanks for the effort Jugoslav, but I can't get your attachment to compile...
resSATEST.rc2 is missing.
Also if I copy your changes into my original, it still doesn't work.
What am I doing wrong?
0 Kudos
Jugoslav_Dujic
Valued Contributor II
321 Views
I forgot to pack it up, but it's unchanged from your version -- simply copy it back into /res/ folder along with Satest.ico.

Jugoslav
0 Kudos
Intel_C_Intel
Employee
321 Views
Cheers...works great now!
0 Kudos
Reply