How to get a UI in a DLL to show tooltips?

I basically need to have an application in a DLL.



An application, that we don't have access to the source for, uses a DLL to 
expand its functionality.  Currently we have been displaying only Dialog 
boxes from the DLL which works fine.  We are now adding a new graphics 
interface that uses the entire CWinApp and Doc/View architecture.  When this 
is created as a DLL some functionality is lost, mainly the buttons on the 
toolbar don't enable and the tooltips don't work.  Then menus work fine 
though.



From what I have gleaned from MSDN and the tech docs the DLL doesn't get its 
own message pump.  Therefore some messages (I'm not sure which) don't get 
forwarded to the CWinApp in the DLL.  I looked at the example dllTrace, but 
since I can't modify the calling application, that method won't work.



I then tried creating a UI Thread (since it does get a message pump) in the 
DLL.  That got the tooltips working but the windows command features (min, 
max and exit) were not working.



My next attempt was to create the DLL that interfaces to the main app and 
have it create a thread and then load another DLL from the start of that 
thread.  The second DLL has the CWinApp in it.  That worked in that the DLL 
was now getting its own message pump but the tooltips were missing and 
buttons on the toolbar are not enabled still.  Setting a break on the 
OnCmdMsg in the CWinThread did nothing but it does work in the CWinApp DLL. 
For some reason even though the thread has its own message pump some 
messages are not getting forwarded.  I was thinking with this setup that I 
could forward the command messages from the CWinThread, but since the 
OnCmdMsg doesn't get called that doesn't work.  I also tried EnableToolTips 
and using the TTN_NEEDTEXT message handler method.  Both methods don't work.



Does anyone have a suggestion on this?



Mark


0
1/18/2006 5:00:55 PM
vc.mfc 33608 articles. 0 followers. Follow

5 Replies
454 Views

Similar Articles

[PageSpeed] 3

It appears you are using a Regular DLL as opposed to a MFC Extension
DLL. That will cause the issues that you mentioned. If yes, why are you
using a Regular DLL?

----------
Ajay Kalra
ajaykalra@yahoo.com

0
ajaykalra (6840)
1/18/2006 5:13:32 PM
"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message 
news:1137604412.407266.255750@g49g2000cwa.googlegroups.com...
> It appears you are using a Regular DLL as opposed to a MFC Extension
> DLL. That will cause the issues that you mentioned. If yes, why are you
> using a Regular DLL?
>
> ----------
> Ajay Kalra
> ajaykalra@yahoo.com
>

Just to make sure we are on the same page here.
I have an application (theApp.exe) that loads a DLL (Interface.dll) when 
commanded.  This dll has standard exported functions that theApp.exe calls. 
When a command is entered into theApp.exe it gets sent to Interface.dll 
which will call my UI DLL (HP_UI.dll).  Now Interface.dll is a regulare dll 
becuase it is not explicitly linked into theApp.exe.  Now if I make 
HP_UI.dll an Extension DLL it has to be explicity linked with the 
Interface.dll, which means HP_UI.dll is loaded when Interface.dll is loaded. 
I can't do that because there is no message pump for a DLL.  I'm forcing a 
message pump by creating the thread first and then loading HP_UI.dll under 
that thread.

Where you thinking of something else?

Mark 


0
1/18/2006 7:27:14 PM
I think I am missing something here. A regular DLL or MFC Extension
dll, both can be linked to a module. Linking has nothing to do with a
DLL being Regular or Extension. A regular dll puts additional onus on
the module to do certain work. Typically you should avoid it. However
it appears you are not linking at all(?). How are you loading the DLL
if you are not linking it? You should make it a Extension DLL and link
it to the main module and export whatever is needed in main module.

-----------
Ajay Kalra
ajaykalra@yahoo.com

0
ajaykalra (6840)
1/18/2006 8:54:17 PM
Hey Ajay,

It looks like he has third party DLL that he loads using LoadLibrary. Then
the third-party library loads his DLL also using LoadLibrary.

AliR.

"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message
news:1137617657.597034.222930@z14g2000cwz.googlegroups.com...
> I think I am missing something here. A regular DLL or MFC Extension
> dll, both can be linked to a module. Linking has nothing to do with a
> DLL being Regular or Extension. A regular dll puts additional onus on
> the module to do certain work. Typically you should avoid it. However
> it appears you are not linking at all(?). How are you loading the DLL
> if you are not linking it? You should make it a Extension DLL and link
> it to the main module and export whatever is needed in main module.
>
> -----------
> Ajay Kalra
> ajaykalra@yahoo.com
>


0
AliR3470 (3234)
1/18/2006 9:04:37 PM
Alir has it almost right :) ,
I have a third party EXE that calls a regular DLL.  Because a DLL doesn't 
have a message pump (regular or extension), I create a UI thread in the DLL 
that loads another DLL and attaches the window from that DLL into the 
thread.  This is because I don't have access to the EXE and I can't change 
its message pump to forward messages it doesn't understand to my window.

So; EXE calls my regular DLL that I have created with a standard exported 
function list.  My regular DLL creates a UI Thread and loads my UI DLL that 
I created also.  The DLL's are loaded with LoadLibrary and the exported 
functions are called after getting with GetProcAddress.

Have I cleared the mud any?

Mark

"AliR" <AliR@online.nospam> wrote in message 
news:F3yzf.13439$Jd.9650@newssvr25.news.prodigy.net...
> Hey Ajay,
>
> It looks like he has third party DLL that he loads using LoadLibrary. Then
> the third-party library loads his DLL also using LoadLibrary.
>
> AliR.
>
> "Ajay Kalra" <ajaykalra@yahoo.com> wrote in message
> news:1137617657.597034.222930@z14g2000cwz.googlegroups.com...
>> I think I am missing something here. A regular DLL or MFC Extension
>> dll, both can be linked to a module. Linking has nothing to do with a
>> DLL being Regular or Extension. A regular dll puts additional onus on
>> the module to do certain work. Typically you should avoid it. However
>> it appears you are not linking at all(?). How are you loading the DLL
>> if you are not linking it? You should make it a Extension DLL and link
>> it to the main module and export whatever is needed in main module.
>>
>> -----------
>> Ajay Kalra
>> ajaykalra@yahoo.com
>>
>
> 


0
1/18/2006 9:37:47 PM
Reply:

Similar Artilces:

i get error 404 not found when trying to download
I'm trying to download nokia pc suite to windows xp to upload gallery onto the computer but get error message404 not found - how can i download this pc suite please -- Krysy Albutt Krysy Albutt wrote: > I'm trying to download nokia pc suite to windows xp to upload gallery > onto the computer but get error message404 not found - how can i > download this pc suite please Care to enlighten us how this pertains to: - 1) Microsoft 2) Publisher 3) Windows If you're having problems downloading from the *NOKIA* site where do you think you should be directing your ...

IE8 doesn't show open/save dialog when opening PDF
I have written Java application that, when user click on the button, it opens new location in the same window in which it shows new HTML page and opens new popup window using window.open() JavaScript code. In the popup window Java outputs PDF using following headers: ContentType - application/pdf ContentLength - 1000 Content-Disposition - attachment; filename=My.pdf With above settings IE8 doesn't show open/save dialog for my PDF. Above code works fine with IE6, IE7 and Firefox. If I change "attachment" to "inline", then IE8 shows PDF in the popup wi...

How to get Calendar to send me reminders
I have changed my e-mail address but for some reason I cannot get Calendar to send reminders to my new address - I think I have carried out all that is necessary to effect the changover but I am not getting reminders sent. Can anyone help please? Is the Calendar Live ID based and accessible at Calendar.live.com ? -- ....winston ms-mvp mail "Dabardevon" wrote in message = news:FDC2B3B2-EDE4-41B1-BFC4-C0F9ED59CFB9@microsoft.com... I have changed my e-mail address but for some reason I cannot get = Calendar to send reminders to my new address - I think I have...

Non US Dollar accounts do not show in Settings for Active Sync
I am currently using Microsoft Money 2006 for both my desktop and my pocket pc device. I am attempting to sync some of my accounts to my pocket pc device. However, it seems that the options for Active Sync is only shows acocunts that are using US Dollar as the currency. I would like to sync accounts that are using Singapore dollars. Any way I can do this? No. You can only synchronize accounts which are in your base currency, which appears to be US Dollars in your case. -- Glyn Simpson, Microsoft MVP - Money http://money.mvps.org Check http://money.mvps.org/faq/default.aspx for ...

Some recipients get the attachment, some get winmail.dat
This one has me baffled. We are using Exchange 2000 and Outlook 2000 and have been for 8 months. No previous problems with attachments (.doc, .xls, .jpg). About 2 weeks ago, we started hearing from certain recipients that the attachment wasn't arriving; instead they were getting an unreadable file called winmail.dat. MS says that this is because the sender is using Rich Text to format the email. We have changed the senders to use Plain Text and still have the same problem. If the email is sent to several recipients, some will get the attachment fine, some will not. This didn'...

How to get the CScrollBar's Handle in CTreeCtrl?
Hey,All: I thought I have a problem when I trid to get the CScrollBar's handle from my CTreeCtrl extended handle. Can anybody tell me whether I can get the handle of the CScrollBar from the CTreeCtrl? Thanks in advance! Carl :-| Carl wrote: > Hey,All: > > I thought I have a problem when I trid to get the CScrollBar's handle from > my CTreeCtrl extended handle. > Can anybody tell me whether I can get the handle of the CScrollBar from the > CTreeCtrl? > > Thanks in advance! > Carl > :-| > > Sorry, it is not that simple. The scroll bars that...

A Crystal Beginner
I am using Crystal 9.2.4.77 and have loaded the Crystal enhancements. Now I want to do against the CRM database. What do I do? I thought I would create a data source to the CRM SQLserver, which I did, then connect to it through Crystal Reports. That works, but when I drill down on the AAA_MSCRM database to choose my tables, it shows me dbo as the only option (where did this come from??) and under that are just a few generic tables. No CRM tables. Something's not quite right. What am I missing? file - log on to aps server "KBLawson" <klawson@aetinc.com> wrote in ...

Cannot get fast forward or fast reverse to work with WMP 11
I am running Vista Home Premium on a HP G 217-EM Notebook which comes pre-installed with Windows Media Player 11. When I play cds and try to fast forward or fast reverse by keeping the fast forward or fast reverse buttons constantly depressed nothing happens. Why is this, and can anyone come up with a solution? Many thanks This doesn't work on my system either, so it's probably just a limitation of WMP. Fast forward and fast reverse should work fine when you rip the CD's to MP3 or WMA files, and play these files instead. Regards -- Tim De Baets http://www....

Get paid while you get online!!
I found a great Internet company - Cashfiesta.com - that has created a product everyone can benefit from. They pay you while you work or play on your computer. All you need to do is keep their software - the FiestaBar=99 - active while you are online. They even pay you when your friends are using their computers. Unlike other companies, Cashfiesta gives you control over how much money you earn. They have an individual payrate based on the number of Special Offers you sign up for. As some of these offers are free, you can increase your payrate up to 33 times without spending a penny. It's...

Can't get auto-update (update) to install
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: Power PC I've been trying to manually check for updates to Word 2008, and I get a &quot;critical update&quot; notice, asking me to install auto-update. When I try to install it, I cannot. It just keeps repeating the attempt, in an &quot;endless loop.&quot; What to do? <br> Thank you. ...

Spreadsheet getting corrupted
Hello All: I have a relatively large spreadsheet. I am getting errors (see after my signature line). What could be causing these errors? Is it that the spreadsheet is too large? Thanks Deguza -------------------------------------------------------- Microsoft Office Excel File Repair Log Errors were detected in file 'C:\Documents and Settings\deguza\My Documents\sales\Sales_2006_2007.xls' The following is a list of repairs: Global PivotTable report information was repaired due to integrity problems. Global PivotTable report information was repaired due to integrity problems. Glo...

Reg getting the next IV Document Number field !
Hi, I am creating a window in dexterity similar to the item transaction entry window (Transactions>Inventory> Transaction Entry). In the Item transaction Entry window, the Document number field defaults to the next document number when we move the focus to that field. I wanted to know if there is any function , or table that i can access to get the next document number in the new window that i am creating. Thanks, swetha -- swetha >In the Item transaction Entry window, the Document number field defaults to the next document number when we move the focus to that field.< T...

How do I get??
Sorry if this seems a fairly easy question to you guys. I have a spreadsheet and I need to get the current system time into a cell. The format of the time is hh:mm am/pm. Any assistance would be most helpful. Hi try =INT(NOW()) in this cell and format is to your needs -- Regards Frank Kabel Frankfurt, Germany PM wrote: > Sorry if this seems a fairly easy question to you guys. > > I have a spreadsheet and I need to get the current system time into a > cell. The format of the time is hh:mm am/pm. > > Any assistance would be most helpful. PM, in the cell you want pu...

Get notified when Out of Office is on
I am using Outlook 2007. With 2003, when returning from leave, I used to get a notification that the Outlook out of office was still on and asking me if I wanted to switch it off. This reminder no longer appears with 2007. How can I switch this setting on so that I get the notification? "Mary Ann" <MaryAnn@discussions.microsoft.com> wrote in message news:ED5533A7-D0EA-41B8-B1A0-A9D15FB6FD98@microsoft.com... >I am using Outlook 2007. With 2003, when returning from leave, I used to get > a notification that the Outlook out of office was still on and asking me ...

over VPN, it gets stuck when sending outgoing email
When I use VPN to connect to work from home, the outlook can not finish sending outgoing emails. The progress bar moves to the end but then stops there forever. It can never finish. The receiving of new incoming emails work fine. All other network functionality works, e.g. internet browsing, telnet, ftp, etc, all work fine. My system is win2k. I use linksys wireless DSL router. I'd appreciate any hint! Are you using Exchange server? I'd set up your mail profile to prompt you to work offline or online - when using VPN, work offline with scheduled syncs. If not using exchange, pos...

TAB Key doesn't work in my DLL dialog app
I created a dialog based application in a DLL. When I run my dialog, I can not Tab between items. Basically the Tab key doesn't do anything. Is there a fix to this.... am I missing some option somewhere in MFC? Is it by any chance a MFC Regular DLL and you are dealing with a modeless dialog? --- Ajay Marek wrote: > I created a dialog based application in a DLL. > > When I run my dialog, I can not Tab between items. Basically the Tab > key doesn't do anything. > > Is there a fix to this.... am I missing some option somewhere in MFC? yes Ajay Kalra wrote: >...

Getting Control ID in Active X control
GetWindowLong return 0. You need to call GetDlgCtrlID from outside the activex control as the function available within the control returns an arbitrary value of zero. Take a look at this article http://xendra.ens.uabc.mx/~sinfante/loo/libro/ch17_4.htm particularly the paragraph preceeding the title "MFC and Ambient Properties". This really begs the question why you want the ID in the first place as activex controls have to be fully self containing to operate - with a few exceptions where sibling controls need to be able to locate each other. - Tim "ytv" <...

Get photos from a camera
I have an asp.net intranet application that I need to upload 1 or all photos from a digital camera at a PC workstation. We are using DataGrids and GridViews to display them on the web once they are uploaded but need something at the client. I assume I need some sort of ActiveX process or something. Has anyone run into a solution for this need? Thanks. -- David "DavidC" <dlchase@lifetimeinc.com> wrote in message news:2B061F4F-B548-4AA4-96FA-2F87383192D2@microsoft.com... > I have an asp.net intranet application that I need to upload 1 or all > photos ...

How to show completed/canceled appointments?
Hi We are using MSCRM 1.2 When an appt is closed or canceled, it "disappears" from the Calendar. How can we keep them displayed in the calendar? Thnks Jeff CORCEL SYSTEMS SDN BHD, www.corcelsystems.com We design and develop business-led database-driven web applications. Jeff, There is a SQL job that runs on a periodic basis that does this "delete". You could modify this job or disable it. Matt On Mon, 01 Mar 2004 18:07:18 +0800, Corcel CRM <ebusiness@DELETEcorcelsystems.com> wrote: Hi We are using MSCRM 1.2 When an appt is closed or canceled, it "dis...

how to get the format of this cell right?
When I let go: Selection.Replace " ", Replacement:="-", Lookat:=xlPart, _ SearchOrder:=xlByColumns, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False " " is entered by means of an array: Words = Array(" ", "+", "/", "---", "--", "&") on a cell containing: 5 a I would expect to get: 5-a as a result. Unfortunately, it produces 5:00:00-AM. How can I solve this tiny but frustrating problem? best regards Pet...

How do I get my best friend back?
I NEED TO KNOW "monsterboy16" <monsterboy16@discussions.microsoft.com> wrote in message news:7918DF09-EB34-46E4-852E-8DAAC3FFF45F@microsoft.com... > I NEED TO KNOW Easy. Just lift the lid on your toilet seat and whistle. Dipshit! -- "Don't pick a fight with an old man. If he is too old to fight, he'll just kill you." Pretend that you're in a coma and unable to communicate in any way (such as posting messages in newsgroups). "monsterboy16" <monsterboy16@discussions.microsoft.com> wrote in message news...

how to get the pointer variable address from a dll
hi all, I have a DLL which has a output parameter LPVOID, A application calls this DLL function, the Dll responsibility is to assign a valid pointer to the lpBuffer, Till here it is OK, but once it returns to the Application this lpBuffer becomes NULL. Prototype, __declspec(dllexport) BOOL TRSTMonGetStatus(LPVOID lpBuffer) Please let me know what to do, I am stuck in this. try this __declspec(dllexport) BOOL TRSTMonGetStatus(LPVOID &lpBuffer) AliR. <karunyalakshmi@gmail.com> wrote in message news:1182179607.989434.318540@x35g2000prf.googlegroups.com... > > hi a...

Why do I get this?
IMCEAEX-_O=ABC_OU=CN121_CN=RECIPIENTS_CN=USER1@companyABC.com <-- why am I getting this as the FROM field from a recently upgrade user to Exchange 2003? ...

Pcket version of Money 2004 shows incorrect balance
I have Money 2004 on myu desktop computer and it works fine. I installed the Pocket PC version on an iPAQ 3955 running Windows Mobile (2003) and when it syncs with the computer, the PPC version of Money shows a different balance then the desktop. What's up with this and how do I fix it? Thanks, Mark ...

Excel Data List Gets "Stuck" -- Help
This has now happened for the second time. I have a "data list" that is around 1800 rows in size. Somcetimes, after I've filtered the data to show just a small number of rows, it gets "stuck." I I am no longer able to expand the list to show all the rows. I've gone in to all the columns and chosen "All" for all the columns and it still does not work. I know I can highight the entire list and tell it to remove the list and recreate the list, but that's a pain, and I lose some formatting. Can anyone help me? -- slobizman -----------------------...