Topic
  • 8 replies
  • Latest Post - ‏2006-11-17T12:58:23Z by SystemAdmin
SystemAdmin
SystemAdmin
684 Posts

Pinned topic MQ Libraries for Compact Framework 2.0

‏2006-11-13T08:40:22Z |
We have an application running on Windows Mobile 2003 / Windows Mobile 2005 with Compact Framework 1.0, but when we change it to use Compact Framework 2.0, application crashes without exception.

We are using Websphere MQ Everyplace 2.0.2.1.

¿Is there any known bug with CF 2.0?

Thanks
Updated on 2006-11-17T12:58:23Z at 2006-11-17T12:58:23Z by SystemAdmin
  • neekrish
    neekrish
    13 Posts

    Re: MQe Libraries for Compact Framework 2.0

    ‏2006-11-14T12:26:25Z  
    Hi,
    You must be using Platform invocation Services for accessing the MQe C Dlls. CF2 has put strict rules on parameter types passed to the C Dlls. If the C function requires a 64bit integer you must use an appropriate 64 bit data type in your .net code.
    Please review your code and match up the data types. For example if MQEINT64 is required as a parameter you will need to pass a Int64 data type only. If you pass Int32 data type the application will fail.

    Regards,
    Neeraj Krishna
  • SystemAdmin
    SystemAdmin
    684 Posts

    Re: MQe Libraries for Compact Framework 2.0

    ‏2006-11-14T18:30:18Z  
    • neekrish
    • ‏2006-11-14T12:26:25Z
    Hi,
    You must be using Platform invocation Services for accessing the MQe C Dlls. CF2 has put strict rules on parameter types passed to the C Dlls. If the C function requires a 64bit integer you must use an appropriate 64 bit data type in your .net code.
    Please review your code and match up the data types. For example if MQEINT64 is required as a parameter you will need to pass a Int64 data type only. If you pass Int32 data type the application will fail.

    Regards,
    Neeraj Krishna
    Thank you for your answer.

    We have made more test and in windows mobile 2005 doesn't work with cf 1.1 either.

    We made test for the params passed to native code, and seems good, we think the problem is in the arrays passed by reference (we used this array to retrieve the mq message).

    The imports we use in our .net code is this:
    public static unsafe extern int getMessage(ref int reasson,byte] msg,ref int msglen,string localQM,string remoteQM,string remoteQ, byte[ correlid,string password);

    The parameters expected in native code are this:
    DLLNATIVA_API int getMessage(int *reasson, byte *msg,int *lenght,LPWSTR localQM,LPWSTR remoteQM,LPWSTR remoteQ, MQECHAR16 *correlid,LPWSTR password)

    if we don't call the getMessage function the appliccation seems to work ok (We use other native functions like putMessage) and works like a charm.

    the import we use for putMessage is this:
    public static extern int putMessage(ref int reasson,byte[] msg,int lenght,string localQM,string remoteQM,string remoteQ,string userid,string appname,string correlid,string password);

    The Native code function header is this:
    DLLNATIVA_API int putMessage(int *reasson,byte *msg,int lenght,LPWSTR localQM,LPWSTR remoteQM,LPWSTR remoteQ,LPWSTR userid,LPWSTR appname,LPWSTR correlid,LPWSTR password)

    In the other hand the MQ Libraries that we have are compiled for Windows mobile 2002 and 2003 but no for 2005, so this could be causing problems too.

    Thanks a lot.
  • neekrish
    neekrish
    13 Posts

    Re: MQe Libraries for Compact Framework 2.0

    ‏2006-11-15T15:22:27Z  
    Thank you for your answer.

    We have made more test and in windows mobile 2005 doesn't work with cf 1.1 either.

    We made test for the params passed to native code, and seems good, we think the problem is in the arrays passed by reference (we used this array to retrieve the mq message).

    The imports we use in our .net code is this:
    public static unsafe extern int getMessage(ref int reasson,byte] msg,ref int msglen,string localQM,string remoteQM,string remoteQ, byte[ correlid,string password);

    The parameters expected in native code are this:
    DLLNATIVA_API int getMessage(int *reasson, byte *msg,int *lenght,LPWSTR localQM,LPWSTR remoteQM,LPWSTR remoteQ, MQECHAR16 *correlid,LPWSTR password)

    if we don't call the getMessage function the appliccation seems to work ok (We use other native functions like putMessage) and works like a charm.

    the import we use for putMessage is this:
    public static extern int putMessage(ref int reasson,byte[] msg,int lenght,string localQM,string remoteQM,string remoteQ,string userid,string appname,string correlid,string password);

    The Native code function header is this:
    DLLNATIVA_API int putMessage(int *reasson,byte *msg,int lenght,LPWSTR localQM,LPWSTR remoteQM,LPWSTR remoteQ,LPWSTR userid,LPWSTR appname,LPWSTR correlid,LPWSTR password)

    In the other hand the MQ Libraries that we have are compiled for Windows mobile 2002 and 2003 but no for 2005, so this could be causing problems too.

    Thanks a lot.
    Hi,
    The info you have provided is not giving much insight on the problem.
    The API calls given by you are does'nt exactly match with MQe C API.
    Are you using any more wrappers between MQe C DLLs and your application? If yes, please verify whether that the parameter types to the MQe API calls are not deviating.

    Regards,
    Neeraj Krishna
  • SystemAdmin
    SystemAdmin
    684 Posts

    Re: MQe Libraries for Compact Framework 2.0

    ‏2006-11-15T17:22:18Z  
    • neekrish
    • ‏2006-11-15T15:22:27Z
    Hi,
    The info you have provided is not giving much insight on the problem.
    The API calls given by you are does'nt exactly match with MQe C API.
    Are you using any more wrappers between MQe C DLLs and your application? If yes, please verify whether that the parameter types to the MQe API calls are not deviating.

    Regards,
    Neeraj Krishna
    Hi Neeraj,

    you were right. I forgot the wrapper we are using to call the API. I'm sending the source code to you. It may content some mistakes that causes a fail in CF 2 or in Mobile 5. Application gets hang or it crashes randomly.

    Now I'm taking a look to the code attached to the article you and Himanshu Pathak wrote in fifth July. Had it be tested in a pocket with CF 2 and Mobile 5?

    Thanks for your attention.
    Greetings.

    Attachments

    Updated on 2006-11-15T17:22:18Z at 2006-11-15T17:22:18Z by SystemAdmin
  • neekrish
    neekrish
    13 Posts

    Re: MQe Libraries for Compact Framework 2.0

    ‏2006-11-17T03:00:02Z  
    Hi Neeraj,

    you were right. I forgot the wrapper we are using to call the API. I'm sending the source code to you. It may content some mistakes that causes a fail in CF 2 or in Mobile 5. Application gets hang or it crashes randomly.

    Now I'm taking a look to the code attached to the article you and Himanshu Pathak wrote in fifth July. Had it be tested in a pocket with CF 2 and Mobile 5?

    Thanks for your attention.
    Greetings.
    Hi,
    MQe provides C-Dlls and has no depedency on .NET libraries.
    The support for Windows Mobile 5 was added from MQe v2.0.2.4.
    You can find MQe C-Dlls compiled for Windows Mobile 5 Platform from this version.

    I guess you are using MQe v2.0.2.1. Suggest you to upgrade to the latest available MQe build (v2.0.2.8).

    The Code in the Article is not a .NET code. Its a simple C code and it works on Windows Mobile 5.
    Regards,
    Neeraj Krishna
  • SystemAdmin
    SystemAdmin
    684 Posts

    Re: MQe Libraries for Compact Framework 2.0

    ‏2006-11-17T08:13:37Z  
    • neekrish
    • ‏2006-11-17T03:00:02Z
    Hi,
    MQe provides C-Dlls and has no depedency on .NET libraries.
    The support for Windows Mobile 5 was added from MQe v2.0.2.4.
    You can find MQe C-Dlls compiled for Windows Mobile 5 Platform from this version.

    I guess you are using MQe v2.0.2.1. Suggest you to upgrade to the latest available MQe build (v2.0.2.8).

    The Code in the Article is not a .NET code. Its a simple C code and it works on Windows Mobile 5.
    Regards,
    Neeraj Krishna
    Hi Neeraj,

    Thanks a lot again.

    ¿where can I find MQe v2.0.2.8? ¿Can you post the download url? I only can find v2.0.2.1
  • neekrish
    neekrish
    13 Posts

    Re: MQe Libraries for Compact Framework 2.0

    ‏2006-11-17T08:55:29Z  
    Hi Neeraj,

    Thanks a lot again.

    ¿where can I find MQe v2.0.2.8? ¿Can you post the download url? I only can find v2.0.2.1
    Hi,
    I am afraid you are using the trial version of MQe dowloaded from IBM website.

    If you have licensed version of MQe you can contact L1 or L2 support team in IBM for getting the latest version of MQe. They will help you in this regard.

    Regards,
    Neeraj Krishna
  • SystemAdmin
    SystemAdmin
    684 Posts

    Re: MQe Libraries for Compact Framework 2.0

    ‏2006-11-17T12:58:23Z  
    • neekrish
    • ‏2006-11-17T08:55:29Z
    Hi,
    I am afraid you are using the trial version of MQe dowloaded from IBM website.

    If you have licensed version of MQe you can contact L1 or L2 support team in IBM for getting the latest version of MQe. They will help you in this regard.

    Regards,
    Neeraj Krishna
    Ok.

    Thanks for help us.