Alaska Software Inc. - SAFEARRAY
Username: Password:
AuthorTopic: SAFEARRAY
Osvaldo Ramirez SAFEARRAY
on Tue, 23 Sep 2008 13:47:03 -0600
Hello guys

I want to know if Xbase++ has implement the SAFEARRAY ?

I have a activex method that need this data type.

I would like know if some one has a little help.

Thanks in advance.

Osvaldo Ramirez
Osvaldo Ramirez Re: SAFEARRAY
on Tue, 23 Sep 2008 14:07:01 -0600
More info


How can I implement SAFEARRAY** and struc_collection using VT_TYPE() ?

#define VT_SAFEARRAY  ### SAFEARRAY**


  T = MakeList({"r 1000;200","d 1500;200;200"})
  v = MakeList({"Resv Ref","Total"})


  oPreview:Tabulate(VTType():new(v,VT_ARRAY), VTType():new(T,VT_ARRAY), 
, , )  ERROR TYPE

as is it declared into IDL
//// HRESULT Tabulate (/*[in,out]*/ struct _Collection   colFieldValues,
         /*[in,out]*/ struct _Collection   colFieldDefs,
         /*[in,out]*/ VARIANT * CX,
         /*[in,out]*/ VARIANT * CY,
         /*[in,out]*/ enum eAutoStep * etsStep,
         /*[out,retval]*/ VARIANT_BOOL * _arg6 ) = 0;

The Fields collection contains a list of strings which define a series 
of fields:
  f.Add "r;2000;500" f.Add "l;1500;450" f.Add "d;3000;600;600" T
he Values collection contains a series of strings which are positioned 
on the same
  line according to the field definitions. If the number of values 
exceeds the number
of fields then the function returns false and no output is generated.



oPreview:ArrayReport( MakeCollection({{"Text","Development"}, 
{"01/09/2002","15/09/2002"}}))
oVT  :=  MakeCollection({{"Text"," Development"}, 
{"01/09/2002","15/09/2002"}})
oPreview:ArrayReport(VTType():new(oVT,VT_VARIANT) )   -----> error tYPE

   as is it declared into IDL
  /////HRESULT ArrayReport ( SAFEARRAY   Dt,enum eAutoStep * etsStep );

This method generates the contents of a report using the data within the 
array of collections dta.
  Each item in the array is considered a collection of values in a 
single row of the report.



Best Regards
Hannes ZieglerRe: SAFEARRAY
on Thu, 25 Sep 2008 03:07:17 +0200
Osvaldo,

it would be of great help when you tell the ActiveX control you are 
accessing.

> More info
>
> How can I implement SAFEARRAY** and struc_collection using VT_TYPE() ?

AFAIK, Alaska's implementation converts Arrays to SafeArrays transparently. 
That is: you don't notice the conversion.

>  T = MakeList({"r 1000;200","d 1500;200;200"})
>  v = MakeList({"Resv Ref","Total"})
>
>
>  oPreview:Tabulate(VTType():new(v,VT_ARRAY), VTType():new(T,VT_ARRAY), , 
> , )  ERROR TYPE
>
> as is it declared into IDL
> //// HRESULT Tabulate (/*[in,out]*/ struct _Collection   colFieldValues,
>         /*[in,out]*/ struct _Collection   colFieldDefs,
>         /*[in,out]*/ VARIANT * CX,
>         /*[in,out]*/ VARIANT * CY,
>         /*[in,out]*/ enum eAutoStep * etsStep,
>         /*[out,retval]*/ VARIANT_BOOL * _arg6 ) = 0;

IMO, you are asking for trouble with "struct _Collection"

If  "struct _Collection" is declared in the type library of your ActiveX 
control, you are stuck. There is no way to resolve it with with Alaska's COM 
implementation.

A structure declared in a typelib is known as User Defined Type (UDT) in VB, 
and is not recognized in Xbase++. You might want to try 
VTType():new(T,VT_ARRAY+VT_RECORD) but I don't know which Xbase++ data type 
represents the VT_RECORD type (structure, or UDT).

I have addressed these problems in my YUKON library, which includes the 
functions Array2SafeArray() and SafeArray2Array().

YUKON is aware of UDTs, that is: when a structure (VT_RECORD) is declared in 
a typelib, YUKON extracts the structure declaration from the typelib and 
builds an Xbase++ class on the fly representing this structure.

A SAFEARRAY of UDTs is a very complex data structure. If you are 
interested in resolving this problem, I can offer to you the YUKON Demo and 
my support with YUKON.

Please reply via private mail if you want to follow this suggestion.

Regards,
--
Hannes
Hector Pezoa GonzalezRe: SAFEARRAY
on Wed, 24 Sep 2008 21:44:23 -0400
Hi Hannes

If you haven't noticed yet, its a pointer to a safearray,
declaring it as VT_ARRAY | VT_VARIANT , gives an error  just because its a 
array of collection
#define VT_SAFEARRAY   ----->    SAFEARRAY**
 as is it declared into IDL
 /////HRESULT ArrayReport ( SAFEARRAY   Dt,enum eAutoStep * etsStep );

Best Regard
Hector

"Hannes Ziegler" <hz@knowleXbase.com> escribi en el mensaje 
news:10595907$6099a3cd$5990@news.alaska-software.com...
> Osvaldo,
>
> it would be of great help when you tell the ActiveX control you are 
> accessing.
>
>> More info
>>
>> How can I implement SAFEARRAY** and struc_collection using VT_TYPE() ?
>
> AFAIK, Alaska's implementation converts Arrays to SafeArrays 
> transparently. That is: you don't notice the conversion.
>
>>  T = MakeList({"r 1000;200","d 1500;200;200"})
>>  v = MakeList({"Resv Ref","Total"})
>>
>>
>>  oPreview:Tabulate(VTType():new(v,VT_ARRAY), VTType():new(T,VT_ARRAY), , 
>> , )  ERROR TYPE
>>
>> as is it declared into IDL
>> //// HRESULT Tabulate (/*[in,out]*/ struct _Collection   
>> colFieldValues,
>>         /*[in,out]*/ struct _Collection   colFieldDefs,
>>         /*[in,out]*/ VARIANT * CX,
>>         /*[in,out]*/ VARIANT * CY,
>>         /*[in,out]*/ enum eAutoStep * etsStep,
>>         /*[out,retval]*/ VARIANT_BOOL * _arg6 ) = 0;
>
> IMO, you are asking for trouble with "struct _Collection"
>
> If  "struct _Collection" is declared in the type library of your ActiveX 
> control, you are stuck. There is no way to resolve it with with Alaska's 
> COM implementation.
>
> A structure declared in a typelib is known as User Defined Type (UDT) in 
> VB, and is not recognized in Xbase++. You might want to try 
> VTType():new(T,VT_ARRAY+VT_RECORD) but I don't know which Xbase++ data 
> type represents the VT_RECORD type (structure, or UDT).
>
> I have addressed these problems in my YUKON library, which includes the 
> functions Array2SafeArray() and SafeArray2Array().
>
> YUKON is aware of UDTs, that is: when a structure (VT_RECORD) is declared 
> in a typelib, YUKON extracts the structure declaration from the typelib 
> and builds an Xbase++ class on the fly representing this structure.
>
> A SAFEARRAY of UDTs is a very complex data structure. If you are 
> interested in resolving this problem, I can offer to you the YUKON Demo 
> and my support with YUKON.
>
> Please reply via private mail if you want to follow this suggestion.
>
> Regards,
> --
> Hannes
Hannes ZieglerRe: SAFEARRAY
on Thu, 25 Sep 2008 04:08:13 +0200
Please re-read my message to understand the VT_RECORD problem in conjunction 
with VT_ARRAY.
--
Hannes

"Hector Pezoa Gonzalez" <hpezoa@telsur.cl> schrieb im Newsbeitrag 
news:1157f2f8$1e9da016$5954@news.alaska-software.com...
> Hi Hannes
>
> If you haven't noticed yet, its a pointer to a safearray,
> declaring it as VT_ARRAY | VT_VARIANT , gives an error  just because its a 
> array of collection
> #define VT_SAFEARRAY   ----->    SAFEARRAY**
> as is it declared into IDL
> /////HRESULT ArrayReport ( SAFEARRAY   Dt,enum eAutoStep * etsStep );
>
> Best Regard
> Hector
>
> "Hannes Ziegler" <hz@knowleXbase.com> escribió en el mensaje 
> news:10595907$6099a3cd$5990@news.alaska-software.com...
>> Osvaldo,
>>
>> it would be of great help when you tell the ActiveX control you are 
>> accessing.
>>
>>> More info
>>>
>>> How can I implement SAFEARRAY** and struc_collection using VT_TYPE() ?
>>
>> AFAIK, Alaska's implementation converts Arrays to SafeArrays 
>> transparently. That is: you don't notice the conversion.
>>
>>>  T = MakeList({"r 1000;200","d 1500;200;200"})
>>>  v = MakeList({"Resv Ref","Total"})
>>>
>>>
>>>  oPreview:Tabulate(VTType():new(v,VT_ARRAY), VTType():new(T,VT_ARRAY), , 
>>> , )  ERROR TYPE
>>>
>>> as is it declared into IDL
>>> //// HRESULT Tabulate (/*[in,out]*/ struct _Collection   
>>> colFieldValues,
>>>         /*[in,out]*/ struct _Collection   colFieldDefs,
>>>         /*[in,out]*/ VARIANT * CX,
>>>         /*[in,out]*/ VARIANT * CY,
>>>         /*[in,out]*/ enum eAutoStep * etsStep,
>>>         /*[out,retval]*/ VARIANT_BOOL * _arg6 ) = 0;
>>
>> IMO, you are asking for trouble with "struct _Collection"
>>
>> If  "struct _Collection" is declared in the type library of your ActiveX 
>> control, you are stuck. There is no way to resolve it with with Alaska's 
>> COM implementation.
>>
>> A structure declared in a typelib is known as User Defined Type (UDT) in 
>> VB, and is not recognized in Xbase++. You might want to try 
>> VTType():new(T,VT_ARRAY+VT_RECORD) but I don't know which Xbase++ data 
>> type represents the VT_RECORD type (structure, or UDT).
>>
>> I have addressed these problems in my YUKON library, which includes the 
>> functions Array2SafeArray() and SafeArray2Array().
>>
>> YUKON is aware of UDTs, that is: when a structure (VT_RECORD) is declared 
>> in a typelib, YUKON extracts the structure declaration from the typelib 
>> and builds an Xbase++ class on the fly representing this structure.
>>
>> A SAFEARRAY of UDTs is a very complex data structure. If you are 
>> interested in resolving this problem, I can offer to you the YUKON Demo 
>> and my support with YUKON.
>>
>> Please reply via private mail if you want to follow this suggestion.
>>
>> Regards,
>> --
>> Hannes
>
>
Osvaldo Ramirez Re: SAFEARRAY
on Sat, 27 Sep 2008 20:47:48 -0600
Dear Hannes Ziegler

Thanks for your answer ...

the activex is some like VPE, a print preview software.

http://www.ppreview.net/

this software need arrays and struc_collection.

I will send an example to alaska support to see if they can
help.

Anyway Thanks a lot for you knowment and support.

Best Regards
Osvaldo Ramirez


wrote:
> Osvaldo,
> 
> it would be of great help when you tell the ActiveX control you are 
> accessing.
> 
>> More info
>>
>> How can I implement SAFEARRAY** and struc_collection using VT_TYPE() ?
> 
> AFAIK, Alaska's implementation converts Arrays to SafeArrays 
> transparently. That is: you don't notice the conversion.
> 
>>  T = MakeList({"r 1000;200","d 1500;200;200"})
>>  v = MakeList({"Resv Ref","Total"})
>>
>>
>>  oPreview:Tabulate(VTType():new(v,VT_ARRAY), VTType():new(T,VT_ARRAY), 
>> , , )  ERROR TYPE
>>
>> as is it declared into IDL
>> //// HRESULT Tabulate (/*[in,out]*/ struct _Collection   
>> colFieldValues,
>>         /*[in,out]*/ struct _Collection   colFieldDefs,
>>         /*[in,out]*/ VARIANT * CX,
>>         /*[in,out]*/ VARIANT * CY,
>>         /*[in,out]*/ enum eAutoStep * etsStep,
>>         /*[out,retval]*/ VARIANT_BOOL * _arg6 ) = 0;
> 
> IMO, you are asking for trouble with "struct _Collection"
> 
> If  "struct _Collection" is declared in the type library of your ActiveX 
> control, you are stuck. There is no way to resolve it with with Alaska's 
> COM implementation.
> 
> A structure declared in a typelib is known as User Defined Type (UDT) in 
> VB, and is not recognized in Xbase++. You might want to try 
> VTType():new(T,VT_ARRAY+VT_RECORD) but I don't know which Xbase++ data 
> type represents the VT_RECORD type (structure, or UDT).
> 
> I have addressed these problems in my YUKON library, which includes the 
> functions Array2SafeArray() and SafeArray2Array().
> 
> YUKON is aware of UDTs, that is: when a structure (VT_RECORD) is 
> declared in a typelib, YUKON extracts the structure declaration from the 
> typelib and builds an Xbase++ class on the fly representing this structure.
> 
> A SAFEARRAY of UDTs is a very complex data structure. If you are 
> interested in resolving this problem, I can offer to you the YUKON Demo 
> and my support with YUKON.
> 
> Please reply via private mail if you want to follow this suggestion.
> 
> Regards,
> -- 
> Hannes
Hannes ZieglerRe: SAFEARRAY
on Mon, 29 Sep 2008 03:26:41 +0200
Hi Osvaldo,

> Thanks for your answer ...
>
> the activex is some like VPE, a print preview software.
>
> http://www.ppreview.net/
>
> this software need arrays and struc_collection.
>
> I will send an example to alaska support to see if they can
> help.

I had a look at the typelib of Preview.ocx.

Alaska support shouldn't have a problem in advising you how to use this OCX.

If you don't get help from Alaska, you know how to reach me 

Regards,
--
Hannes
AUGE_OHRRe: SAFEARRAY
on Thu, 25 Sep 2008 04:45:48 +0200
hi,

> oPreview:ArrayReport( MakeCollection({{"Text","Development"}, 
> {"01/09/2002","15/09/2002"}}))
> oVT  :=  MakeCollection({{"Text"," Development"}, 
> {"01/09/2002","15/09/2002"}})
> oPreview:ArrayReport(VTType():new(oVT,VT_VARIANT) )   -----> error tYPE

i think your Date is the Problem.

when using MSCOMCT2.OCX with Xbase XbpMonthView() Sample
i do have Problem with DATE(). My Solution for YYYYMMDDHHMMSS

*** snip ***
          ::oMonthView:setProperty("DayBold",;
               VTType():new( cDtoS+"00:00:01", VT_DATE) ,.T.)
*** eof ***

greetings by OHR
Jimmy
Osvaldo Ramirez Re: SAFEARRAY
on Sat, 27 Sep 2008 20:49:43 -0600
Thanks Jimmy

Appear that the problem is that alaska hasnt all types.
but I will try your suggestion.

Best Regards
Osvaldo Ramirez

AUGE_OHR wrote:
> hi,
> 
>> oPreview:ArrayReport( MakeCollection({{"Text","Development"}, 
>> {"01/09/2002","15/09/2002"}}))
>> oVT  :=  MakeCollection({{"Text"," Development"}, 
>> {"01/09/2002","15/09/2002"}})
>> oPreview:ArrayReport(VTType():new(oVT,VT_VARIANT) )   -----> error tYPE
> 
> i think your Date is the Problem.
> 
> when using MSCOMCT2.OCX with Xbase XbpMonthView() Sample
> i do have Problem with DATE(). My Solution for YYYYMMDDHHMMSS
> 
> *** snip ***
>           ::oMonthView:setProperty("DayBold",;
>                VTType():new( cDtoS+"00:00:01", VT_DATE) ,.T.)
> *** eof ***
> 
> greetings by OHR
> Jimmy
> 
> 
Thank