home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / database / oracle / 2736 < prev    next >
Encoding:
Internet Message Format  |  1993-01-08  |  2.0 KB

  1. Path: sparky!uunet!oracle!unrepliable!bounce
  2. Newsgroups: comp.databases.oracle
  3. From: dcriswel@oracle.uucp (David Criswell)
  4. Subject: Re: Using Pro*C from inside a Windows DLL
  5. Message-ID: <1993Jan8.202437.14795@oracle.us.oracle.com>
  6. Sender: usenet@oracle.us.oracle.com (Oracle News Poster)
  7. Nntp-Posting-Host: mailseq.us.oracle.com
  8. Organization: Oracle Corporation, Redwood Shores CA
  9. References: <1993Jan07.204648.21545@dlogics.com>
  10. Date: Fri, 8 Jan 1993 20:24:37 GMT
  11. X-Disclaimer: This message was written by an unauthenticated user
  12.               at Oracle Corporation.  The opinions expressed are those
  13.               of the user and not necessarily those of Oracle.
  14. Lines: 33
  15.  
  16. In article <1993Jan07.204648.21545@dlogics.com> rsimkin@dlogics.com (Rick Simkin) writes:
  17. >I've been asked to find out...
  18. >
  19. >Is it possible to write a DLL for Microsoft Windows which uses Pro*C?  Are
  20. >there special restrictions, limitations or tricks that you need to know?
  21. >Has anybody out there actually written a DLL that uses Pro*C?
  22. >
  23. >Thanks for any help you can give me on this. (I myself have no experience
  24. >with Pro*C or DLLs--at least, not yet :-)
  25. >
  26. >================ I speak for myself only, not for my employer ================
  27. >Rick Simkin                                 UUCP:     uunet!dlogics!rsimkin
  28. >Datalogics, Inc.                            INTERNET: rsimkin@dlogics.com
  29. >441 W. Huron St.                            PHONE:    +1 312 2664437
  30. >Chicago, Illinois  60610-3498  USA          FAX:      +1 312 2664473
  31.  
  32. Yes, this works. Specify REENTRANT=YES on the Pro*C command line and include
  33. only 1 function per .pc file. Declare the variables as local to the 
  34. procedure, i.e.
  35.     int proc ()
  36.     {
  37.     EXEC SQL BEGIN DECLARE SECTION
  38.         char myvar
  39.     EXEC SQL END DECLARE SECTION
  40.     ...
  41.     }
  42. The reentrancy stuff is due to the fact that under Windows, all instances of
  43. a dll share the same data space - the reentrant problems crop up when a second
  44. instance invokes the DLL. If the DLL is only to be used by 1 app, this isn't
  45. necessary.
  46.  
  47. Dave Criswell
  48. Oracle Desktop Products
  49.