[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1189
  • Last Modified:

class factory cannot supply requested class - VB6

I use a dll ( assume it is a c++ ) within my VB6 program.

I can use the class when I do early binding. But if I do late bind,

I get this error on the following line.

Set oOutPymnt = CreateObject("SAPbobsCOM.Payments")

"class factory cannot supply requested class"

I will be able to give more infor if needed.

Thanks in advance.

Indikad.
0
indikad
Asked:
indikad
  • 2
  • 2
1 Solution
 
EDDYKTCommented:
are you sure the prog id is correct?
How do you define oOutPymnt?
0
 
indikadAuthor Commented:
I worked it out. But your comment made me think that I could be actually doing something wrong. points given. for your interest here is the code.

'early bind

Dim oOutPymnt As SAPbobsCOM.Payments
Set oOutPymnt = gObjCompany.GetBusinessObject(oVendorPayments)

'late bind
Dim oOutPymnt As Object
'---oVendorPayments = 46
Set oOutPymnt = gObjCompany.GetBusinessObject(46)

I do not know how to technically explain why but,
what I should not have is this following line.
Set oOutPymnt = CreateObject("SAPbobsCOM.Payments")

any ideas?

thanks,

as I said, I have awarded points.



0
 
EDDYKTCommented:
that's mean you need to get object from them and cannot create object

which imples that their object is not public createable
0
 
indikadAuthor Commented:
thanks.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now