|
Have you seen the CreateWindow() function. If, for example, you wanted to create an edit control, you'd have something like:
CreateWindow("Edit", ..., hWndParent, ...); I think the second parameter is WS_POPUP | WS_VISIBLE but can't be for sure without trying it out.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Yeah, I have tried that but the window already exists and contains controls, I just need it to become part of a parent window.
|
|
|
|
|
__makaveli__ wrote:
I just need it to become part of a parent window.
Would SetParent() help?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
It may well do! Don't know how I missed that, I would have to set the child to "overlapped" to make it draw within right?
|
|
|
|
|
Thanks for the suggestions! After some messing about, it worked like a charm!
|
|
|
|
|
Hi guys.
I don't know if this is the best place for this post.
If not, please redirect me.
I need a design suggestion.
I have to solve a problem consistent in:
8 balls and 8 boxes. Boxes and balls have diferent sizes.
I have to know if I can put each ball inside one of the boxes.
Evidently the balls must fit inside the boxes.
The problem has solution only when each ball fit inside a box.
I solved this problem using backtracking and works fine.
My question is: there is a fast way to do this than with backtracking?
I need the fastest solution.
Thanks in forwarding.
Doc
|
|
|
|
|
make a ball class, make a box class. define an overloaded operator for comparing sizes, probably based on the box's height and the ball's diameter. sort both arrays (or vectors). they should be matched up at that point.
My articles
www.stillwaterexpress.com
BlackDice
|
|
|
|
|
BlackDice wrote:
sort both arrays (or vectors)
Ensure you sort them in the same way, say smallest first. Sorry, could not resist!
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Hi ,
1:I want to create a full duplex network program.
2:what is the best way to create a network program ? more powerful
than CSocket?
Best Wishes,
Thanks.
|
|
|
|
|
I recommend reading this[^] article. It's well written, and includes an easy-to-use communication framework and a full-duplex chat client-server app.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I have a wizard derived from propertysheet. It is a modal dialog which is invoked using DoModal(). Immediately after the wizard is displayed, I want to popup a dialog. But i'm not able to track the exact point after the wizard is shown. In which method of the wizard can i do this ???
Thanx for ur help.
|
|
|
|
|
Try doing in the OnInitDialog of your wizard.
|
|
|
|
|
At the end of the sheet's OnInitDialog() method, you'll need to post a user-defined message. In the handler of that message, instantiate the other dialog and call its DoModal() method. You cannot do the latter directly from the sheet's OnInitDialog() method.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
If you use a modeless dialog box you can create it and show it within the OnInitDialog method of the wizard.
Basic idea
1) Create dialog
2) Call ShowWindow for the wizard (Ensures that the wizard is shown)
3) Call ShowWindow for the dialog (Shows the modeless dialog)
before returning from the OnInitDialog of the wizard.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Thanx for all ur responses. Its working now !!!
I tried first to post a user defined message from the sheet's InitDialog. But that did not work as expected. Then i tried the same from the InitDialog of the property page. And it worked just as required.
Thanx again.
|
|
|
|
|
I have a 4-page document to print out. The first 3-pages are
printed in landscape. This I can do.
The last page needs to be printed in portrait. After the first
3-pages are printed, how can I change the orientation to portrait
without prompting the user to print again and this time select
portrait.
I use this code to switch to landscape:
BOOL CFormOptions::SetLandscape(CPrintInfo* pInfo)
{
tagPDA pPrintDlg;
AfxGetApp()->GetPrinterDeviceDefaults (&pPrintDlg);
pInfo->m_pPD->m_pd.hDevMode = pPrintDlg.hDevMode;
LPDEVMODE devMode = pInfo->m_pPD->GetDevMode();
if (devMode)
{
// devMode->dmPaperSize = DMPAPER_LEGAL;
devMode->dmPaperSize = DMPAPER_LETTER;
devMode->dmOrientation = DMORIENT_LANDSCAPE;
GlobalUnlock(devMode);
}
return DoPreparePrinting(pInfo);
}
and I call a similar function with DMORIENT_PORTRAIT just before
I print the 4th page, but it still prints in LANDSCAPE. Any idea
on how to change the orientation during the print process for just
that last page?
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
|
From where are you calling this function? Based on the fact that you are returning DoPreparePrinting() I will say you are calling it from OnPreparePrinting() . According to this MSDN page[^] you should be setting the page orientation in OnPrepareDC .
In OnPrepareDC you would update your DEVMODE structure as you have done, then call CDC::ResetDC with the updated DEVMODE to change the orientation.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
The secret is that you need to call pDC->ResetDC(&sNewDevModeStruct) after you call pDC->EndPage() for page 3 and prior to calling pDC->StartPage() for page 4.
ResetDC is the magic behind print jobs that have pages that are 1) different orientations 2) sourced from different paper bins 3) different paper sizes.
See MSDN for more info.
onwards and upwards...
|
|
|
|
|
is it possible to have a 256 color bitmaps in c++ resource?
includeh10
|
|
|
|
|
|
Use the import functionality to add them into the resource.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
|
I am using visual C++ .net
I want to try out a simple program by adding a close button on a dialog
what should I type on the
void TryDlg::OnBnClickedButton1()
{
}
Thanks
|
|
|
|
|
Take a look at EndDialog.
Or calling OnOk() or OnCancel() works also but DoModal will return IDOK or IDCANCEL then.
|
|
|
|
|
Thanks
OnCancel works well for the program
|
|
|
|