Re: Using Pro*C from inside a Windows DLL
Date: Fri, 8 Jan 1993 20:24:37 GMT
Message-ID: <1993Jan8.202437.14795_at_oracle.us.oracle.com>
In article <1993Jan07.204648.21545_at_dlogics.com> rsimkin_at_dlogics.com (Rick Simkin) writes:
>I've been asked to find out...
>
>Is it possible to write a DLL for Microsoft Windows which uses Pro*C? Are
>there special restrictions, limitations or tricks that you need to know?
>Has anybody out there actually written a DLL that uses Pro*C?
>
>Thanks for any help you can give me on this. (I myself have no experience
>with Pro*C or DLLs--at least, not yet :-)
>
>================ I speak for myself only, not for my employer ================
>Rick Simkin UUCP: uunet!dlogics!rsimkin
>Datalogics, Inc. INTERNET: rsimkin_at_dlogics.com
>441 W. Huron St. PHONE: +1 312 2664437
>Chicago, Illinois 60610-3498 USA FAX: +1 312 2664473
Yes, this works. Specify REENTRANT=YES on the Pro*C command line and include only 1 function per .pc file. Declare the variables as local to the procedure, i.e.
int proc () { EXEC SQL BEGIN DECLARE SECTION char myvar EXEC SQL END DECLARE SECTION ... }
The reentrancy stuff is due to the fact that under Windows, all instances of a dll share the same data space - the reentrant problems crop up when a second instance invokes the DLL. If the DLL is only to be used by 1 app, this isn't necessary.
Dave Criswell
Oracle Desktop Products
Received on Fri Jan 08 1993 - 21:24:37 CET