|
You can't do that directly. The compiler never sees "IDS_STRING1", only the number that it is #define d as.
You'll need to create a lookup table (using std::map for example) to convert from the string to the numerical equivalent.
--Mike--
"alyson hannigan is so cute it's crazy" -- Googlism
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I feel kind of stupid asking this question, but I couldn't find it at msdn, nor any other webpages. How can I set the drop down height of a comboboxex that is on a dialog? Thanks,
-Ken Mazaika
|
|
|
|
|
Not such a stupid question. You need to get the handle (HWND) of the dropdown list. AFAICR this is only available on one of the WM_CTLCOLORLISTOBX messages. Check the MSDN docs. Once you have the HWND resize as normal.
Note that if you create the dialog manually (ie. m_cmb.Create(...)) then the height specified is the height that will be used for the dropdown list.
HTH
Jerry
|
|
|
|
|
If you're doing this from the dialog editor...
Click on the down-arrow for your combo-box. The size frame with switch modes to show the height of the drop-down.
Brad Bruce
|
|
|
|
|
Exactly what I wanted; Thanks
-Ken Mazaikak
|
|
|
|
|
Hi all,
I just added a dialog box to my project in the resource editor. I also added a button to the dialog. When I right-click the button and select "add event handler", I get the following error message:
"An error has occured in the script on this page:
[...]\Vc7\VCWizards\CommandWiz\HTML\1033\default.htm
Line: 327
Char: 4
Error: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.
Code: 0"
I think the actual code that it is failing on is the JScript that adds the project class names into the event handler wizard.
Any thoughts on what might be causing this?
All the best,
Rewbs.
|
|
|
|
|
still beginning here so beware
how do i create a HMENU from a resourse id so i can set it in a dynamically created dialog during PreCreateWindow()
HMENU gMen = MAKEINTRESOURCE(IDR_STICKY_MENU);
cs.hMenu = gMen;
doesn't work
and i can't find alot in MSDN, or is this a completely bad idea?
i know i'll have to handle the messages myself, that doesn't worry me to much, but then again, could be my next entry...
thanks for any help
shotgun
|
|
|
|
|
|
You have to load the menu using the LoadMenu function.
HMENU gMen = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_STICKY_MENU));
cs.hMenu = gMen;
hInstance is the instance of the app-file which contains the menu resource.
-Dominik
|
|
|
|
|
|
NOTICE: In the following example, I had to use double angle brackets because single angle brackets were not showing up.
If I have the following piece of code, and I were to instantiate 'X' as X<<char*>>
template<<class t="">>
class X
{
...
const T m;
...
};
==============================
it would yield 'm' as
char *const m;
===============================
However, suppose I don't want to end up with 'm' as a constant pointer to a character object, but wanted 'm' to end up as a pointer to a constant object of type character. How would I instantiate 'X'?
NOTE: I DON'T want to declare 'm' as a pointer, e.g.
const T *m;
and then instantiate 'X' as X<<char>>
Thanks.
William
|
|
|
|
|
I'm thinking you want an array:
template<class T, int n>
class X
{
const T m_Array[n];
};
Thus X<char, 32> MyInstance; would give you const char m_Array[32] .
|
|
|
|
|
Hello,
Is there a way to have CListView (report style) draw rows with varying heights (e.g., one row would have one line of text, the next would have 3, etc.)? If not, what would you suggest as the easiest way to make such a control?
Thanks!
JennyP
|
|
|
|
|
I don't know,so i learning……lala,I am China Boy,
nothing
|
|
|
|
|
This is possible but only if you are willing to do the drawing and measuring of the rows yourself. Check out this article[^].
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Hi,
I'm having problems finding a good function to find a temporary folder. I've used GetTempPath() and it returned something along the lines of
C:\Docume~1/Jack/Local~1/Temp
and that's fine but I can't use it because after copying some files into this dir I also have to set a registry key regarding one of the files and it doesn't work right because of the ~ in the name. If someone could help me figure out how to do one of the following I'd appreciate it a lot, I'm getting tired of trying to find a solution to this annoying problem. It only has to work on XP.
1. A way to get the FULL path of a users temp folder without ~
-or-
2. A way to convert a path with ~ to a FULL path without ~
Thanks,
Martin
|
|
|
|
|
Perhaps you should have a look at the function
DWORD GetFullPathName(
LPCTSTR lpFileName,
DWORD nBufferLength,
LPTSTR lpBuffer,
LPTSTR *lpFilePart
);
in MSDN.
-Dominik
|
|
|
|
|
I would suggest that if a ~ is breaking your code, then fix whatever that bug is.
But you can use GetLongPathName() if you're using 98+ or 2000+.
--Mike--
"alyson hannigan is so cute it's crazy" -- Googlism
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
GetLongPathName() only works on 98+.
GetFullPathName() works on 95 too.
So why not using GetFullPathName?
-Dominik
|
|
|
|
|
Dominik Reichl wrote:
So why not using GetFullPathName?
Because GetFullPathName() doesn't do what the original poster wanted to do. From MSDN:GetFullPathName does no conversion of the specified file name, lpFileName. If the specified file name exists, you can use GetLongPathName and GetShortPathName to convert to long and short path names, respectively. So MSDN itself says you have to use other functions to convert between the LFN and SFN names.
--Mike--
"alyson hannigan is so cute it's crazy" -- Googlism
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
|
if i alloc menory (i.e. by new) but forget to free (by delete), are there some tools or functions which can check the problem and info me details( i.e. size, address of memory occupied).
if yes, could they check both before and after my app exits?
checking free memory size is not good enough because it doesn't know if my app causes problem (maybe caused by other programs).
thx
includeh10
|
|
|
|
|
MFC programs seem to have this built-in by using custom new() and delete() functions.
You could do that too.
|
|
|
|
|
i need checking, bot building.
includeh10
|
|
|
|
|