When trying to run a 16-bit Windows application that is compiled with Borland C++ 5.02 in Windows 95, it does not have any 3D Controls when using EnableCtl3d(true) within the InitMainWindow function of the application. This text file explains how to override this behavior so that your application has 3D Controls in both Windows 3.X and Windows 95. In C:\BC5\INCLUDE\OWL\applicat.h we need to change a few variables from being private to being protected so that our application can modify their values. Just search the file for this grouping of variables. It's about halfway down the file. Be sure to keep everything in the same order. It is not necessary to rebuild OWL with this change. BE SURE TO MAKE A BACKUP COPY! ------------------------------ applicat.h --------------------------- ... // This section of code has been added. protected: bool BWCCOn; TBwccDll* BWCCModule; bool Ctl3dOn; TCtl3dDll* Ctl3dModule; private: // The following section was commented out, to make the variables protected // instead. The new code is above. /* bool BWCCOn; TBwccDll* BWCCModule; bool Ctl3dOn; TCtl3dDll* Ctl3dModule; */ TCurrentEvent CurrentEvent; ... ------------------------------ applicat.h --------------------------- Now, we'll need to modify the InitMainWindow () function of your application as follows (just pay attention to the CTL3D override parts): ------------------------------- myapp.cpp -------------------------- ... void MyApp::InitMainWindow () { if (nCmdShow != SW_HIDE) nCmdShow = (nCmdShow != SW_SHOWMINNOACTIVE) ? SW_SHOWNORMAL : nCmdShow; SDIDecFrame *frame = new SDIDecFrame(0, GetName(), 0, true); frame->SetFlag(wfShrinkToClient); // // Assign ICON w/ this application. // frame->SetIcon(this, IDI_SDIAPPLICATION); // // Menu associated with window and accelerator table associated with table. // frame->AssignMenu(SDI_MENU); // // Associate with the accelerator table. // frame->Attr.AccelTable = SDI_MENU; //EnableCtl3d(true); // The following code is to override TApplication::EnableCtl3d so that // 3d controls are available in Windows 95 // Beginning of CTL3D override for BC5 bool enableCtl3d = false; if( !Ctl3dModule ) { Ctl3dModule = new TCtl3dDll(); if( ( Ctl3dModule = new TCtl3dDll() )!= NULL ) { Ctl3dModule->Register(*this); enableCtl3d = true; } } else//been here, done that enableCtl3d = true;// to Ctl3dOn flag Ctl3dOn = enableCtl3d; // End of Ctl3d override for BC5 ... rest of InitMainWindow () function ------------------------------- myapp.cpp -------------------------- That should do it! This method should work with BC++ 5.0 and above. Cover myself statement: You use this information at your own risk. I cannot be held liable for loss or damages resulting from the use or misuse of this code, including but not limited to the following: loss of data, your program, your harddrive, your car keys, your mind, etc.. :) Mark Headrick headrick@ionet.net webmaster@pharaohgames.com