Prev: What happened?
Next: remove MATLAB Icon on GUI
From: John axline on 17 Feb 2010 20:37 "Martien van Bussel" <busselmv(a)kempenhaeghe.removethispart.nl> wrote in message <hlgua0$c45$1(a)fred.mathworks.com>... > Anybody? Here's source for a .mex file that does what you want. It looks like I can't post files, so if you can't compile it and need the .mex file itself let me know and I'll be glad to pass it to you (somehow). /*================================================================= * * FileTimeToSystemTime.c * returns SYSTEMTIME for FILETIME * * The calling syntax is: * * [st] = FileTimeToSystemTime(pFt) * * *=================================================================*/ #include <math.h> #include "mex.h" #include "matrix.h" #include <windows.h> /* Input Arguments */ #define pmxFt prhs[0] /* Output Arguments */ #define pmxST plhs[0] static void mxFileTimeToSystemTime(SYSTEMTIME * pSt, FILETIME * pFt) {FileTimeToSystemTime(pFt, pSt); } void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {const mwSize pmxOutputDims[] = {1,8}; SYSTEMTIME * pSt; unsigned int * pFt; // mwOutputSize m, n; /* Check for proper number of arguments */ if (nrhs != 1) mexErrMsgTxt("one input argument - ptr to int[2] filetime - required."); if (nlhs > 1) mexErrMsgTxt("Too many output arguments."); /* Check the dimensions of Y. Y can be 4 X 1 or 1 X 4. m = mxGetM(Y_IN); n = mxGetN(Y_IN); if (!mxIsDouble(Y_IN) || mxIsComplex(Y_IN) || (MAX(m,n) != 4) || (MIN(m,n) != 1)) { mexErrMsgTxt("FileTimeToSystemTime: Output must be tbd"); } */ /* Create a matrix for the return argument */ pmxST = mxCreateNumericArray(2, pmxOutputDims, mxUINT16_CLASS, mxREAL); /* Assign pointers to the various parameters */ pSt = mxGetPr(pmxST); pFt = mxGetPr(pmxFt); /* Do the actual computations in a subroutine */ mxFileTimeToSystemTime(pSt, pFt); return; }
|
Pages: 1 Prev: What happened? Next: remove MATLAB Icon on GUI |