From: jagrant@emr1.emr.ca (John Grant)
Subject: problems with CTL3D.DLL
Organization: Energy, Mines, and Resources, Ottawa
Date: Thu, 31 Dec 1992 02:16:03 GMT

CTL3D.DLL is provided by MS on CI$ and at ftp.cica.indiana.edu
(in vendors... - sorry I forget the exact location or filenames,
but it was posted here recently).  It provides 3d effects for
listboxes, comboboxes, etc (finishing up what they started with
3d buttons).

Problems with CTL3D.DLL
-----------------------  
  1. before *anything* in your app runs (i.e. even before you check for
     'first instance', something in CTL3D.LIB (linked in) tries to find
     CTL3D.DLL.  It appears to look in at least 3 directories:
	- ...\windows
	- ...\windows\system
	- the application's home directory (GetModuleFileName)
     (I tried placing it in each of the 3 directories to see
      what it was looking for and where).

     If it can't find CTL3D.DLL, it chokes and displays:
	+----------------------+
	|     File Error       |
	| Can't find CTL3D.DLL |
	+----------------------+
     and then terminates the application before it even gets a
     chance to run.
     
     This is distinctly unfriendly! At the very least, it should
     keep it's mouth shut and quietly disable itself and keep
     going, but without 3d effects.  If it must check for CTL3D.DLL
     it should only do it in Ctl3dRegister(), so only if *I* choose
     to register it, will it croak if it can't find it.

     I had intended to set a BOOL ctl3d flag myself, if I could
     find CTL3D.DLL (in either of the 3 directories I described
     above), and then call the ctl3d... functions only
     if ctl3d==TRUE, but it croaks before I even have a chance
     to do anything.


  2. CTL3D.DLL will only allow MessageBox to display 256 characters,
     however the box is sized large enough for the entire message.
     The following example works fine without CTL3D.DLL, but
     with CTL3D.DLL, it truncates at 256 characters (just before
     "line 17") and yet it makes the box tall enough for all 20
     lines.

	MessageBox(GetFocus(),
		"this is line 1\n"
		"this is line 2\n"
		"this is line 3\n"
		"this is line 4\n"
		"this is line 5\n"
		"this is line 6\n"
		"this is line 7\n"
		"this is line 8\n"
		"this is line 9\n"
		"this is line 10\n"
		"this is line 11\n"
		"this is line 12\n"
		"this is line 13\n"
		"this is line 14\n"
		"this is line 15\n"
		"this is line 16\n"
		"this is line 17\n"
		"this is line 18\n"
		"this is line 19\n"
		"this is line 20","This is a Test",MB_OK);

If someone at MS reads this, can they please pass it on to the
folks who are responsible for this product.  No, I do not use CI$.

======================================================================
For reference, here is a skeleton outline of my code for ctl3d.dll

#include <ctl3d.h>

static BOOL ctl3d=FALSE;
static HINSTANCE appinst;

int PASCAL WinMain(HINSTANCE hinstance,HINSTANCE hprevinstance,
				LPSTR cmdline,int showtype)
{
	appinst=hinstance;      //copy to global for use everywhere

	//this is where I was going to set ctl3d TRUE/FALSE
	//depending on whether or not I could find CTL3D.DLL
	//but it choked before it got here!

	if(ctl3d){
	  Ctl3dRegister(appinst);
	  Ctl3dAutoSubclass(appinst);
	}
	
	if(!hprevinstance){
	   if(!RegisterClasses(hinstance)) return(FALSE);
	}
	...

LRESULT CALLBACK _export WndProc(HWND hwnd,UINT wm,
		WPARAM wparam,LPARAM lparam)
{

    switch(wm){
      ...

      case WM_SYSCOLORCHANGE:if(ctl3d) Ctl3dColorChange();
			     break;

      case WM_DESTROY:       if(ctl3d) Ctl3dUnregister(appinst);
			     PostQuitMessage(0);
			     break;
      ...
   }
=========================================================================
-- 
John A. Grant						jagrant@emr1.emr.ca
Airborne Geophysics
Geological Survey of Canada, Ottawa
Newsgroups: comp.os.ms-windows.programmer.misc