diff options
author | Joachim Lingner <jl@openoffice.org> | 2001-12-06 07:35:16 +0000 |
---|---|---|
committer | Joachim Lingner <jl@openoffice.org> | 2001-12-06 07:35:16 +0000 |
commit | d93a6efe1890692dcc465f35cd276b83fda255bb (patch) | |
tree | 45c40ce280731ae7b3d2017fa8ad1773da0229fb /extensions/test/ole/cppToUno/testcppuno.cxx | |
parent | fdd5cc33fa09ffb792a763e2df96791ba9e83658 (diff) |
*** empty log message ***
Diffstat (limited to 'extensions/test/ole/cppToUno/testcppuno.cxx')
-rw-r--r-- | extensions/test/ole/cppToUno/testcppuno.cxx | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/extensions/test/ole/cppToUno/testcppuno.cxx b/extensions/test/ole/cppToUno/testcppuno.cxx index 4be1fc6fb..2e05d523d 100644 --- a/extensions/test/ole/cppToUno/testcppuno.cxx +++ b/extensions/test/ole/cppToUno/testcppuno.cxx @@ -2,9 +2,9 @@ * * $RCSfile: testcppuno.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: jl $ $Date: 2000-10-24 09:34:19 $ + * last change: $Author: jl $ $Date: 2001-12-06 08:35:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -159,13 +159,19 @@ HRESULT doTest() // two dimensional array SAFEARRAYBOUND bounds[2]; + // least significant dimension first, Dimension 1 bounds[0].cElements= 3; bounds[0].lLbound= 0; + // Dimension 2 bounds[1].cElements= 2; bounds[1].lLbound= 0; par= SafeArrayCreate( VT_I4, 2, bounds ); - + long uBound1; + long uBound2; + hr= SafeArrayGetUBound( par, 1, &uBound1); + hr= SafeArrayGetUBound( par, 2, &uBound2); + long index2[2]; memset( index2, 0, 2 * sizeof( long) ); long dimLengths[]={3,2}; @@ -174,8 +180,20 @@ HRESULT doTest() do { data= index2[1] * 3 + index2[0] +1; - SafeArrayPutElement( par, index2, &data); + hr= SafeArrayPutElement( par, index2, &data); }while( incrementMultidimensionalIndex( 2, dimLengths, index2) ); + + long* pdata; + long (*dataL)[2][3]; + hr= SafeArrayAccessData( par, (void**)&pdata); + dataL= (long(*)[2][3])pdata; + + for (long i= 0; i < 2; i ++) + { + for(long j= 0; j < 3; j++) + data= (*dataL)[i][j]; + } + hr= SafeArrayUnaccessData(par); result.Clear(); param1.vt= VT_ARRAY | VT_I4; @@ -242,4 +260,4 @@ bool incrementMultidimensionalIndex(sal_Int32 dimensions, } } return ret; -}
\ No newline at end of file +} |