|
Hello
How about GetMenuItemID, GetMenuString methods of CMenu.
|
|
|
|
|
menu1
...
...
umm, if get menu1, GetMenuString can get? it id is?
|
|
|
|
|
If u want to find id of menu item then try using GetMenuItemID method.
int nPos = FindMenuItem(pMyMenu, _T("MyMenuItem"));
UINT menuItemID = pMyMenu->GetMenuItemID(nPos);
|
|
|
|
|
how can we dump every char in an multiline edit box???
HelpMe
|
|
|
|
|
What does 'dump' mean. Do you want to clear the text box ? Do you want to grab all the text to a string ? What ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Maybe he wants to display one of every character in the full character set in his text box?
Maybe he solved it himself already.
Doesn't look like he's going to tell you, though.
|
|
|
|
|
How do i write text on a bitmap file where only the path of the bitmap file is given?
|
|
|
|
|
If it's a bmp, LoadImage will load it. Otherwise, GDI+ will probably load it. Then you need to select it into a DC, draw text on it and save it again ( which probably means you need GDI+ and will load it into a Graphics object ). I have several articles on gDI+ here, one of them is called 'doodle' - it will show you how to load and save an image, and draw on it. Just change the code to draw text instead.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I cant find the the article... would u mind giving me the link?
Its a bmp but not not necessarily in the resource folder...
|
|
|
|
|
I don't see how you could miss it. I typed 'doodle' in to the search and it was the first hit. You could also click on my name and 'view articles'.
http://www.codeproject.com/vcpp/gdiplus/doodle.asp[^]
The bmp would have to be on disc, not a resource.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
CImage m_Image;
m_Image.Load("d:\\picture.bmp");
in the function OnPaint(event WM_PAINT)
CPaintDC dc(this); // device context for painting
BitBlt(dc.m_hDC,0,0,800,600,hdc,0,0,SRCCOPY);
dc.TextOut(40,40,"test",5);
|
|
|
|
|
Hey, just trying to use a variable to hold multiple values so that I can then send those values back to my originating app. I have three values that I need to store in my variable before I return it.
I am using something like this:
for(d=alldevs; d; d=d->next)
{
if (d->description) {
strcpy(descp,d->description);
//strcpy(dev,descp);
}
}
return dev;
If I uncomment the commented line, I see only the second value, if left as is, I see only the first value, I of course, want all three or as many as there will be --probably no more than three. I am trying to enum the adapters in the system, btw.
Any help is appreciated, as always. If you need more info, please let me know. have a good day and thanks in advance.
EDIT: figured it out --I used strcat instead of strcpy and it works. thanks anyway.
-- modified at 19:37 Sunday 2nd April, 2006
|
|
|
|
|
I need some help getting a edit window to select, copy and paste text.
An article on the subject would be helpful or an example of code.
Thanks
Merlin Vilhauer
|
|
|
|
|
How do you mean ? You have an edit control and you want to select and copy text out of it ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi guys, I have a problem concerning a constructor.
I have a code like this:
CClass *pClass;
pClass = new CClass();
pClass->CClass::CClass( param1, param2 );
CClass has 2 constructors, the first called with new, and the second one has to be called after it.
The VC compiler accepts this syntax, but GCC does not.
What can I do? Redesign won't work, I need it exactly like this!!
Thanks for advice,
Alex
Don't try it, just do it!
|
|
|
|
|
Simply speaking, you can't. I am actually surprised that it compiles with VC++.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
I have to and I know that it works for GCC, too... I just don't know the syntax, that's the problem.
Don't try it, just do it!
|
|
|
|
|
You are not really calling 2 constructors, you are only calling one, then calling an function, which happens to be an overloaded constructor.
Overloading functions is ok, but some compilers will complain if you try overloading a constructor. Perhaps you should create just the one and pass null values to the first call.
I'm curious to know why you need it to be like this?
|
|
|
|
|
CClass *pClass;
pClass = new CClass();
pClass->CClass::CClass( param1, param2 );
What is it you are trying to do here? You are creating a pointer to an object, calling its default constructor which should be
pClass = new CClass; then trying to call it's overloaded constructor. You can only call one of them, calling the second will only initialise a new object. I'm surprised this compiled.
|
|
|
|
|
waldermort wrote: pClass = new CClass();
nop walder, this line is correct.
> using no parameter will always implicitely call the default constructor.
> using parenthesis without parameters will call the same default constructor, but explicitely.
> using some parenthesis with parameters will make the compiler look for the best fitting constructor.
you must know that some constructors can be declared as explicit , and such constructors cannot be called without parenthesis !!!!
|
|
|
|
|
there is no way to re-design it.. i need it exactly as i described!!! i solved the problem using inline assembler now, but it is not the best solution i think. The problem is not the overloaded constructor. the problem is, that the GCC does not want me to call a constructor.
Don't try it, just do it!
|
|
|
|
|
You could try using 'placement new'.
e.g.
new(pClass) CClass(param1, param2);
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Why would you want to do such a thing?
Steve
|
|
|
|
|
|
hi
hope everyone will now be familiar with the environment of new express edition of Visual c++ .
so if any one can help me out with my problem
i have have to make menus, so i need to have coding for "open file" , "Save As", "exit"
if u also explain step by step the procedure of how and where to attach the code.
Thanx
if possible reply on :
aliashar86@yahoo.com
FASTIAN
|
|
|
|