Solved

Tooltips in a DLL

Posted on 1997-11-21
5
474 Views
Last Modified: 2013-11-20
I've got an MFC DLL that creates a CFrameWnd with a couple of toolbars in it.  The toolbars work fine, but for some unknown reason (to me), their tooltips don't.  I create the toolbars in my CDerivedFrameWnd::OnCreate() function like this...

m_wndFormatBar.Create(this, WS_CHILD | WS_VISIBLE |
  CBRS_TOP | CBRS_TOOLTIPS | CBRS_FLYBY,   IDR_FORMATBAR);

Since I'm using CBRS_TOOLTIPS, I'm not sure why they're not displaying.  I've got tooltips assigned to each button on the toolbar.  Incidentally, if I use the same CDerivedFrameWnd in an executable, suddenly the tooltips DO work.  But I need to have it working from the DLL.
0
Comment
Question by:nbushman
  • 3
5 Comments
 

Author Comment

by:nbushman
ID: 1310500
Edited text of question
0
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1310501
It is probably related to the where the string table resources for the tooltips are located. You may have to add AFX_MANAGE_STATE(AfxGetStaticModuleState()) in the function that creates the main frame.


0
 

Author Comment

by:nbushman
ID: 1310502
I had already added the statement...

AFX_MANAGE_STATE(AfxGetStaticModuleState());

... as the first statement in the DLL's only exported function, which is also the function where I create and load my CFrameWnd derived window.
0
 

Author Comment

by:nbushman
ID: 1310503
I had already added the statement...

AFX_MANAGE_STATE(AfxGetStaticModuleState());

... as the first statement in the DLL's only exported function, which is also the function where I create and load my CFrameWnd derived window.

It didn't work.
0
 
LVL 1

Accepted Solution

by:
IgorGrebnev earned 80 total points
ID: 1310504
Probably the tooltips are created during the idle processing. The  regular MFC DLL doesn't obtain automatically the idle processing, you need to call CWinApp::OnIdle of of DLL application object from CWinApp::OnIdle of applixaiton object of execuatable.
Try to create extension DLL. The code in extension DLL work practically the same as if in executable, it doesn't create additional MFC state.
YOur, Igor
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
maxBlock challenge 30 113
Modbus - whats the maximum I can store in one register? 4 78
Unix Command -- Challenging  question 7 87
x-bar in Google Sheets 2 27
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now