Click here to Skip to main content
15,891,704 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Free fails with Access violation reading location Pin
User 5924124-Mar-14 15:17
User 5924124-Mar-14 15:17 
AnswerRe: Free fails with Access violation reading location Pin
tejaswini_g24-Mar-14 15:39
tejaswini_g24-Mar-14 15:39 
AnswerRe: Free fails with Access violation reading location Pin
User 5924124-Mar-14 16:01
User 5924124-Mar-14 16:01 
GeneralRe: Free fails with Access violation reading location Pin
tejaswini_g24-Mar-14 16:11
tejaswini_g24-Mar-14 16:11 
QuestionHow do you define flags? Pin
Dusan Paulovic24-Mar-14 9:48
Dusan Paulovic24-Mar-14 9:48 
AnswerRe: How do you define flags? Pin
Richard MacCutchan24-Mar-14 11:11
mveRichard MacCutchan24-Mar-14 11:11 
AnswerRe: How do you define flags? Pin
Albert Holguin25-Mar-14 4:48
professionalAlbert Holguin25-Mar-14 4:48 
QuestionHow do I using WH_CALLWNDPROC and PT_TOUCH to get the global touch event Pin
cedricvictor24-Mar-14 3:48
cedricvictor24-Mar-14 3:48 
Dear all:

I try to use WH_CALLWNDPROC and PT_TOUCH in dll to get the global touch event. But I get some problems. My code lists as below:

C++
#pragma data_seg (".SHARED")
    HHOOK g_hPreviousMouseHook = 0;
    HINSTANCE g_hInstance = 0;
#pragma data_seg()
#pragma comment(linker, "/SECTION:.SHARED,RWS")

BOOL CSoundDllApp::InitInstance()
{
    CWinApp::InitInstance();
    g_hInstance = AfxGetInstanceHandle();
    return TRUE;
}

BOOL InstallWinHook()
{
    BOOL bReturn = TRUE;
    g_hPreviousMouseHook = SetWindowsHookEx(WH_CALLWNDPROC, 
                             &WinHookProcedure, g_hInstance, 0);

    if(NULL == g_hPreviousMouseHook)
    {
        bReturn = FALSE;
    }
    return bReturn;
}

BOOL UnInstallWinHook()
{
    BOOL bReturn = TRUE;
    if(UnhookWindowsHookEx(g_hPreviousMouseHook) == FALSE)
    {
        bReturn = FALSE;
    }
    return bReturn;
}




LRESULT CALLBACK WinHookProcedure(int nCode, WPARAM wParam, LPARAM lParam)
{
    if(0 > nCode)
        return CallNextHookEx(g_hPreviousMouseHook, nCode, 
                                         wParam, lParam);
    UINT32 pointerId = GET_POINTERID_WPARAM(wParam);  
    POINTER_INPUT_TYPE pointerType;  
    
    if(GetPointerType(pointerId, &pointerType))  
    {
    //if (pointerType == PT_TOUCH)   
    //{  
    //}  
    }
    return CallNextHookEx(g_hPreviousMouseHook, nCode, wParam,   
                                                 lParam);
}


When I disable the GetPointerType(pointerId, &pointerType) in

WinHookProcedure, it will load the dll success. When I enable the

GetPointerType(pointerId, &pointerType) in WinHookProcedure, it

will load the dll failed. what happened? Could someone tell me

please?



Thanks for your help, Victor
Questionvisual studio 6.0 Enterprise edition License Pin
KrishnaRayalu_Talisetti24-Mar-14 0:47
KrishnaRayalu_Talisetti24-Mar-14 0:47 
AnswerRe: visual studio 6.0 Enterprise edition License Pin
Jochen Arndt24-Mar-14 1:02
professionalJochen Arndt24-Mar-14 1:02 
AnswerRe: visual studio 6.0 Enterprise edition License Pin
David Crow24-Mar-14 4:51
David Crow24-Mar-14 4:51 
QuestionBuilding / compiling DirectShow "empty DLL". Pin
Vaclav_23-Mar-14 5:51
Vaclav_23-Mar-14 5:51 
SuggestionRe: Building / compiling DirectShow "empty DLL". Pin
Richard MacCutchan23-Mar-14 22:59
mveRichard MacCutchan23-Mar-14 22:59 
QuestionWin CE program, SetFong() not work Pin
econy21-Mar-14 7:21
econy21-Mar-14 7:21 
AnswerRe: Win CE program, SetFong() not work Pin
Rage25-Mar-14 2:15
professionalRage25-Mar-14 2:15 
AnswerRe: Win CE program, SetFong() not work Pin
Rage25-Mar-14 2:17
professionalRage25-Mar-14 2:17 
GeneralRe: Win CE program, SetFong() not work Pin
econy25-Mar-14 3:32
econy25-Mar-14 3:32 
QuestionWidth of dropdown list window Pin
bokideclan21-Mar-14 2:33
bokideclan21-Mar-14 2:33 
QuestionVery weird change font problem Pin
econy20-Mar-14 8:18
econy20-Mar-14 8:18 
QuestionRe: Very weird change font problem Pin
Randor 20-Mar-14 8:43
professional Randor 20-Mar-14 8:43 
AnswerRe: Very weird change font problem Pin
econy20-Mar-14 9:00
econy20-Mar-14 9:00 
AnswerRe: Very weird change font problem Pin
Randor 20-Mar-14 10:22
professional Randor 20-Mar-14 10:22 
GeneralRe: Very weird change font problem Pin
econy20-Mar-14 10:33
econy20-Mar-14 10:33 
AnswerRe: Very weird change font problem Pin
Randor 20-Mar-14 10:51
professional Randor 20-Mar-14 10:51 
GeneralRe: Very weird change font problem Pin
econy20-Mar-14 13:20
econy20-Mar-14 13:20 

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.