|
Try explicitly casting the CString variable (Parameter 2 of the LoadString function that is failing) to a LPCTSTR. This should for the compiler to use the cast operator that is declared for the WTL::CString.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi,
I want to create a Balloon tooptip in my
status bar (i mean.. the application is in the
system tray)..
How can i do it.. and my application may run
on Win98 or Win2000 coz i read somewhere that
balloon tips work for only win2000 so how can
i check and set the tooltip accordingly..
Please help
Sameer
|
|
|
|
|
You might try handling the "need tooltip text" message and displaying the balloon tip described in this article. If you're successful, please consider posting your implementation at CP. Thanks!
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
For Win2K and up, this article should give you all the info you need.
<self-promotion>
For Win9x, this article should do nicely.
</self-promotion>
--------
Well actually they are sort of interesting Nish, on Nudes
|
|
|
|
|
hi,everyone
I am design a tree control that make of some directoris and some files.How can I save these infomation into a file, I need your help, thanks a lot!
Maybe it is not a dream!
|
|
|
|
|
See this article.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
It is so good!
Maybe it is not a dream!
|
|
|
|
|
Hi folks, I'm writing a software package that runs on NT/2K/XP.
It consists of a service that always runs, plus a UI app that runs while a user is logged on. The service needs to send notifications to the UI app.
So far I have been using BroadcastSystemMessage() to do this and it works, EXCEPT when I have multiple users logged onto XP via fast user switching.
In that case, it seems as if the service only broadcasts to the first logged on user's session; the sessions that logged on later don't seem to get the broadcast.
My service's call to BroadcastSystemMessage() looks like this:
DWORD dwRecipients = BSM_ALLDESKTOPS|BSM_APPLICATIONS;
BroadcastSystemMessage(BSF_POSTMESSAGE|BSF_IGNORECURRENTTASK|BSF_NOHANG, &dwRecipients, MSG_TO_MONITOR, msgtype, 0 );
As I said, the above code works in NT/2K and even XP when only one user is logged on, but when more than one user is logged on XP, it only seems to broadcast to the current user.
I have a feeling that I should be using some other API to get my message through to all user sessions. I've looked at the WTS... API stuff for terminal services, but there doesn't seem to be anything that sends messages (there is a badly-named routine WTSSendMessage, but it shows a messagebox, it doesn't actually send a message).
So, any IPC/XP geeks out there have any advice? At this point I'm thinking of using global objects as semaphores and having a thread in the UI app wait for them and then send messages to it's main window, but I hope there is something simpler...
Thanks,
Alex Benenson
Alex Benenson
alex@sashazur.com
|
|
|
|
|
What if the app running in each client session made a uniquely named named-pipe. You could base it upon user name, or perhaps the client session ID and some other data (like you program name or company name, as advocated by Microsoft). Then your service opens the pipe as well, and the two send data back and forth?
|
|
|
|
|
All i get is the windows directory without he UniHP added
i tried many different configurations...
CString winDIR = GetWindowsDirectory();
CString addSTR = "UniHP";
//CString fDIR = winDIR + "\\UniHP";
CString fDIR = winDIR + "\\" + addSTR;
MessageBox(fDIR,"Caption",0);
shotgun
|
|
|
|
|
It could be because you are using a CString object when you need a plain char*.
Fortunately CString has an operator converting your string to LPCSTR, so afaik you only need to add an explicit (LPCSTR) before "fDir" in the call to MessageBox.
You made a beginners mistake and now you won't do it again. Right?!
If any one question was to be contributed to Microsofts infinite stupidity re. MFC, this would be the one!
|
|
|
|
|
Dear All
I have this basic doubt - if I have a number of textboxes with in a static Group, is it possible for me to cerate an array to refer to them instead of creating memebr variables for each & every box.
example : assuem there are 3 text boxes , tehn
can i jsut say m_Textboxes[3] isntead of saying m_textboxes1, m_textboxes2, m_textboxes3.
Pl. suggest
Thanks
regards
Sankar
|
|
|
|
|
Tah urgah &foo mutt
bar 47 -> 42
enth mpi jag not gilla
[7%
Fatta?!
I think I have to spell it out. If you can't get a question understandable (and I do appreciate language barriers as I'm no English speaker myself) you will get no response.
Did you use a machine translation engine that tried to engage in some eastern to english translation?
Please check your question for spelling mistakes like "then" becomes "tehn", to begin with. Sorry for being a complete bastard, but without even displaying this amount of interest in your question (to spell these word correctly, which I don't dubt you can do), how much interest do you think people possibly answering it would pay to your question?
/Mike
|
|
|
|
|
Thanks for ur suggestion.
|
|
|
|
|
Thanks for ur suggestion.
I think "ur" was to be "your".
But to get back to your problem: Yes, you can put edit controls as a group inside "something", so long as you yourself make that "something" a collections class, providing your own operator[] and such.
++luck;
|
|
|
|
|
If you want to refer to them as a collection in order to easily enable/disable them, check out this article.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Yes, you can do this. If you are using the MFC DDX_.. method, you need to declare your member variables etc outside of the AFX_DATA comment flags in the .h fiel of your dialog/class.
You also need to put the DDX_Control etc calls outside the the AFX_DATA_MAP entries in the DoDataExchange function:
DDX_Control(pDX, IDC_TRAYNAME4, m_TrayName4);
DDX_Control(pDX, IDC_TRAYNAME3, m_TrayName3);
DDX_Control(pDX, IDC_TRAYNAME2, m_TrayName2);
DDX_Control(pDX, IDC_TRAYNAME1, m_TrayName1);
DDX_Control(pDX, IDC_TRAY4_TEXT, m_Label4);
DDX_Control(pDX, IDC_TRAY3_TEXT, m_Label3);
DDX_Control(pDX, IDC_TRAY2_TEXT, m_Label2);
DDX_Control(pDX, IDC_TRAY1_TEXT, m_Label1);
DDX_Control(pDX, IDC_STANDARDS_TRAY_SGA, m_StandardsBack);
DDX_Control(pDX, IDC_STANDARDS_TRAY_LDA, m_StandardsLeft);
DDX_Control(pDX, IDC_THUMB1, m_QueuePos[0]);
DDX_Control(pDX, IDC_THUMB2, m_QueuePos[1]);
DDX_Control(pDX, IDC_THUMB5, m_QueuePos[2]);
DDX_Control(pDX, IDC_THUMB6, m_QueuePos[3]);
Roger Allen
Sonork 100.10016
yet to be identified being from the planet Paltinmoriumbanfrettybooter
|
|
|
|
|
I added a tab control to my dialog box using the dialog editor in VC++. I cannot figure out how to add a tab to the control. I have attempted to use TabCtrl_InsertItem(hTemp, 0, &tci); where hTemp is gotten by GetDlgItem(hWndMain, Tab_1); under the WM_INITDIALOG, but the hTemp is always NULL. I can understand this because the control isn't created yey. if I do the same steps using a button to run them, then the tab will show up on the Tab Control. But I need it to show up when the window is created. Can anyone show me a way to do this or point me in the right direction for this? I have been working on it for the past 4 hours and can't figure it out. Thx for the help.
Quinn
Me is very frustrated and pissed off at coding... But that just makes me feel more like a gawd when I beat the computer into submission.
|
|
|
|
|
as a first point, why not follow Joseph Newcomer's advice and never use GetDlgItem (or at least, not again this year). Create a member variable in class wizard to go with your control. He has an article about that on this site. That might take care of all your problems, if we're lucky.
|
|
|
|
|
I was poking around in the MFC source code and found the following line:
pCmdUI->SetCheck(!!m_bHelpMode);
Very strange. Any idea why the !! is used? I thought it may be some weird optimization performance thing then I found the line:
ASSERT(!!GetView()->GetRichEditCtrl().GetModify() == !!bModified);
And of course optimization in an ASSERT is quite pointless.
Anybody hazard a guess?
Joel
|
|
|
|
|
The construct will ensure that direct comparisons to TRUE will evaluate correctly (so long as TRUE is defined as !FALSE )(which it should be).
Of course, you shouldn't be doing direct comparisons to TRUE anyway... My thoughts are these lines were written by some dipshit maintenance programmer straight out of a party school, but hey, maybe this passes for wit at MS...
--------
Well actually they are sort of interesting Nish, on Nudes
|
|
|
|
|
I guess that this's a way for cripted code... for esample:
asm{
mov ax,1
NOP
NOP
NOP
mov bx,ax
...
};
this's equal to:
asm{
mov ax,1
mov bx,ax
...
};
because NOP don't work operations.
|
|
|
|
|
yah but we used to write stuff like that for diff reasons
either the code was self-modifying at run time
or its a virus with space for random mutations to fool the pattern matchers ... errrrr not that i know anything about writing viruses
---
situations to avoid #37: "good morning ... how many sugars do you take in your coffee ... and what was your name again?"
|
|
|
|
|
! returns a bool, so !!x returns true if x != 0, false if x == 0. Basically it turns a non-bool into its bool equivalent.
--Mike--
Actual sign at the laundromat I go to: "No tinting or dying"
Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines!
My really out-of-date homepage
Big fan of Alyson Hannigan and Jamie Salé.
|
|
|
|
|
This is the one I'm going with, converting BOOL to bool in a compact form. Still both examples in MFC do not seem to need to do this!
Joel
|
|
|
|