Click here to Skip to main content
15,890,438 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Redistributing dependent dlls Pin
Hristo-Bojilov19-Sep-09 9:29
Hristo-Bojilov19-Sep-09 9:29 
QuestionODBC which function can write value into data base Pin
Rafix11118-Sep-09 11:03
Rafix11118-Sep-09 11:03 
QuestionHow to add Items to Windows start menu? Pin
includeh1018-Sep-09 10:01
includeh1018-Sep-09 10:01 
AnswerRe: How to add Items to Windows start menu? Pin
Stuart Dootson18-Sep-09 12:51
professionalStuart Dootson18-Sep-09 12:51 
QuestionMessage Removed Pin
18-Sep-09 5:02
professionalN_tro_P18-Sep-09 5:02 
AnswerRe: CUDA Anyone? Pin
zhao,kaiyong24-Sep-09 9:02
zhao,kaiyong24-Sep-09 9:02 
AnswerRe: CUDA Anyone? Pin
johnthomaswarner19-Feb-10 10:26
johnthomaswarner19-Feb-10 10:26 
QuestionHow to get rid of warning message from Microsoft code Pin
transoft18-Sep-09 4:57
transoft18-Sep-09 4:57 
Hi

Following code is from Microsoft (http://support.microsoft.com/kb/243285[^]).

It compiles OK under "debug" using VS2005. It generated warning message under "release".

while ((DWORD)lpHeader < (DWORD)(((LPSTR)lpStart) + size) && pt != NULL)
;

warning C4311: 'type cast' : pointer truncation from 'LPTTPOLYGONHEADER' to 'DWORD'
warning C4311: 'type cast' : pointer truncation from 'LPSTR' to 'DWORD'


void DrawT2Outline(HDC hDC, LPTTPOLYGONHEADER lpHeader, DWORD size) 
{
    WORD                i;
    UINT                cTotal = 0; // Total points in a contour.
    LPTTPOLYGONHEADER   lpStart;    // the start of the buffer
    LPTTPOLYCURVE       lpCurve;    // the current curve of a contour
    LPPOINT             pt;         // the bezier buffer
    POINTFX             ptStart;    // The starting point of a curve
    DWORD               dwMaxPts = size/size of(POINTFX); // max possible pts.
    DWORD               dwBuffSize;

    dwBuffSize = dwMaxPts *     // Maximum possible # of contour points.
                 sizeof(POINT) * // sizeof buffer element
                 3;             // Worst case multiplier of one additional point
                                // of line expanding to three points of a bezier

   lpStart = lpHeader;
   pt = (LPPOINT)malloc( dwBuffSize );

    // Loop until we have processed the entire buffer of contours.
    // The buffer may contain one or more contours that begin with
    // a TTPOLYGONHEADER. We have them all when we the end of the buffer.
    while ((DWORD)lpHeader < (DWORD)(((LPSTR)lpStart) + size) && pt != NULL)


Best regards,
AnswerRe: How to get rid of warning message from Microsoft code Pin
Richard MacCutchan18-Sep-09 5:21
mveRichard MacCutchan18-Sep-09 5:21 
AnswerRe: How to get rid of warning message from Microsoft code Pin
Michael Dunn18-Sep-09 8:38
sitebuilderMichael Dunn18-Sep-09 8:38 
AnswerRe: How to get rid of warning message from Microsoft code Pin
Richard MacCutchan18-Sep-09 22:17
mveRichard MacCutchan18-Sep-09 22:17 
Questionsome questions about "reference to pointer" Pin
lhyblue18-Sep-09 3:57
lhyblue18-Sep-09 3:57 
AnswerRe: some questions about "reference to pointer" [modified] Pin
«_Superman_»18-Sep-09 4:08
professional«_Superman_»18-Sep-09 4:08 
GeneralRe: some questions about "reference to pointer" Pin
CPallini18-Sep-09 4:17
mveCPallini18-Sep-09 4:17 
GeneralRe: some questions about "reference to pointer" Pin
«_Superman_»18-Sep-09 4:19
professional«_Superman_»18-Sep-09 4:19 
GeneralRe: some questions about "reference to pointer" Pin
lhyblue18-Sep-09 4:44
lhyblue18-Sep-09 4:44 
GeneralRe: some questions about "reference to pointer" Pin
Stuart Dootson18-Sep-09 4:48
professionalStuart Dootson18-Sep-09 4:48 
GeneralRe: some questions about "reference to pointer" Pin
CPallini18-Sep-09 11:14
mveCPallini18-Sep-09 11:14 
GeneralRe: some questions about "reference to pointer" Pin
Stuart Dootson18-Sep-09 12:40
professionalStuart Dootson18-Sep-09 12:40 
GeneralRe: some questions about "reference to pointer" Pin
CPallini18-Sep-09 13:15
mveCPallini18-Sep-09 13:15 
GeneralRe: some questions about "reference to pointer" Pin
Stuart Dootson18-Sep-09 13:28
professionalStuart Dootson18-Sep-09 13:28 
GeneralRe: some questions about "reference to pointer" Pin
CPallini19-Sep-09 0:26
mveCPallini19-Sep-09 0:26 
GeneralRe: some questions about "reference to pointer" Pin
Stuart Dootson19-Sep-09 7:25
professionalStuart Dootson19-Sep-09 7:25 
GeneralRe: some questions about "reference to pointer" Pin
CPallini19-Sep-09 22:06
mveCPallini19-Sep-09 22:06 
GeneralRe: some questions about "reference to pointer" Pin
Stuart Dootson19-Sep-09 22:15
professionalStuart Dootson19-Sep-09 22:15 

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.