32 bit and 64 bit problem.

This is a discussion on 32 bit and 64 bit problem. within the Windows Programming forums, part of the Platform Specific Boards category; Hello, I'm trying to create a DLL file but I can't compile it to 64 bit's only 32... Code: Code: ...

  1. #1
    Registered User
    Join Date
    Feb 2014
    Posts
    2

    32 bit and 64 bit problem.

    Hello, I'm trying to create a DLL file but I can't compile it to 64 bit's only 32...

    Code:
    Code:
    BOOL FSUIPC_Process(DWORD *pdwResult) {
        DWORD dwError;
    
        while ((++i < 10) && !SendMessageTimeout(m_hWnd, m_msg, m_atom, 0, SMTO_BLOCK, 2000, &dwError)) {    
            Sleep(100);
        }
    This is not the full function but this is where the error is ocurring..
    On the SendMessageTimeout 7th argument there is a DWORD variable and that is working for the 32 bit's but when I swich to 64 bit's this happens:

    Code:
    213	95	H:\Programming\DLL\Dll's\32\IPCuser.c	[Error] cannot convert 'DWORD* {aka long unsigned int*}' to 'PDWORD_PTR {aka long long unsigned int*}' for argument '7' to 'LRESULT SendMessageTimeoutA(HWND, UINT, WPARAM, LPARAM, UINT, UINT, PDWORD_PTR)'
    How can I solve this?

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    2,582
    FYI: This is a Windows problem; NOT C++ problem.

    From this Windows Data Types (Windows)

    I would guess this would be right.

    Code:
    DWORD dwError;
    DWORD_PTR p_dwError = &dwError;
    
    SendMessageTimeout(m_hWnd, m_msg, m_atom, 0, SMTO_BLOCK, 2000, &p_dwError)
    A second possible one is
    Code:
    DWORD_PTR dwError;
    
    SendMessageTimeout(m_hWnd, m_msg, m_atom, 0, SMTO_BLOCK, 2000, &dwError)

    Tim S.
    Last edited by stahta01; 02-15-2014 at 10:49 AM.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the Universe is winning." Rick Cook

  3. #3
    Registered User
    Join Date
    Feb 2014
    Posts
    2
    Thank you very much, DWORD_PTR worked fine!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 02-09-2014, 05:46 PM
  2. Problem passing argument into function, basic problem
    By tsdad in forum C++ Programming
    Replies: 7
    Last Post: 05-22-2013, 12:09 PM
  3. Replies: 2
    Last Post: 01-06-2013, 06:49 AM
  4. Replies: 1
    Last Post: 12-07-2012, 09:00 AM
  5. Replies: 4
    Last Post: 10-16-2008, 07:30 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21