home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / os2 / programm / 7131 < prev    next >
Encoding:
Internet Message Format  |  1992-12-21  |  2.2 KB

  1. Xref: sparky comp.os.os2.programmer:7131 comp.os.os2.apps:9502 comp.os.os2.misc:39928
  2. Path: sparky!uunet!stanford.edu!rutgers!njitgw.njit.edu!hertz.njit.edu!dic5340
  3. From: dic5340@hertz.njit.edu (David Charlap)
  4. Newsgroups: comp.os.os2.programmer,comp.os.os2.apps,comp.os.os2.misc
  5. Subject: Re: DLL question
  6. Keywords: DLL library
  7. Message-ID: <1992Dec18.204637.2448@njitgw.njit.edu>
  8. Date: 18 Dec 92 20:46:37 GMT
  9. References: <lj1ktuINNftf@exodus.Eng.Sun.COM>
  10. Sender: news@njit.edu
  11. Organization: New Jersey Institute of Technology, Newark, N.J.
  12. Lines: 36
  13. Nntp-Posting-Host: hertz.njit.edu
  14.  
  15. In article <lj1ktuINNftf@exodus.Eng.Sun.COM> deepakd@ural.Eng.Sun.COM (Deepak Dhamdhere) writes:
  16. >I have an application that calls functions from ABC.DLL,
  17. >those functions call routines from XYZ.DLL and those, in turn,
  18. >call routines from the C library. This application starts a child process
  19. >using DosExecPgm, which in turn, does the same thing. I have used 
  20. >llibcdll.lib to link all these programs and libraries. 
  21.  
  22. Are you also using the compiler switches to ensure that DS!=SS and
  23. that DS is always loaded on process entry.  I think these are in the
  24. keyword EXPENTRY.  I believe that any functions you export to a DLL
  25. must be declared with this.
  26.  
  27. >Very frequently, it generates a segementation violation. When I checked
  28. >with Codeview, I found that the malloc() call fails because it tries to
  29. >load a non-existent segment into DS.
  30.  
  31. It sounds like the DLL is (correctly) assuming that DS!=SS, and is
  32. loading it, but the calling program isn't providing the segment.  Be
  33. sure that the code and headers are using the EXPENTRY keyword for all
  34. exported functions.
  35.  
  36. >Any clues to why is this happening ? I would like to know the correct
  37. >way of compiling and linking ABC.DLL, XYZ.DLL and the applications.
  38.  
  39. In general, I don't like to call C run-time functions from DLL's, but
  40. that's a different story.  Some compilers (like EMX/GCC) have the C
  41. library functions in a DLL, so there's little linkage problems, but
  42. you can't do that with MS-C.
  43.  
  44.  
  45.  
  46. -- 
  47.   |)  David Charlap          | .signature confiscated by FBI due to
  48.  /|_  dic5340@hertz.njit.edu | an ongoing investigation into the
  49. ((|,)                        | source of these .signature virusses
  50.  ~|~
  51.