|
You mean to say that it should become resizable after the user clicks the button then handle the wm_size set a boolean flag(On button click) and if its true send the message to the default implementation else discard it.
Regards,
FarPointer
|
|
|
|
|
Yes, the dialog should be resiable, but only during the click on the button. So the user clicks the button and with LBUTTONDOWN resizes the dialog as you do on the margine. When LBUTTONUP, then the dialog is on the final size and no more resizable (of course until the next click on button).
Code like:
LONG lSTYLE = GetWindowLong(m_hWnd, GWL_STYLE);
lSTYLE &= ~WS_THICKFRAME;
lSTYLE |= WS_THICKFRAME;
SetWindowLong(m_hWnd, GWL_STYLE, lSTYLE);
makes a nasty border, and after I reset the region with rounded corner the window do not invalidates the border regions.
I guess I must do something special (what ?) and send WM_SIZE by myself to the window. The button can be also a special region, e.g. where a bitmap is shown. Important: the window must be redrawn from another place than the window border.
THANKS,
Emanuil
-- modified at 1:58 Friday 31st March, 2006
|
|
|
|
|
CStringArray myclass::getStr()
{
CStringArray csa;
csa.Add("str1");
csa.Add("str2");
return csa;
}
I got this error
what to do?
error C2558: class 'CStringArray' : no copy constructor available
How to return two dimensional array?
JAYARAJ
|
|
|
|
|
Rather than returning the value, pass the paramter as a reference.
void myclass::getStr(CStringArray& csa)
{
csa.Add("str1");
csa.Add("str2");
}
|
|
|
|
|
This is my code snippet, and it does not work, since CStringArray does not implement a copy constructor (meaning that this probably fails to compile:
CStringArray csa=getStr();
Do as suggested above, pass the CStringArray as an argument to the function.
~RaGE();
|
|
|
|
|
maybe it is some helpful to you
////h File////////////
CStringArray *a();
CStringArray* CAnswer::a()
{
CStringArray* a;
a=new (CStringArray);
a->Add("123");
a->Add("12");
return a;
}
if you check count then return ->2
CStringArray *b;
b=a();
int cb=b->GetCount();
|
|
|
|
|
Hi,
Works. Yet not a good solution. The caller is supposed to delete the array though it may not do it.
The best choice, I think, is to pass by refernce as a parameter.
--
======
Arman
|
|
|
|
|
yes
It's only a suggestion because we need to delete array
|
|
|
|
|
Hello,
My problem is I want to create child windows of user defined sizes in the MDImainframe window once it shows and show various documents in them, so I required some help regarding how to create a MDI child winodw or get the MDI child window pointer to create it? May be a similar example. Please help.
Software Developer
Sanjay Khapre
-- modified at 1:25 Friday 31st March, 2006
|
|
|
|
|
SanjaySMK wrote: My problem is I want to create child windows of user defined sizes in the mainframe window and show various documents in them, so how to create or get the MDI child window pointer? Please help.
Using GetActiveFrame() get a pointer to the active frame.
Next use GetWindow to traverse through all siblings of the frame window.
Nibu thomas
Software Developer
|
|
|
|
|
Hi,
There are so many gurus here who are doing the VC++, COM, ATL , MFC programming. Could people share the interview questions they faced with these technologies. There are rarely any site which mentions the interview questions for these programming skills. Any link to site if anybody knows.
Thanks,
Lee
|
|
|
|
|
Here is a question to you on C++: Can a class constructor be declared private? If not, explain why. If yes, explain why you would do it.
|
|
|
|
|
For those who don't know, Yes it can! You would use this if you wanted to prevent anybody creating this object with a call to "new". Therefore the object itself must control it's own creation and deletion.
Another question if you are in the gaming industry may be something like:
What is a quaternion, why is it different from Euler and what are the advantages/disadvantages of both?
When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!
|
|
|
|
|
Hi,
I want to have a palette which will have some icons.. (As I click the icon the respective command becomes active.). if I kept the left mouse button pressed, I can see the sub command Icons from which any icon can be selected by moving pressed mouse button.. this sub palette can be dragged (pulled )out too to have sub palette.
Thanks
Lee
|
|
|
|
|
This is not a question. What is it that you want ?
~RaGE();
|
|
|
|
|
I want to know hwo to proceed with it.
Which base classes to be used. How can be the
things combined.
Thank you
lee
|
|
|
|
|
Hi all,
In my MDI application, I've drawn an image as the background in OnEraseBkgnd() function. I'd like to keep the image always in Center. But I'm not able to get the center of the window in OnSize. If anyone could help to come out of this problem, it would be quite helpful for me.
Thanks in advance,
Sarvan AL
|
|
|
|
|
Sarvan AL wrote: In my MDI application, I've drawn an image as the background in OnEraseBkgnd() function. I'd like to keep the image always in Center. But I'm not able to get the center of the window in OnSize. If anyone could help to come out of this problem, it would be quite helpful for me.
Well it's easy.
Take the width of the image.
Take the height of the image.
Now the cx parameter in OnSize will be the width and cy will be the height.
So how will you position the image in the centre?
int midX = (cx-bmpWidth)/2;
int midY = (cy-bmpHeight)/2;
Nibu thomas
Software Developer
|
|
|
|
|
Thanks Nibu,
I've forgotten to call Invalidate() in OnSize().
Thanks once again,
Sarvan AL
|
|
|
|
|
Hi,
I am a total beginner. How do I stop from the black screen which displays the result of execution to automatically dissapear?. It came out in a blink of an eye and then of it goes.
I just want to print out a simple "Hello World" message.
Thanks.
|
|
|
|
|
Hi
I have understood your problem.
If your are creating the console application you would be pressing the F5 button. In this case the windows diaplays the result for your execution but just dissappears. For this you have to press CTL+F5.
Cheers
"Peace of mind through Technology"
|
|
|
|
|
I'm using Dev C++. The command to run is F9
|
|
|
|
|
In case if you don't have any issue in using C functions in C++, then include conio.h and add the following code at the end of function.
cout << "Press any key to exit.";
getch();
|
|
|
|
|
Another solution is to call system("PAUSE");
|
|
|
|
|
Open a command prompt and run your program from there rather than from within the IDE. That is why the window is quickly disapearing.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|