Re: Compiling root classes into MSVC MDI?

Fons Rademakers ((no email))
Tue, 30 Sep 1997 00:07:32 +0200 (METDST)


Hi William,

there is probably no change to use MFC without loading its custom
new and delete operators? We plan to release a version of ROOT which
will have its new and delete operators in a separate DLL, so by not
linking against that DLL you will use the MFC ones (thereby loosing
the extended memory checking of the ROOT new/delete, but at least
you can use the ROOT plotting classes).

If your application uses many fancy MFC document and view classes
than it might not be worth while to convert them to ROOT. However,
if you use only a view class to do your own polyline drawing then
it might be easier to get rid of MFC and use directly ROOT canvases
and pads in which you draw using the ROOT drawing primitives. The
nice side effect of this approach is that your program becomes
cross-platform (i.e. runs everywhere root runs).

Cheers, Fons.

>
> Hello!
>
> I have a MSVC++ multiple document interface circuit code application
> I've written during the past eight weeks before stumbling upon ROOT.
> Now I seem to have a serious dilemma. Is it reasonably possible to
> incorporate ROOT plotting classes (THxx, TNtuble, etc.) into an MFC
> application? Or would you believe less time consuming to convert
> existing MSVC document and view classes to ROOT? For the later case,
> take into consideration that I've used STL deque containers.
>
> I've already tried calling root routines from my applications, but the
> root library "new" and "delete" overloading seems to crash my program.
> // Sample
> // any MSVC class within MDI application with ROOT_xxx libs included in
> link
> void TEST::test()
> {
> char *text = new char[100];
> delete[] text; // generates Runtime abnormal termination error
> }
> "char" infact is just an example. Any data type/class will result in
> the same error
>
> William J. Deninger
> deninger@uiuc.edu
>
>
>
>
>

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland          Phone: +41 22 7679248
E-Mail: Fons.Rademakers@cern.ch              Fax:   +41 22 7677910