Avatar of geo_134
geo_134

asked on 

CDialogBar Onclose not being called

I would like to trap the onclose for a derived class from CDialogbar.Added the code for OnClose but does not seem to call it.
.NET ProgrammingEditors IDEs

Avatar of undefined
Last Comment
George Tokas
Avatar of Jaime Olivares
Jaime Olivares
Flag of Peru image

How did you add? Have you used the class wizard?
Which compiler are you using?
Avatar of geo_134
geo_134

ASKER

I am not using class wizard.I have derived a class CLoggerToolBar from CDialogBar. i am creating it as
// Logger Toolbar.
m_pWndLoggerToolBar = new CLoggerToolBar;
if ( m_pWndLoggerToolBar )
{
m_pWndLoggerToolBar->Create(this, IDD_LOGGER_TOOLBAR, CBRS_GRIPPER | CBRS_TOP, IDD_LOGGER_TOOLBAR );

// Don't allow docking.
m_pWndLoggerToolBar->EnableDocking(0);
            
}  

IDD_LOGGER_TOOLBAR is an ID defined in the resources
then, how are you trying to process the OnClose event?
If you are not using the wizard, maybe you missed something
Avatar of geo_134
geo_134

ASKER

well in the .h file add afx_msg void OnClose();
.cpp file
add the ON_WM_CLOSE in the message map and add the Onclose function.
It does not seem to call it when i click on the cross button[x] in the tool bar.
ASKER CERTIFIED SOLUTION
Avatar of Jaime Olivares
Jaime Olivares
Flag of Peru image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of George Tokas
George Tokas
Flag of Greece image

>>m_pWndLoggerToolBar = new CLoggerToolBar;
First of all I don't know many things for VC...
Is CLoggerToolBar has OnClose function as a member??
If yes then I think that:
m_pWndLoggerToolBar->OnClose = ACloseFunction;

and later code the function:
....ACloseFunction(....)
{
//your code here...
}

At least this way I'm Working with C++ Builder...

George Tokas.
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo