comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » How to DLL with IDL?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
How to DLL with IDL? [message #5220] Wed, 01 November 1995 00:00
mbrown is currently offline  mbrown
Messages: 15
Registered: August 1995
Junior Member
Help! I need to convert some C functions into
DLLs so I can call them from IDL. I tried a little test
program first, but it doesn't work. When I CALL_EXTERNAL,
it says that the DLL 'duplicate' is not in the file. My
IDL code is simply

Result = CALL_EXTERNAL('c:\gcc\drg\test.dll','duplicate',e,p)

I modeled my program after the example in the
\external\examples\sharelib directory. By the way, this example
looks somewhat different than that of other DLLs I've seen. Could
this be the difference between 16 and 32 bit DLLs? Anyway, here
is my C code. I'm using Watcom C++ to build it, if that matters
at all. Any help would be appreciated.


// Myron Brown
// Duplicate.dll

#include <windows.h>
#include <stdio.h>

// Prototypes
BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ulReason, LPVOID lpReserved);
int WINAPI duplicate(int argc, char* argv[]);

// Windows entry point for DLL
BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ulReason, LPVOID lpReserved)
{
return(TRUE);
}

// Copy p into e
int WINAPI duplicate(int argc, char* argv[])
{
int i,j;
double** e;
double** p;

if (argc != 3)
return(1);

e = (double**)(*argv[0]);
p = (double**)(*argv[1]);

for (i=0;i<20;i++)
for (j=0;j<20;j++)
e[i][j] = p[i][j];

return(0);
}
[Message index]
 
Read Message
Previous Topic: Printing color?
Next Topic: how to produce a color bar legend

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 17 21:30:46 PDT 2025

Total time taken to generate the page: 0.07885 seconds