Click here to Skip to main content
16,015,072 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CException Pin
Martin Ziacek27-May-02 5:46
Martin Ziacek27-May-02 5:46 
GeneralRe: CException Pin
Alexandru Savescu27-May-02 8:10
Alexandru Savescu27-May-02 8:10 
Questionhow can i create two menu handles in the menubar? Pin
27-May-02 4:05
suss27-May-02 4:05 
GeneralCaption of SDI application Pin
David Liska27-May-02 4:01
David Liska27-May-02 4:01 
GeneralRe: Caption of SDI application Pin
Mazdak27-May-02 4:31
Mazdak27-May-02 4:31 
GeneralRe: Caption of SDI application Pin
Jay Beckert27-May-02 4:49
Jay Beckert27-May-02 4:49 
GeneralRe: Caption of SDI application Pin
Jay Beckert27-May-02 4:46
Jay Beckert27-May-02 4:46 
GeneralCompiler warnings from GetWindowLongPtr / SetWindowLongPtr Pin
Steve Thresher27-May-02 2:59
Steve Thresher27-May-02 2:59 
#include <windows.h>

int WINAPI WinMain(HINSTANCE hInst,
                   HINSTANCE hPrevInst,
                   LPSTR szCmdLine,
                   int nCmdShow)
{
    HWND hWnd;
    WNDPROC WndProc;


    (VOID)hPrevInst;
    (VOID)szCmdLine;
    (VOID)nCmdShow;

	
    hWnd=CreateWindowEx(0,"EDIT","Test",WS_POPUP | WS_BORDER | WS_VISIBLE,
		        CW_USEDEFAULT,CW_USEDEFAULT,
                        CW_USEDEFAULT,CW_USEDEFAULT,
                        NULL,(HMENU)NULL,hInst,NULL);
    if (hWnd)
    {
        WndProc=(WNDPROC)GetWindowLongPtr(hWnd,GWLP_WNDPROC);
	SetWindowLongPtr(hWnd,GWLP_WNDPROC,(LONG_PTR)WndProc);
    }

    DestroyWindow(hWnd);
}



I have been updating some old code to allow for 64bit compatibilty I followed an article on MSDN which explained the correct way to convert from GetWindowLong() to GetWindowLongPtr() but I am getting the following compiler warnings.

GetWindowLongPtr - c:\temp\test\test.c(18) : warning C4312: 'type cast' : conversion from 'LONG' to 'WNDPROC' of greater size

SetWindowLongPtr - c:\temp\test\test.c(19) : warning C4244: 'function' : conversion from 'LONG_PTR' to 'LONG', possible loss of data

Can anybody please help me out?

Steve.

Systems AXIS Ltd - Software for Business ...
GeneralRe: Compiler warnings from GetWindowLongPtr / SetWindowLongPtr Pin
Mike Nordell27-May-02 21:11
Mike Nordell27-May-02 21:11 
GeneralGet The Slider ID in a form Pin
tongc27-May-02 2:14
tongc27-May-02 2:14 
GeneralRe: Get The Slider ID in a form Pin
Mazdak27-May-02 2:29
Mazdak27-May-02 2:29 
GeneralRe: Get The Slider ID in a form Pin
tongc27-May-02 2:42
tongc27-May-02 2:42 
GeneralRe: Get The Slider ID in a form Pin
Mazdak27-May-02 3:45
Mazdak27-May-02 3:45 
GeneralDCOM Security question !Plz Pin
jancsi27-May-02 2:09
jancsi27-May-02 2:09 
GeneralIErrorInfo Pin
Spiros27-May-02 1:57
Spiros27-May-02 1:57 
GeneralRe: IErrorInfo Pin
Le centriste27-May-02 3:32
Le centriste27-May-02 3:32 
GeneralRe: IErrorInfo Pin
Spiros27-May-02 3:39
Spiros27-May-02 3:39 
GeneralRe: IErrorInfo Pin
Le centriste27-May-02 7:18
Le centriste27-May-02 7:18 
GeneralRe: IErrorInfo Pin
27-May-02 22:31
suss27-May-02 22:31 
GeneralEmbed - Assembly VC++ Pin
Sameer Maggon27-May-02 0:58
Sameer Maggon27-May-02 0:58 
GeneralRe: Embed - Assembly VC++ Pin
Joaquín M López Muñoz27-May-02 2:41
Joaquín M López Muñoz27-May-02 2:41 
GeneralRe: Embed - Assembly VC++ Pin
Sameer Maggon27-May-02 3:10
Sameer Maggon27-May-02 3:10 
GeneralCArchive - query Pin
Ravi Sudhakar27-May-02 0:46
Ravi Sudhakar27-May-02 0:46 
GeneralRe: CArchive - query Pin
Dominik Reichl27-May-02 1:06
Dominik Reichl27-May-02 1:06 
GeneralRe: CArchive - query Pin
Ravi Sudhakar27-May-02 1:24
Ravi Sudhakar27-May-02 1:24 

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.