
Tue, 07/06/2004 - 19:31
Hello everybody,
I found a bug which drives me crazy. When OCC is used in a dialog as a control (as found in the example HLR) it shows a weird behaviour:
1) The background of the dialog window is not painted correctly
2) On some systems (and I cannot say under what circumstances) the controls is completely black. This does not depend on the OS Version !
Both effects can be seen on the following screenshots showing the original HLR example (in my application the effect is the same):
http://www.jocomomola.de/occ/occ1.jpg
http://www.jocomomola.de/occ/occ2.jpg
I found a workaround for the bug, which is as follows:
Save the Windowproc before you create the WNT_Window and restore it afterwards to the original value:
// Save the window proc pointer
LONG WndProc = GetWindowLong(GetSafeHwnd(), GWL_WNDPROC);
Handle(WNT_Window) aWNTWindow =
new WNT_Window(theGraphicDevice, GetSafeHwnd());
if (!aWNTWindow->IsMapped())
aWNTWindow->Map();
m_View->SetWindow(aWNTWindow);
// restore it to the original value
SetWindowLong(GetSafeHwnd(), GWL_WNDPROC, WndProc);
Unfortunately this does not solve my second problem, which makes OpenCascade unusable in dialog windows :-)
Markus
Tue, 07/06/2004 - 22:25
Hi Markus,
could you try to download exoTKAD ( http://sourceforge.net/project/showfiles.php?group_id=37373 ) to see if it is the same ( you can have a dialog box when you select an object in the 3d viewer, RMB and Transparency ).
If not, sorry....
HTH,
Stephane
Tue, 07/06/2004 - 23:28
Hi Stephane,
I'm sorry but I can't test it: The executable install has an unresolved external "angular_precision" in TKMath.dll (what version of OCC are you using?) and the source code does not compile here (a lot of compile errors). I use the latest public OCC release.
Markus
Tue, 07/06/2004 - 23:36
Did you download the version with OCC ?
the installer is installing the old ones ( I don't remember which version) in the exoTKAD directory, so it should be no conflict with your existing application.
try downloading http://prdownloads.sourceforge.net/exotk/exoTKAD_0.2Beta_Setup_WithOCC.e...
If you still have problems, I can send you the "new" one compiled with 5.1
HTH,
Stephane
PS : for the problems running exoTKAD, mail me directly : stephane.routelous@exotk.org
Tue, 07/20/2004 - 17:38
The first part of my problem report seems to be solved: Do not use the MFC function "DDX_Control" to bind a control to an OCC window. Use "CWnd::Create()" instead and take only the coordinates from a control in a window. The OnPaint() function of your control shall look like this:
void COccControl::OnPaint()
{
CPaintDC dc(this); // important !!!
if (!m_View.IsNull())
m_View->Redraw();
}
The second part of the problem is still under my investigation.
Kind regards
Markus Nickels