[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Tooltips in a DLL

Posted on 1997-11-21
5
Medium Priority
?
495 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 240 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

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

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 …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Integration Management Part 2
Suggested Courses
Course of the Month18 days, 10 hours left to enroll

826 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