LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default O% Data Type Problem in C API and Excel12

I'm trying to update a set of routines that I had working in older excel to
allowing them to work with larger arrays in the new excel.

I've updated my routines to work with XLOPER12 instead of the older XLOPER
formats. In the past my function was registered with a set of parameters that
looked like "ROO" and I'm trying to use the new parameters of "UO%O%$".

In C, the old and new procedure definitions looked like:

LPXLOPER __stdcall cplxSum(unsigned short int *iNumXLRowsA,unsigned short
int *iNumXLColumnsA, double A[],unsigned short int *iNumXLRowsB,unsigned
short int *iNumXLColumnsB, double B[])

LPXLOPER12 __stdcall cplx12Sum(signed int *iNumXLRowsA,signed int
*iNumXLColumnsA, double A[],signed int *iNumXLRowsB,signed int
*iNumXLColumnsB, double B[])

I've been looking at http://msdn.microsoft.com/en-us/library/bb687900.aspx
as to the differences in the new SDK.

The values getting passed in the array A[] or B[] were incorrect when the
second version of the function was registered. In the debugger, I was able to
figure out that the address of those arrays was off by 4 bytes. If I
manually insert this hack, things seem to be working.

// HACK: Total HACK!
char * foo = (char *) A;
foo -= 4;
A = (double *) foo;
foo = (char *) B;
foo -= 4;
B = (double *) foo;
// HACK: End of total hack.

Has anyone else run into problems with the O% Data Type? Is there something
inherently wrong that I'm doing that's causing this behavior?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel data numeric type read problem [email protected] Excel Programming 0 April 25th 07 03:44 AM
data type problem XL9 RB Smissaert Excel Programming 19 July 13th 06 01:49 PM
Data Type Problem!!! Addy Excel Programming 2 May 14th 06 02:33 PM
Data Type Problem? bailey Excel Discussion (Misc queries) 8 December 6th 05 03:51 AM
Excel VBA - Data Type Conversion problem PaulC Excel Programming 3 May 10th 04 04:53 PM


All times are GMT +1. The time now is 08:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"