Thread: 32 bit and 64 bit problem.

  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
    4,183
    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 11:49 AM.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  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, 06: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, 07:49 AM
  4. Replies: 1
    Last Post: 12-07-2012, 10:00 AM
  5. Replies: 4
    Last Post: 10-16-2008, 07:30 PM