|
Niklas Lindquist wrote:
The height can be calculated using CDC::GetTextExtent().
or rather use the lfHeight member of the LOGFONT structure. Can be retreived from CFont::GetLogFont() I think.
|
|
|
|
|
Hi,
I insert a resource script into my Win32 Application and create a menu named "menu01", when run the project, no menu appear but an empty window.
What's wrong?
By the way, I want know how to add color and format my codes for better readability.
Best regard.
I confess that I am a stubborn guy, but why not put things thoroughly, logically and systematically clean. One concrete prolem is worth a thousand unapplied abstractions.
|
|
|
|
|
NicholasCougar wrote:
I insert a resource script into my Win32 Application and create a menu named "menu01", when run the project, no menu appear but an empty window.
What's wrong?
If I am not mistaken, you cannot add a menu to the console window through regular application means. It is mainly for stdout and stdin. If you want menus and things like that why don't you create a WIN32 application with the user interface elements. It is also possible to redirect stdout and stdin windows components if this is what you need.
NicholasCougar wrote:
By the way, I want know how to add color and format my codes for better readability.
I am unclear what you are asking here. Do you want your source code in the editor to be syntax highlighted, or the codes in your program window? What editor are you using for your code?
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!
|
|
|
|
|
Please have a look at your post, it's very neaty and readable, for you use small font, hightlight, and italic. In the message box where I currently typing words in, no such this like small font, italic etc. I want use them in my post here for better readability.
Thank you.
Best regard.
I confess that I am a stubborn guy, but why not put things thoroughly, logically and systematically clean. One concrete prolem is worth a thousand unapplied abstractions.
|
|
|
|
|
Use HTML tags when typing your post. Note, not all tags are recognized. Plus, you can use special tags like <pre></pre> to display source code, like this:
int nFoo = 43; /ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
hey, im using boost::RegEx to do regular expression stuff
im trying to get a string like "word...!" to work with the regular expression "\w+", but not include the "...!" in the match... whenenver i try this using
boost::RegEx re("\\w+");
bool b = re.Match("word...!");
it returns false.... how do i get it to return true, but it should tell me where the regex was completed (at the position of the first dot, or character index 4) or the position of the last character part of the match (the 'd')
thanks for the help guys
- Roman -
|
|
|
|
|
Dunno if this will help.. but in PCRE you could do like...
Pcre re("^([^\.]+)");
if (re.search("word...!") == true) {
cout << re.get_match(0) << endl;
}
-Jack
To an optimist the glass is half full.
To a pessimist the glass is half empty.
To a programmer the glass is twice as big as it needs to be.
|
|
|
|
|
well, that kinda helps, but im really looking for a type of thing that will allow me to pump tokens using a regular expression... e.g.:
"int main();"
i want tokens: "int", <space>, "main", (, ), and ;
and using regular expressions to parse each token. the point is, i dont want to have to handle each case, i just need it to parse the string until at some point it doesn't match the regular expression anymore... then that's the beginning of a new token
- Roman -
|
|
|
|
|
I've done something like this to parse lines inbetween \r\n ...
Pcre regex("^[\r\n]*([^\r\n]+)[\r\n]+(.*)$", "s");
while (regex.search(data) == true) {
data = regex.get_match(1);
}
I am sorry if this doesn't help you.
-Jack
To an optimist the glass is half full.
To a pessimist the glass is half empty.
To a programmer the glass is twice as big as it needs to be.
|
|
|
|
|
Is mickeysoft going to ever going to update this thing? I am stuck working somewhere that I am forced to use it -- but it makes me nuts. My boss insists that we branch and merge -- a truly infuriating experience....
HELP!
Are there any decent 3rd party tools that will help with a merge -- merging on a project scale?
Are they ever going to make it into a true client/server application?
P.S. I first thought about posting this rant over in the rant section. But then I looked at what people rant about -- thought i'd get a more coherent answer here.
|
|
|
|
|
Actually, I've used several VC systems over the years and SourceSafe has been by far the best, easiest to use and most stable. Mind you've I've never done all the branching stuff. As for merging, I've done that on a per file basis when using multiple checkouts, and it was great. I was paranoid about it at first but learned to trust it.
It sounds like a better solution would be to sic an attack Chihuahua on your boss and gnaw some sense into him...
Chistopher Duncan
Author - The Career Programmer: Guerilla Tactics for an Imperfect World (Apress)
|
|
|
|
|
Can anyone tell me if there is a known reason for this behaviour, or am I doing something really strange.
I am populating the first level of a tree structure and setting the children to 1 to get the + button but not adding any child entries.
When I click on the + against the 3rd item the first TVN_ITEMEXPANDING is against the 3rd item.
Immediately the focus then goes to the 1st item, without me doing anything. The TVN_SELCHANGING refers to the 1st item as does the next TVN_ITEMEXPANDING.
This is very confusing and not desirable.
If instead I click on the item, rather than the + all appears to process as expected.
Any guidance would be very welcome
Sara
|
|
|
|
|
This does sound odd to me... Does the focus change happen even if you do not handle TVN_ITEMEXPANDING ?
--------
I'm not sick, but i'm not well
And i'm so hot, 'cause i'm in hell... Harvey Danger, Flagpole Sitta
|
|
|
|
|
I can remove all event handling from my code and it still behaves exactly the same. As soon as I click on the + against the 3rd item the 1st item is highlighted.
Sara
|
|
|
|
|
Could this be your problem:
You start your app. The tree ctrl has not the focus. You click on + (on 3:rd item). Tree ctrl gets focus.
Clicking outside an items label doesn't change the selection. The first item was the one selected all the time?
Try setting the style TVS_SHOWSELALWAYS to your tree ctrl. Is the first item selected before you do any mouse clicking?
|
|
|
|
|
Thanks for the suggestions.
This is being used as an alternative look-up method so whilst it is populated at the top level it does not automatically get the focus during program initialisation. Therefore although I had the TVS_SHOWSELALWAYS style it did not show anything initially.
I have found a work-around.
If I check the OldItem in the LPNMTREEVIEW structure returned from the WM_NOTIFY I can send a m_TreeWindow.Select(hItem, TVGN_CARET) message.
I have not found anything within MFC to give me the OldItem so am needing to interact directly with the LPNMTREEVIEW and TVITEM structures.
Sara
|
|
|
|
|
Does anyone know how to export visual studio settings (Keyboard mappings etc.)so that the same settings may be used on another system? Thanks In advance.
|
|
|
|
|
Look at:
HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0
I don't import/export it all, but only such keys, like: Keyboard, Format, etc.
|
|
|
|
|
Hi All,
I've got a workspace style app that's got a tree-view control bar used for getting around in the app. I need to know how to determine if this control bar is currently visible or not.
How do I do this?
Thanks,
Aaron
|
|
|
|
|
IsVisible() should work i think.
--------
I'm not sick, but i'm not well
And i'm so hot, 'cause i'm in hell... Harvey Danger, Flagpole Sitta
|
|
|
|
|
|
Hey Guys
I have a FormView class and have set up an OnSize function. When i try and use any function on one of teh objects on the form under thsi function the software throws up an error when you start it up. Does anyone know what i am doing wrong
Peter
|
|
|
|
|
Are you checking ::IsWindow(someobjecthandle) before calling the function? OnSize can get called before child windows are created.
|
|
|
|
|
No What exactly do i need to check here then whether the window i am trying to reziz has been created?
Peter
|
|
|
|
|
Usually I do something like this
if (::IsWindow(m_wndEditControl.m_hWnd))
{
bla.bla.bla.
}
OR
if (GetDlgItem(IDC_SOMECONTROL) && ::IsWindow(GetDlgItem(IDC_SOMECONTROL)->GetSafeHwnd()))
{
bla.bla.bla.
}
|
|
|
|