Click here to Skip to main content
15,913,854 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Visual Studio Bug ???? Pin
Shay Harel28-Dec-05 7:05
Shay Harel28-Dec-05 7:05 
QuestionDatabinding inside User Controls. Pin
Gustyn27-Dec-05 9:49
Gustyn27-Dec-05 9:49 
QuestionVC++ and DLL's Pin
braveheartkenya27-Dec-05 9:10
braveheartkenya27-Dec-05 9:10 
Questionprinting the call stack in c++ Pin
stephen.hazel27-Dec-05 8:26
stephen.hazel27-Dec-05 8:26 
AnswerRe: printing the call stack in c++ Pin
stephen.hazel27-Dec-05 9:21
stephen.hazel27-Dec-05 9:21 
AnswerRe: printing the call stack in c++ Pin
Taka Muraoka27-Dec-05 15:29
Taka Muraoka27-Dec-05 15:29 
GeneralRe: printing the call stack in c++ Pin
stephen.hazel27-Dec-05 19:04
stephen.hazel27-Dec-05 19:04 
GeneralMFC error in MoveWindow and Create with large int Pin
ChrisLang27-Dec-05 6:02
ChrisLang27-Dec-05 6:02 
This is to document a solution with CWnd::MoveWindow and CWnd::Create when you have to position your window at a point larger than 32768 in the parent view.

A little background first:
I was trying to position my CmyView objects in a CScrollView object and everything worked as expected up until the point that the vertical location of the new CmyView object was going to be larger than 32768. At this point all the rest of the CmyView objects were being placed on top of themselves. The first 1800 or so CmyViews were placed in the CSrollview correctly but the last 1800 were just drawing on top of each other.

After at least 3 days of trying to figure out what I was doing wrong I came to the conclusion that the MS code is wrong. I can trace the calls through ::CreateEx, ::MoveWindow but I not no nothing about debugging assembled code so that is as far as I could trace it. If you tell the window to move to a vertical position of say 40,000, this is passed all the way through what I can follow in the code through CWnd::MoveWindow. But if you get the position of the window as the next call (and adjust it for screen coordinates) you find that the actual moveWindow call didn't place the window correctly.

At first I thought it was because all the calls use int as the "lowest" level type, but even an int can be larger than 32768.

Workaround:
I had to create a "Holder view" and place that in the CSrollView prior to placing all the CmyView objects into the CHolderView. BUT (this is the important part) the CWnd::Create call to create the Holder (which is a CWnd object) has to be large enough to hold all the CmyView object INITIALLY! If you try to resize it with MoveWindow it also fails to resize correctly.

Workaround:
I had to create a "Holder view" and place that in the CSrollView prior to placing all the CmyView objects into the CHolderView. BUT (this is the important part) the CWnd::Create call to create the Holder (which is a CWnd object) has to be large enough to hold all the CmyView object INITIALLY! If you try to resize it with MoveWindow it also fails to resize correctly.

Chris
GeneralRe: MFC error in MoveWindow and Create with large int Pin
toxcct27-Dec-05 6:14
toxcct27-Dec-05 6:14 
GeneralRe: MFC error in MoveWindow and Create with large int Pin
PJ Arends27-Dec-05 9:21
professionalPJ Arends27-Dec-05 9:21 
QuestionDDX/DDV and VC 7.0 Pin
Imtiaz Murtaza27-Dec-05 5:21
Imtiaz Murtaza27-Dec-05 5:21 
QuestionOpening a process using ShellExecuteEx Pin
Chintoo72327-Dec-05 5:17
Chintoo72327-Dec-05 5:17 
AnswerRe: Opening a process using ShellExecuteEx Pin
ChrisLang27-Dec-05 6:18
ChrisLang27-Dec-05 6:18 
GeneralRe: Opening a process using ShellExecuteEx Pin
Chintoo72327-Dec-05 16:55
Chintoo72327-Dec-05 16:55 
AnswerRe: Opening a process using ShellExecuteEx Pin
Owner drawn27-Dec-05 17:34
Owner drawn27-Dec-05 17:34 
AnswerRe: Opening a process using ShellExecuteEx Pin
Jack Puppy27-Dec-05 17:35
Jack Puppy27-Dec-05 17:35 
QuestionRounding problem Pin
wito27-Dec-05 3:45
wito27-Dec-05 3:45 
AnswerRe: Rounding problem Pin
Maximilien27-Dec-05 4:15
Maximilien27-Dec-05 4:15 
AnswerRe: Rounding problem Pin
ChrisLang27-Dec-05 6:12
ChrisLang27-Dec-05 6:12 
AnswerRe: Rounding problem Pin
Branislav27-Dec-05 11:50
Branislav27-Dec-05 11:50 
GeneralRe: Rounding problem Pin
wito31-Dec-05 3:06
wito31-Dec-05 3:06 
QuestionDilemma..VC++ ..Right choice??? Pin
Ankush Mehta27-Dec-05 1:09
Ankush Mehta27-Dec-05 1:09 
AnswerRe: Dilemma..VC++ ..Right choice??? Pin
toxcct27-Dec-05 1:32
toxcct27-Dec-05 1:32 
AnswerRe: Dilemma..VC++ ..Right choice??? Pin
vikas amin27-Dec-05 1:35
vikas amin27-Dec-05 1:35 
AnswerRe: Dilemma..VC++ ..Right choice??? Pin
ThatsAlok27-Dec-05 1:49
ThatsAlok27-Dec-05 1:49 

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.