Solved

Tooltips in a DLL

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Unix / Linux grid computing 5 157
Whole sheet autoscrub still needed 19 50
Expand to include initial dialog with two choices. 9 78
scoreUp challenge 14 62
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

773 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