Click here to Skip to main content
15,887,585 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
QuestionAccess Denied Error from OpenStream Pin
Ankush12319-Mar-09 4:49
Ankush12319-Mar-09 4:49 
AnswerRe: Access Denied Error from OpenStream Pin
Jonathan Davies19-Mar-09 7:25
Jonathan Davies19-Mar-09 7:25 
GeneralRe: Access Denied Error from OpenStream Pin
Ankush12319-Mar-09 19:22
Ankush12319-Mar-09 19:22 
GeneralRe: Access Denied Error from OpenStream Pin
Ankush12319-Mar-09 20:10
Ankush12319-Mar-09 20:10 
GeneralRe: Access Denied Error from OpenStream Pin
Jonathan Davies20-Mar-09 1:53
Jonathan Davies20-Mar-09 1:53 
Questionwindow placement and restoration query Pin
Jonathan Davies18-Mar-09 6:19
Jonathan Davies18-Mar-09 6:19 
AnswerRe: window placement and restoration query Pin
Stuart Dootson19-Mar-09 8:08
professionalStuart Dootson19-Mar-09 8:08 
GeneralRe: window placement and restoration query Pin
Jonathan Davies20-Mar-09 5:24
Jonathan Davies20-Mar-09 5:24 
Hi Stuart,

I never thought about passing the WINDOWPLACEMENT in to the CMainFrame prior to calling CreateEx(...). In the handler for WM_CREATE GetClientRect(...) now returns the expected size so I can set splitters etc up fine. Thanks.

Odd behaviour though in the case where the application was either closed from a minimized or maximized state. On restarting, the retrieved prior state is indicated by the WINDOWPLACEMENT.showCmd. When previously minimized or maximized is the case, in between the OnCreate(...) handler exiting and the following call to ShowWindow(...) something changes the WINDOWPLACEMENT.rcNormalPosition information to either the size and position of a minimized or a maximized window respectively. This then means when the User Restores, it 'restores' to exactly the same minimized or maximized size! To the eye the window stays as it was.

I had to work around this by resetting the WINDOWPLACEMENT again after CreateEx returns. I found I also had to call ShowWindow with the retreived showCmd rather than nCmdShow and remove any saved WPF_RESTORETOMAXIMIZED flag.
int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
{
	// Saved WINDOWPLACEMENT is retreived here 

	...
	
	if(WindowPlacement.flags & WPF_RESTORETOMAXIMIZED)
	{
		WindowPlacement.flags &= WPF_SETMINPOSITION;
	}

	CMainFrame wndMain(WindowPlacement);

	wndMain.CreateEx();
	wndMain.SetWindowPlacement(&WindowPlacement);
	wndMain.ShowWindow(WindowPlacement.showCmd);		
	
	...

Why this is necessary I don't know. Anyway it all seems OK now so thanks.
QuestionObject properties - control embedded in web page Pin
AssemblySoft16-Mar-09 6:13
AssemblySoft16-Mar-09 6:13 
AnswerRe: Object properties - control embedded in web page Pin
«_Superman_»16-Mar-09 18:59
professional«_Superman_»16-Mar-09 18:59 
GeneralRe: Object properties - control embedded in web page Pin
AssemblySoft16-Mar-09 22:10
AssemblySoft16-Mar-09 22:10 
GeneralRe: Object properties - control embedded in web page Pin
«_Superman_»17-Mar-09 1:32
professional«_Superman_»17-Mar-09 1:32 
GeneralRe: Object properties - control embedded in web page Pin
AssemblySoft17-Mar-09 4:12
AssemblySoft17-Mar-09 4:12 
GeneralRe: Object properties - control embedded in web page Pin
«_Superman_»17-Mar-09 23:49
professional«_Superman_»17-Mar-09 23:49 
QuestionAdding to CFolderDialogImpl Pin
joboodi313-Mar-09 7:09
joboodi313-Mar-09 7:09 
AnswerRe: Adding to CFolderDialogImpl Pin
Stuart Dootson14-Mar-09 5:04
professionalStuart Dootson14-Mar-09 5:04 
Questionthe question that relate to CreateInstance Pin
weifirst12-Mar-09 21:03
weifirst12-Mar-09 21:03 
AnswerRe: the question that relate to CreateInstance Pin
Stuart Dootson12-Mar-09 22:12
professionalStuart Dootson12-Mar-09 22:12 
Generalthanks. this query is resolves. it is not relate com, it is other question. Pin
weifirst15-Mar-09 21:46
weifirst15-Mar-09 21:46 
QuestionDynamic UUID? Pin
lucyh3h12-Mar-09 7:37
lucyh3h12-Mar-09 7:37 
AnswerRe: Dynamic UUID? Pin
«_Superman_»12-Mar-09 19:56
professional«_Superman_»12-Mar-09 19:56 
QuestionEquivalent for CPtrList in ATL Pin
Elsie9-Mar-09 21:45
Elsie9-Mar-09 21:45 
AnswerRe: Equivalent for CPtrList in ATL Pin
Jonathan Davies10-Mar-09 0:21
Jonathan Davies10-Mar-09 0:21 
GeneralRe: Equivalent for CPtrList in ATL Pin
Elsie10-Mar-09 4:06
Elsie10-Mar-09 4:06 
GeneralRe: Equivalent for CPtrList in ATL Pin
Jonathan Davies10-Mar-09 4:22
Jonathan Davies10-Mar-09 4:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.