WriteMsgQueue Fails RRS feed

  • Question

  • why writemsgqueue fails with insufficient buffer even the buffer is large enough to hold the data?




    Thanks & Regards Ezhilmani.R
    Thursday, April 8, 2010 11:55 AM

All replies

  • hi,

    can you post more details please, some code snipsets to help us help you :)

    If you find my post helpful, please market as an answer or vote for it.
    Check out the DualTouch SDK for Resistive touchscreens (WM) http://www.windowsphoneme.com/?p=386
    Visit our community, http://www.windowsPhoneME.com
    Friday, April 9, 2010 4:38 PM
  • Hi MANI 007,

    Do you solve the issue, if not, like Adel's suggestion, can you provide some code about the issue?


    Best regards,
    Guang-Ming Bian - MSFT

    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Monday, April 12, 2010 9:18 AM
  • hi,

    apolgise for the delay....here is the code snippet....


    MSGQUEUEOPTIONS myoptions;




    myoptions.dwFlags=MSGQUEUE_ALLOW_BROKEN ;




    DWORD errorval = 0;


    myqueueretval = CreateMsgQueue(TEXT(




    //HANDLE myqueueretval1=0;

    myqueueretval1 = OpenMsgQueue(g_hInst,myqueueretval,&myoptions);




     TCHAR buff[10]= {


    BOOL val = WriteMsgQueue(myqueueretval,buff,INFINITE,6,0);

    DWORD ret = GetLastError();

    Thanks & Regards Ezhilmani.R
    Monday, April 12, 2010 11:22 AM
  • Most likely becuase you you applied the wrong arguments to thze cbDataSize / dwTimeout parameters

    The Signature is defined as:

    BOOL WriteMsgQueue (HANDLE hMsgQ, LPVOID lpBuffer, DWORD cbDataSize, DWORD dwTimeout, DWORD dwFlags);

    So, your code sould look like this:

    BOOL val = WriteMsgQueuev(myqueueretval,buff,6,INFINITE,0);

    MVP Windows Embedded
    Monday, April 19, 2010 5:20 PM