Alaska Software Inc. - Array to ActivX component
Username: Password:
AuthorTopic: Array to ActivX component
Wolfgang CiriackArray to ActivX component
on Sun, 07 Feb 2021 19:06:44 +0100
Hello,
i need to pass an an array to a ActiveX function.
In c# this is the example:

IEnumerable<string> inputFiles = new List<string>(new string[] {
"d:\\image.jpg", "d:\\document.pdf", "d:\\image.tif",
"d:\\todo_list.xlsx" });
using (GdPictureDocumentConverter gdpictureDocumentConverter = new
GdPictureDocumentConverter())
{
    gdpictureDocumentConverter.CombineToPDF(inputFiles,
"d:\\merged.pdf", PdfConformance.PDF1_5);
}

I have tried in XBase++:
oConv:CombineToPDF({"D:\datei1.pdf", "D:\datei2.jpg"}, cOutput, 13)
or
aTmp := {"D:\datei1.pdf", "D:\datei2.jpg"}
oConv:CombineToPDF(aTmp, cOutput, 13)

The result is always wrong parameter.
Anybody who can help here ?


--
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com
Jim LeeRe: Array to ActivX component
on Mon, 08 Feb 2021 04:57:28 +0100
hi,

not sure but i "think" you can use Ot4xb and GWST

#include "ot4xb.ch"
//----------------------------------------------------------------------------------
proc main
local st := MyStruct():New()

? 'st:val := "Patata Frita"            -> ' , st:val := "Patata Frita"
? 'st:con                              -> ' , st:con
? "---"
? 'st:val := 123456                    -> ' , st:val := 123456
? 'st:con                              -> ' , st:con
? "---"
? 'st:val := SetAppWindow()            -> ' , st:val := SetAppWindow()
? 'st:con                              -> ' , st:con
? "---"
? 'st:val := NIL                       -> ' , st:val := NIL
? 'st:con                              -> ' , st:con
? "---"
? 'st:val := NIL                       -> ' , st:val := NIL
? 'st:con := _var2con("Patata Frita" ) -> ' , st:con := _var2con("Patata 
Frita" )
? '_con2var( st:con )                  -> ' , _con2var( st:con )
? 'st:val                              -> ' , st:val
? "---"

inkey(0)
return
//----------------------------------------------------------------------------------
BEGIN STRUCTURE MyStruct
   MEMBER LPXBASE val ; GWSTBACK ; MEMBER POINTER32 con
END STRUCTURE
//----------------------------------------------------------------------------------
Andreas Gehrs-Pahl
Re: Array to ActivX component
on Sun, 07 Feb 2021 23:07:33 -0500
Wolfgang,

>i need to pass an an array to a ActiveX function.

You seemed to have looked at the .NET documentation, rather than the COM/ 
ActiveX documentation. That documentation shows that you need to use an 
array (by reference) of strings as the first parameter.

The Xbase documentation says that parameters are automatically converted 
when calling a COM/OLE/ActiveX method, and that Arrays are converted to 
the VT_ARRAY type. So you might want to try this:

aFiles := {"D:\datei1.pdf", "D:\datei2.jpg"}
oConv:CombineToPDF(@aFiles, cOutput, 13)

If that doesn't work either, you might want to ask Alaska directly, how to 
use a VT_SAFEARRAY (which is a pointer to a VT_ARRAY).

Hope that helps,

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas@AbsoluteSoftwareLLC.com
web:   http://www.AbsoluteSoftwareLLC.com
[L]:   https://www.LinkedIn.com/in/AndreasGehrsPahl
[F]:   https://www.FaceBook.com/AbsoluteSoftwareLLC
Wolfgang CiriackRe: Array to ActivX component
on Tue, 09 Feb 2021 14:30:56 +0100
Am 08.02.2021 um 05:07 schrieb Andreas Gehrs-Pahl:
> Wolfgang,
>
>> i need to pass an an array to a ActiveX function.
>
> You seemed to have looked at the .NET documentation, rather than the COM/
> ActiveX documentation. That documentation shows that you need to use an
> array (by reference) of strings as the first parameter.
>
> The Xbase documentation says that parameters are automatically converted
> when calling a COM/OLE/ActiveX method, and that Arrays are converted to
> the VT_ARRAY type. So you might want to try this:
>
> aFiles := {"D:\datei1.pdf", "D:\datei2.jpg"}
> oConv:CombineToPDF(@aFiles, cOutput, 13)
>
> If that doesn't work either, you might want to ask Alaska directly, how to
> use a VT_SAFEARRAY (which is a pointer to a VT_ARRAY).
>
> Hope that helps,
>
> Andreas
>
Hello Andreas,
hope you and Kathryn are healthy.
I think i must write to Alaska, i tried it with @afiles, but the same
error arises. But thanks for your thoughts.
Wolfgang

--
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com