|
Handle the NM_RCLICK notification sent by the tree, you can even handle it in the class of the tree itself with ON_REFLECT_NOTIFY if you like, load your menu using CMenu::LoadMenu, display it with TrackPopupMenu or TrackPopupMenuEx.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Thank you,
That's what I was beginning to think about the right click.
The TrackPopupMenu/Ex is the key - I was using SetMenu! LOL
|
|
|
|
|
|
Hello,
In VS2005, the hm file created doesn't have #define prefix like it used to in VS 6.0, and the prefix is needed to create the .chm help file.
1) Does anyone know if there is a setting that I can do to add the #define prefix to hm file? Any one with experience with this?
2) I am not too familiar with the hm file besides that its created using MAKEHM, I wanted to change My App.hm to My_App.hm without changing the exe name, Do you know where I can look to be able to do that, I couldn't find it anywhere in the project properties.
Thanks
|
|
|
|
|
The .hm file is by default set to create WinHelp type files. For HTMLHelp, you will need to edit your makehelp.bat file. You'll find commands in there beginning with makehm. You need to add a /h after the makehm for htmlhelp.
makehm /h ID_,HID_,0x10000 IDM_,HIDM_,0x10000 ..\src\resource.h >>"\hlp\MyProg.hm"
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Thanks, but I read on MSDN that makehelp.bat is no longer used in the VS2005 and newer. As a matter of fact, I removed MakeHelp.bat from the project and still generated new .hm file when I recompiled.
Thanks
|
|
|
|
|
Hey Guys,
If I want to know the process ID of the window that currently has focus then I call GetForegroundProcessID()....
I am trying to think of the best way to capture a change in the focused window.
I could create a systemhook on WH_CALLWNDPROC and search for a WM_ACTIVATE or WM_FOCUS message and check the process to whom it's being sent.
or
I could poll every x seconds and check who the window in focus is.
Is there any option that I am not thinking of that won't hurt my perfomance like system hooks will?
|
|
|
|
|
If you're going to use a system hook, a WH_SHELL hook (look for a HSHELL_WINDOWACTIVATED notification) might be cheaper performance-wise?
Otherwise, your other solution seems a pretty cheap (performance-wise) alternative.
I don't know of other alternatives myself
|
|
|
|
|
Is there a way to create a window larger than your monitors resolution? I currently have a image of size 900x1440 pixels, which is displayed in a WS_POPUP window of the same size. This will eventually be displayed on a monitor with the same resolution, but i am developing the application on a normal 1280x1024 monitor. The problem i am having is that when i try to draw anything using GDI+ lower than 1024 pixels the drawing is clipped, is there anyway to overwrite this limit to let me develop this application on a normal monitor?
|
|
|
|
|
Handle the WM_GETMINMAXINFO message and return the maximum size that is needed.
Then you can set the size of the window using SetWindowPos .
«_Superman_»
|
|
|
|
|
HI,
Does anyone know what is the best way to determine at what point Rich Edit
will line break ???
For The Callback Function ..
The MSDN Doc says "This replacement is not recommended for Rich Edit control 2.0 and later, due to the complexity of multilingual word breaking."
Should I use EM_FINDWORDBREAK message to determine Where a Line Break occurs
Also MSDN says certain Flags determine delimters "WBF_BREAKLINE" ...can I set this Flag to my own charcter ???
|
|
|
|
|
I'd like to configure
MessageBox(myMsg, myTitle, MB_OK);
so that myMsg contains the line number of the source file, I've already made it include the source file name, function and explanation, but it would be useful to be able to have it include the current line number using a macro in Visual Studio ? (I'm on ver 2005) so that as I change the source, the line number is always reported correctly during program execution
tks if you can help
Lee
|
|
|
|
|
|
Hi,
I want to create a class library for Visual C++ communicating with higher baud rates than 115200 (230400 ...). Does anybody has already solved this problem.
Thanks
|
|
|
|
|
stebefbe wrote: higher baud rates than 115200
If you're using a standard PC with a 16550 UART, you cannot do this since the hardware doesn't support it. It requires at least another crystal for the 16550 chip.
Read why here[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi guys, I am working on C String and I'm having this weird error. here's the code
#include <iostream>
#include <cstring>
#include <fstream>
using namespace std;
void get_longest_word (char data[]);
int main()
{
char * MyString;
cout<<"--------------------------------------------------------------"<<endl;
cout<<"\nTask 1:\n"<<endl;
ifstream taskonefile("CStringText.txt");
if(! taskonefile.is_open())
{
cout<<"Cannot Open File!"<<endl;
exit(1);
}
int charCount;
taskonefile.seekg(0, ios::end);
charCount = taskonefile.tellg();
taskonefile.seekg(0, ios::beg);
charCount++;
MyString = new char[charCount];
taskonefile.get(MyString,charCount);
cout<<MyString<<endl;
cout<<"\nTask 2:\n"<<endl;
cout<<"Longest word in the above paragraph: ";
get_longest_word(MyString);
cout<<"\nTask 3:\n"<<endl;
int l_num = 0;
cout<<MyString<<endl;
for(int i =0; i<=strlen(MyString); i++)
{
if (MyString[i]=='l' || MyString[i]=='L')
{
l_num++;
}
}
cout << "Number of Ls" << l_num;
cin.get();
return 0;
}
void get_longest_word (char data[])
{
char * token;
char * longest_word = "a";
token = strtok(data, " ,.-");
while (token != NULL)
{
if (strlen (token) >= strlen(longest_word))
{
longest_word = token;
}
token=strtok(NULL, " ,.-");
}
cout<<longest_word<<endl;
}
</stdlib.h></fstream></cstring></iostream>
The problem is when I some to task 3 after calling void get_longest_word the content of MyString which is local to int main() becomes only the first character of the entire string...
I have no clue what is happening wrong!
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
|
|
|
|
|
strtok searches for the specified tokens within the string and when it finds a token, it replaces it with a NULL character, effectively shortining the original string to everything before the first token.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Yes, I know that but I am using parameter by value and not reference. Right now I have re-initializing the MyString variable after I make call to any functions or procedures...
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
|
|
|
|
|
p.a.r.t.h wrote: but I am using parameter by value and not reference.
Yes, but you pass the pointer by reference. It means that the function will make a copy of the pointer, but the copy will still point at the same memory location. If you think of a pointer being a simple integer variable (for sake of simplicity) containing a number (which is an address), when you pass that variable to your function, you will get a copy but which still contains the same number (the same address). Thus, if you modify the content of the pointer (changing what is at the specified address), the changes will be visible in your main because the pointer points at the same address.
|
|
|
|
|
I see, thanks for that. But is there a way to avoid this?
- Stop thinking in terms of limitations and start thinking in terms of possibilities -
|
|
|
|
|
You may copy the CString and do whatever you want with the copy without altering the original one.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Is possible to prevent the use of yhe page file by a program? I want to prevent that sensitive data in RAM to be written to page file, for security reasons.
In VC++6 if possible
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
VirtualLock [^]
Pages that a process has locked remain in physical memory until the process unlocks them or terminates. These pages are guaranteed not to be written to the pagefile while they are locked
|
|
|
|
|
Thanks!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
http://www.codeproject.com/KB/IP/SENSNetworkEvents.aspx[^]
When attempting to load this project on x64, the SENS type libary is not available in the COM tab of the References dialog.
SENS.DLL seems to be correctly registered in the registry as a type library but is not recognized in Visual Studio.
The example project is C# but the problem persists in C++ projects too.
It works fine on 32 bit.
Have tested this on several x64 boxes, same result.
Is the Visual Studio builder broken?
|
|
|
|