Solved

Tooltips in a DLL

Posted on 1997-11-21
5
470 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 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

16 Experts available now in Live!

Get 1:1 Help Now