Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing integer arrays to a COM server written in Visual
Message
De
18/12/2001 07:03:36
 
 
À
18/12/2001 06:20:45
Lloyd Grant
Meridian Legal Systems
Buxton, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00595515
Message ID:
00595525
Vues:
19
Lloyd,

I think you should pass the array by reference:
loLFDoc.PrintForm( <b>@</b>laPageRange )
Also, check out COMARRAY().

HTH
>Hi,
>
>I am coding a wrapper for an application called LaserForms and have come across a problem. The PrintForm() method of LaserForms requires an array of type integer to be passed to it. Each element of the array contains an integer that contains a page number. LaserForms then processes this integer array and prints each page.
>
>This is the demo code in Visual Basic ( this works):
>
> Private Sub cmdPrint_Click()
>
> Dim printRange() As Integer, i As Integer
> ReDim printRange(1 To LFMApp.ActiveDocument.Pages.Count) As Integer
>
> For i = 1 To LFMApp.ActiveDocument.Pages.Count
> printRange(i) = i
> Next
>
> LFMApp.ActiveDocument.PrintForm printRange
>
> End Sub
>
>and this is my code in VFP (this does not work):
>
> IF llSuccess
> *-- Get the total number of pages
> lnTotPages = loLFDoc.Pages.Count
> DIMENSION laPageRange[ lnTotPages ] AS INTEGER
> FOR lnPageCount = 1 TO lnTotPages
> laPageRange[ lnPageCount ] = lnPageCount
> ENDFOR
> ENDIF
>
> IF llSuccess
> *-- Actually print the form
> loLFDoc.PrintForm( laPageRange )
> ENDIF
>
>I have tried various ways of getting this to work e.g. hard coded values, passing by reference, removing the AS INTEGER etc and can not get the COM server to accept the values. I do not know what a VB array of integers looks like, presumably there is a small header with the type and number of elements in and then the data. Does anyone know? Does anyone know a way of passing this type of information from VFP?
>
>Thanks!
Daniel
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform