Главная страница | назад

Article #17003: How do I enable the 3D controls?

 Question and Answer Database

FAQ2003C.txt   How do I enable the 3D controls?
Category   :OWL
Platform    :All
Product    :BC++  5.x

Whenever I try to enable the 3D controls in OWL they are 
not enabled?  What the heck is the problem?

This is the result of a bug. When we check the OS version
in applicat.cpp (to make sure we don't use the 3D Controls in 
3.1), we check the wrong thing.  The fix for this is either to 
include the applicat.cpp source file in your project and change 
the line where we check this from GetMajorVersion to 
GetMinorVersion.  (Yes it is correct as GetMajorVersion, but
in the WinSys/system.h header (a microsoft header) it checks 
the byte the wrong way). If you do this you have to link 
Or you can Rebuild the OWL libraries, after changing the above 

Here is the code in applicat.cpp that you need to change--

// Enable or disable the use of the CTL3D DLL. Loads it on demand if needed.
TApplication::EnableCtl3d(bool enable)
  // As per Article Q125684 of Microsoft Development Library:
  // "If major version is 4 or greater, the application should not 
  //  implement CTL3D".
  //      'How to Use CTL3D Under the Windows 95 Operating System'
  /*if (TSystem::GetMajorVersion() >= 4)   OLD STATEMENT*/
    if (TSystem::GetMinorVersion() >= 4)  //corrected

  // Load the Ctl3d DLL if needed & register our instance
  if (enable) {
    if (!Ctl3dModule) {
      try {
        Ctl3dModule = new TCtl3dDll();
      catch (...) {
        TRACEX(OwlApp, 0, "Unable to create instance of TCtl3dDll");
  Ctl3dOn = enable;


7/2/98 10:32:32 AM

Last Modified: 01-SEP-99