------=_NextPart_000_0009_01BD45DF.0C0687A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
keywords:
MS - Microsoft
MFC - Microsoft Foundation Class
MDI - Multiple Document Interface
Hello,
I've had success compiling, linking and running ROOT as a MFC MDI =
application using the Microsoft Visual C++ 5.0 Studio. What I thought =
was going to be the major hurdle, the building of a functional project =
workspace, has turned out to be fairly simple. I still have one hurdle =
to overcome, however, which results from the use of multiple threads in =
the Win95/WinNT port.=20
>From previous roottalk correspondences, I remember mentioned that the =
WinNT/Win95 port actually has two threads (composing two message =
handling loops): one for the CINT commands, the other for CINT window =
messages. One of these (I think) is the initial application thread. The =
MFC application itself has a message loop (virtual CWndApp::Run()) which =
can be overloaded in order to change application behavior. The MFC =
message loop traditionally is the application thread because it makes no =
special thread provisions.=20
What I'm trying to do in the simplest of terms is get the ROOT canvases =
attached (as child windows) to the MDI application main frame window, =
and have the all window messaging handled by the same application thread =
message loop. The ROOT CINT command thread would be an additional =
thread worker thread.=20
Adding WS_EX_MDICHILD to the window style and replacing the NULL window =
handle with the HWND of the mainframe in =
TGWin32WindowsObject::CreateWindowsObject was a failed attempt, but I =
had not combined CWndApp and ROOT message loops. Does anyone in =
ROOTLAND have a suggestion for implementing this, or perhaps know of a =
place I might go for more information?
William J Deninger
deninger@uiuc.edu=20
//_______________________________________________________________________=
______
//
// TGWin32WindowsObject.cpp
void TGWin32WindowsObject::CreateWindowsObject(TGWin32 *lpTGWin32, Int_t =
x, Int_t y, UInt_t w, UInt_t h){
.
.
fDwStyle =3D WS_OVERLAPPEDWINDOW | WS_VISIBLE /*added by deninger*/ =
| WS_EX_MDICHILD /*end deninger add*/; // window style
fDwExtStyle =3D WS_EX_CONTEXTHELP | WS_EX_OVERLAPPEDWINDOW;
.
.
}
void TGWin32WindowsObject::Win32CreateObject()
{
.
.
fhwndRootWindow =3D CreateWindowEx(fDwExtStyle,
fWin32Mother->fROOTCLASS, // =
extended window style
(char *)(fWin32Mother->GetTitle()), // =
address of window name
fDwStyle, // window style
x,y, // start =
positio of the window,
fSizeFull.cx, fSizeFull.cy, // size of =
the window
// NULL, // =
handle of parent of owner window
MDIMainFrame, // add by deninger 1998, (HWND =
handle to main frame)
NULL, // handle =
of menu, or child-window identifier
fWin32Mother->fHInstance, // handle =
of application instance
this); // address =
of window-creation data
ReleaseSemaphore(fhSemaphore, 1, NULL);
// --> temporary lpWinThr->fhwndRootWindow =3D =
CreateTextClass(WinThr);
}
//_______________________________________________________________________=
___________
//
// MyApp.cpp
extern void InitGui();
VoidFuncPtr_t initfuncs[] =3D { InitGui, 0};
TROOT root("Rint","The gm2 Traceback ROOT Interactive Interface", =
initfuncs);
#include "TCanvas.h"
extern void *MDIMainFrame;
void MyApp::InitInstance()
{
.
.
c1 =3D new TCanvas("c1","place me in the MDI main frame please");
}
------=_NextPart_000_0009_01BD45DF.0C0687A0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">