Marko Guest
|
Posted: Wed Apr 18, 2007 5:05 pm Post subject: ActiveX and Variant problem |
|
|
==== i have an ActiveX control there is a VectroR(short size, TVariant AxisArr, TVariant PosArr) function
both of the TVariant element should be:
- AxisArr is a array of Smallint {0,1,2 allways }
- PosAss is a array of 3 coordinates ( 3x Single)
Everything works like this :
OleVariant AxisArr, PosArr;
int Bounds[2];
Bounds[0]=0;
Bounds[1]=2;
AxisArr = OleVariant(Bounds,1,varSmallint);
PosArr = OleVariant(Bounds,1,varSingle);
// putting elements {0,1,2} into array
AxisArr.PutElement(0,0);
AxisArr.PutElement(1,1);
AxisArr.PutElement(2,2);
for(...)
{
//reading x,y,z from external buffer and....
//saving into PosArr
// putting elements {x,y,z} into array
PosArr.PutElement(x,0);
PosArr.PutElement(y,1);
PosArr.PutElement(z,2);
//then launching the ActiveX function
MC->VectorR(3,AxisArr,PosArr)
}
Problem....
This algorythm works only when C++ Builder is open. When i'm trying to launch the exe file only - application fails.
I know that i'm using OleVariant. I just can't fint the way to initialize the TVariant (there is no PutElement function)...... How to do it?
But it works (only under Builder 5.0 control), so where is the problem .....
Please help ! |
|