"The length of the name may be greater than MAX_COMPUTERNAME_LENGTH
characters because DNS allows longer names. To ensure that this buffer
is large enough, set this parameter to NULL and use the required buffer
size returned in the lpnSize parameter."
As many others have mentioned, that's the proper way to use the API.
that is a good qusestion.. i can certainly use C++. but its just the curiosity to know how it can be done. i actually saw in a forum that inheritance can be acheived in c but there was no practical example available in the forum, there was only some explanations that was not satisfactory. so wanted to know more about it . if you could provide that would be great.
Just read this - Object Oriented Programming in C[^]. Implementing OOP behavior in C is not tough because cfront - the first C++ compiler does compilation by translating C++ source to C and then compile it. If you are insterested, have a look at the cfront source from here[^].
Hi, I've created an owner draw Menu and i wanted to get the text and the shortcut key seperately. Any idea??
By calling below code, it will get both text and shortcut key and put inside a string.
COwnerMenu OwnerMenu; //this is inherit from CMenu
OwnerMenuPointer->GetMenuString(i, str, MF_BYPOSITION);
I tried to seperate it by searching "Ctrl+"
But as the shortcut key might not started with Ctrl+, so i cant use this method..
Can i get the shortcut key and also the text seperately by using the pointer "OwnerMenuPointer" ??
I've search through net and I cant find any solution
Any help would be appreciated.
How are you defining the menu items? Usually, you define a shortcut key for a menu item using \t and Windows displays the shortcut on the right hand side of the menu. For example, in the resource editor, you would define New as New\tCtrl+N
I helped the author add code to parse the accelerotor table to get the short cut keys, cutting out the need to write them in the menu initially. This also lets you have changeable keys in your software.
And it's a super article before I put my nose in...