home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / mswindo / programm / misc / 4539 < prev    next >
Encoding:
Text File  |  1992-12-31  |  2.8 KB  |  69 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!microsoft!wingnut!stevesi
  3. From: stevesi@microsoft.com (Steven Sinofsky)
  4. Subject: Re: problems with CTL3D.DLL
  5. Message-ID: <1992Dec31.215814.28193@microsoft.com>
  6. Date: 31 Dec 92 21:58:14 GMT
  7. Organization: Microsoft Corporation
  8. References: <1992Dec31.021603.21231@emr1.emr.ca> <1huff6INNag0@cs.tut.fi>
  9. Lines: 56
  10.  
  11. In article <1huff6INNag0@cs.tut.fi> pk64380@kaarne.cs.tut.fi writes:
  12. >From article <1992Dec31.021603.21231@emr1.emr.ca>, by jagrant@emr1.emr.ca (John Grant):
  13. >> CTL3D.DLL is provided by MS on CI$ and at ftp.cica.indiana.edu
  14. >> (in vendors... - sorry I forget the exact location or filenames,
  15. >> but it was posted here recently).  It provides 3d effects for
  16. >> listboxes, comboboxes, etc (finishing up what they started with
  17. >> 3d buttons).
  18. >    /vendor/microsoft/developer-network/techsamp/3-31.zip
  19. >     
  20. >> Problems with CTL3D.DLL
  21. >> -----------------------  
  22. >>   1. before *anything* in your app runs (i.e. even before you check for
  23. >>      'first instance', something in CTL3D.LIB (linked in) tries to find
  24. >>      CTL3D.DLL.  It appears to look in at least 3 directories:
  25. >>     - ...\windows
  26. >>     - ...\windows\system
  27. >>     - the application's home directory (GetModuleFileName)
  28. >>      (I tried placing it in each of the 3 directories to see
  29. >>       what it was looking for and where).
  30. >> 
  31. >>      If it can't find CTL3D.DLL, it chokes and displays:
  32. >>     +----------------------+
  33. >>     |     File Error       |
  34. >>     | Can't find CTL3D.DLL |
  35. >>     +----------------------+
  36. >>      and then terminates the application before it even gets a
  37. >>      chance to run.
  38. >
  39. >   Yes, but that's Windows itself. Before executing a single line of the 
  40. >   application it will try and load all the DLL's needed (specified
  41. >   when linking).
  42. >   If you don't want this, you might try LoadLibrary and GetProcAddress
  43. >   (or whatever, never tried myself - so don't ask how to do this. SDK
  44. >    reference should be able to help)
  45. >
  46. >-zi
  47.  
  48. If you do not wish to implicitly load the DLL as above, you can
  49. use a LoadLibrary call on the DLL, and then to call functions
  50. you use a GetProcAddress and cast to the correct type for the
  51. prototype.  This involves some bookkeeping and annoying casts
  52. but enables your application to run without the DLL present (if
  53. that is possible).  When you do this you do not link with the 
  54. import library (the CTL3D.LIB file).
  55.  
  56. If you wish to override the Windows system modal dialog and
  57. put up your own failure dialog and handle things yourself
  58. then you can use the SetErrorMode API to turn off that dialog
  59. (but be sure to handle the error yourself).  This will only
  60. work when you use LoadLibrary explicitly, since Windows will
  61. load the DLL implicitly before your WinMain is started (and
  62. before you can SetErrorMode).
  63.  
  64.  
  65. -- 
  66. Steven Sinofsky
  67. stevesi@microsoft.com
  68. Disclaimer: I don't speak for Microsoft, BillG does that.
  69.