Discussion:
OLE error code 0x80020005: Unknown COM status code
(too old to reply)
Philippe HERRY
2005-09-28 07:43:01 UTC
Permalink
When I translate VB code :
'### use print preview for this program
mdinvManager.PrintPreview = enYes

'### Finally print invoice
Dim mdInvResult As MDINVOICEREQUESTMANAGER400Lib.MDInvoiceResult
Dim lTimestamp As Long

'### no print template is specified - standard template will be used
bstatus = mdinvManager.Print("", enNo, enYes, "", Nothing, Form1.hWnd,
lTimestamp, MDInvResult)

in VFP code by :
* finally print invoice
LOCAL mdinvResult

*IMDInvoiceResult
LOCAL lTimestamp

* no print template is specified - standard template will be used
LOCAL hWnd
bStatus = mdinvManager.Print("", enNo, enYes, "", address , hWnd,
lTimestamp, mdinvResult )

I receive the error message in the subject.
Have anyone a solution ? A pointer definition error ?
Thank you very much for your help.
Best regards
--
Philippe HERRY
***@swissonline.ch
Switzerland
Fred Taylor
2005-09-28 15:05:49 UTC
Permalink
What are your address and hWnd variables? Where did they come from, what
are their contents? You also need to initialize all variables passed to a
proper type value, something that doesn't happen automatically. Declaring a
value LOCAL in VFP makes it a logical type with a value of .F., it appears
at least most of your variables are not initialized correctly (ie,
ITimestamp should be 0, mdInvResult looks like it's either an object or the
return value of MDINVOICEREQUESTMANAGER400Lib.MDInvoiceResult) before they
are passed to your routines.

You haven't properly translated what you had.
--
Fred
Microsoft Visual FoxPro MVP
Post by Philippe HERRY
'### use print preview for this program
mdinvManager.PrintPreview = enYes
'### Finally print invoice
Dim mdInvResult As MDINVOICEREQUESTMANAGER400Lib.MDInvoiceResult
Dim lTimestamp As Long
'### no print template is specified - standard template will be used
bstatus = mdinvManager.Print("", enNo, enYes, "", Nothing, Form1.hWnd,
lTimestamp, MDInvResult)
* finally print invoice
LOCAL mdinvResult
*IMDInvoiceResult
LOCAL lTimestamp
* no print template is specified - standard template will be used
LOCAL hWnd
bStatus = mdinvManager.Print("", enNo, enYes, "", address , hWnd,
lTimestamp, mdinvResult )
I receive the error message in the subject.
Have anyone a solution ? A pointer definition error ?
Thank you very much for your help.
Best regards
--
Philippe HERRY
Switzerland
Loading...