OWL Next Updates




This page contains unofficial updates to the latest version of OWLNext.

The latest official patch is 6.12 and can be downloaded here.

NEW - most of these changes are incorporated in the new version, 6.13. A patch which upgrades OWLNext from 6.12 to 6.13 can be downloaded from OWLNext site.


Fixes:
Fix in TPrintDC::StartDoc by Steve Ahlgren
Under WindowsXP, when trying to print to a network printer, the error RPC_S_SERVER_UNAVAILABLE may occur. To fix the problem, in dc.h, in the function TPrintDC::StartDoc() add the lines

#if (WINVER >= 0x0400)
	DocInfo.lpszDatatype = NULL;
#endif
	
before the return statement.


Fix in TComboBox::SetHorizontalExtent by Marvin Avery
in combobox.h, the function

inline void TComboBox::SetHorizontalExtent(int horzExtent) {
  PRECONDITION(GetHandle());
#if defined(BI_PLAT_WIN32)
  SendMessage(CB_SETHORIZONTALEXTENT);
#else
  //
#endif
}
	
does not use the horzExtent parameter. The call to SendMessage() should be

  SendMessage(CB_SETHORIZONTALEXTENT,horzExtent);
	



Fix for MSVC++ OWLNext DLL by Krassimir Bozhkov
In include\owl\private\msc.h the preprocessor conditional

	#if defined(__DLL__) || defined(_DLL)
	# define BI_APP_DLL
	#else
	# define BI_APP_EXECUTABLE
	#endif
	
is incorrect. Under MSVC, _WINDLL is defined when building DLL, so #if defined(__DLL__) || defined(_DLL) should be replaced with #if defined(__DLL__) || defined(_WINDLL)


Fix for Borland C++ 5.5 by Jogy
When compiling OWLNext 6.12 with BCC5.5, there is an error in objstrm.h, because STL IO does not have constructor with ( int f, LPSTR b, int len ), but BI_STDIO_CTRFNUMSI is defined.
To fix it, add the lines

	#if (__BORLANDC__ >= 0x550)
	# define NO_BI_STDIO_CTRFNUM
	#endif
	
before the lines

	#if (__BORLANDC__ >= 0x540)
	# define BI_HAS_MEMBER_TEMPLATE
	#endif
	
TRegConfigFile bug fix by Jogy
When using TRegConfigFile::ReadString() a potential problem is that the returned buffer will not be null-terminated, if it is written no null-terminated in the registry, which is the default for TRegConfigFile::WriteString(). This can be fixed by adding the line

	buffer[size] = '\0';	
	
at the end of the function TRegConfigFile::ReadString(), before the statement

	return (int)size;
	
Also, when writing string values to the registry, it is recommended that the null-terminator is included in the buffer length. This can be fixed by changing the line

	uint32 size = ::_tcslen(value)*sizeof(_TCHAR);
	
with

	uint32 size = (::_tcslen(value) + 1)*sizeof(_TCHAR);
	
in the function TRegConfigFile::WriteString()


EV_LVN_ENDLABELEDIT bug fix by Jogy
The definition of the EV_LVN_ENDLABELEDIT notification handler incorrectly uses TLwNotify& insetad of TLwDispInfoNotify& as a parameter. To fix it, replace the line

	#define EV_LVN_ENDLABELEDIT(id, method)     EV_LISTWIND_NOTIFY_BOOL(id, LVN_ENDLABELEDIT, method)
	
with

	#define EV_LVN_ENDLABELEDIT(id, method)     EV_LV_DISPINFO_NOTIFY_BOOL(id, LVN_ENDLABELEDIT, method)
	
in the file owl\commctrl.h


Enhancements:
Microsoft Layer for Unicode by Jogy
Read how to use OWLNext with Microsoft Layer for Unicode here

TConfigFileSection Erase() enhancement by Staso
In configfl.h, to TConfigFileSection, add the public inline function

bool		Erase()   { return File.EraseSection(Section.c_str());  }
	

TFileNameIterator enhancement by Boris
in filename.h to TFileNameIterator, add the public inline functions

    bool IsDir() const;
    bool IsSysDir() const;//true if it is the "." or ".." system directory; 
	
with implementation:

inline bool TFileNameIterator::IsDir() const
{ 
  return Status.attribute & FILE_ATTRIBUTE_DIRECTORY; 
} 

//Returns true if it is a directory and the directory is "." or ".."; 
inline bool TFileNameIterator::IsSysDir() const
{  
  const char* p = Status.fullName;
  return IsDir() && p[0]=='.' &&
          (p[1]=='\0' || p[1]=='.' && p[2]=='\0');
}    
	

TFileName enhancement by Jogy
Function which adds a subfolder to the current path contained in the TFileName object.

In filename.h add the lines

bool AddSubDir(LPCTSTR subdir);
bool AddSubDir(const owl_string& subdir);
	
in the declaration of the class TFileName, preferably after the function CreateDir().

In filename.cpp add the lines

bool
TFileName::AddSubDir(LPCTSTR subdir)
{
  if (_tcschr(dirSeparator, subdir[0]) == 0) // The subdir does not begin with the separator
    PathStr += dirSeparatorStr;

  PathStr += subdir;

  if (_tcschr(dirSeparator, PathStr[PathStr.length() - 1]) != 0)  // The resultring string ends with the separator
    PathStr = PathStr.substr(0, PathStr.length() - 1);

  return true;
}

bool
TFileName::AddSubDir(const owl_string& subdir)
{
  return AddSubDir(subdir.c_str());
}

preferably after the definition of the function CreateDir().



Suggestions:
Rename diagnostic macros by Steve Ahlgren
OWL diagnostic macros TRACE, TRY, CATCH, etc. may interfere with MFC ones when both frameworks are used together, so Steve suggests to rename them to OWL_TRACE, OWL_TRY, OWL_CATCH, etc.

Use #pragma once by Boris Vidolov
This #pragma can be used to speed compilation under Visual C++. Add the code

	#ifdef _MSC_VER  
	#   pragma once 
	#endif 
	
at the start of all OWLNext header files.

Back to home Back to main