Huuh? mwSize IS actually defined as INT on 32 bit platform. Here is highlight of the definition header:
#ifdef MX_COMPAT_32
typedef int mwSize;
typedef int mwIndex;
typedef int mwSignedIndex;
#else
typedef size_t mwSize; /* unsigned pointer-width integer */
typedef size_t mwIndex; /* unsigned pointer-width integer */
typedef ptrdiff_t mwSignedIndex; /* a signed pointer-width integer */
#endif
Bruno
"Bruno Luong" <b.l...@fogale.findmycountry> wrote in message <h9iat2$33d$1...@fred.mathworks.com>...
I think you will need to provide more detail, or post some code, etc. to show us exactly what the issue is, and why simple type casts will not work.
James Tursa
P.S. Basically, if you have a function that takes an int * as an argument, it is expecting an array of ints. If you have an array of mwSize on in the calling routine, and mwSize is different from an int, then you need to allocate an int array the same size as your mwSize array, copy the mwSize elements into the int elements, and then pass the pointer to the int array to the function, and when you are done then free the allocated int array. You can't convert the mwSize * itself to an int * and expect things to work by passing this pointer to the function, because the underlying data hasn't been converted.
James Tursa
You can't run 32bit object code from a 64bit executable. It sounds like
you have linked to 3rd party functions that are 32bit. If you only have
object code/library for these functions, you will not be able to use
them with 64bit. The only solution is to obtain 64bit versions of this
library, or if you are on Windows you can wrap the code in a 32bit COM
executable that you can call from 64bit Matlab using actxserver. This
is not a trivial exercise, as I can attest from experience. It works,
but is a tremendous amount of work.
Dan