Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLE error:...:Unknown name

Status
Not open for further replies.

mensud

Programmer
Jul 22, 2001
51
US
Hi,
I am working with QuickBooksSDK. Manufacturer has provided a dll (qbfc2_1.ddl). This DLL has only 2 classes and a lot of interfaces. I can create object of these class, but I can't (or I don't know) use interfaces. Every time I get message: "OLE error code: 0x80020006:Unknown name".
My question is how to use the interfaces of the classe from DLL not programmed in FoxPro?

Here is part of source:

store "Vendor_FoxPro" to cAppID
store "Vendor_FoxPro" to cAppName

* Registered Class: QBSessionManager
objQB = createobject("QBFC2.QBSessionManager")
objQB.OpenConnection (cAppID, cAppName)
objQB.BeginSession ("", 2) && 2-omDontCare

* Create the message set request object.
* This function is in the class QBSessionManager
requestMsgSet = objQB.CreateMsgSetRequest(1,1)

*AppendVendorQueryRq is interface
*Here I get an error
VendorQuery = objQB.AppendVendorQueryRq


ListQueryXML = requestMsgSet.ToXMLString
ListResponse = objQB.DoRequests(requestMsgSet)
If isnull(ListResponse.ResponseList) then && Is Nothing
Exit
EndIf

Thanks in advance
 
Although I have never used that .dll, it looks like it's incomplete to me:

objQB.AppendVendorQueryRq.VenderName
-or maybe-
objQB.AppendVendorQueryRq.Show
-or even-
objQB.AppendVendorQueryRq.Object.Show

or something.


-Dave S.-
[cheers]
Even more Fox stuff at:
 
Here is similar VB version, that works:

Dim SessionManager As New QBFC2_1Lib.QBSessionManager
SessionManager.OpenConnection "", appName
SessionManager.BeginSession "", QBFC2_1Lib.omDontCare

' IVendorQuery interface
Dim VendorQuery As QBFC2_1Lib.IVendorQuery
Set VendorQuery = ListQuerySet.AppendVendorQueryRq

'IAccountQuery interface
Dim AccountQuery As QBFC2_1Lib.IAccountQuery
Set AccountQuery = ListQuerySet.AppendAccountQueryRq
AccountQuery.ORAccountListQuery.AccountListFilter.AccountTypeList.Add atCostOfGoodsSold
AccountQuery.ORAccountListQuery.AccountListFilter.AccountTypeList.Add atExpense
Set AccountQuery = ListQuerySet.AppendAccountQueryRq

' Now send the query and get QBFC to parse the response

Dim ListResponse As QBFC2_1Lib.IMsgSetResponse
Dim ListQueryXML As String

ListQueryXML = ListQuerySet.ToXMLString
Set ListResponse = SessionManager.DoRequests(ListQuerySet)

Dim response As QBFC2_1Lib.IResponse

If (ListResponse.ResponseList Is Nothing) Then
Exit Sub
End If

 
I believe the &quot;key&quot; is that each Dim ... As QBFC2_1Lib.<something> in VB is the equivalent of a createobject(QBFC2_1Lib.<something>) in VFP. You need some more objects!

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top