Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Active-X Controls On Containers?
Message
 
To
11/03/1998 17:19:39
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00083030
Message ID:
00084129
Views:
27
>>>>I have a container on which I have a crystal reports Active-X control. My idea was to use this container as a member of my application object so that I can reference reports easily throughout my app (something like goapp.oReport.ReportName = 'blah'). However, when I try to instanciate my container ( x=CreateObject('cntReport') )with the active-x control on it I get the error "object class is invalid for this container." I get this same error for any olecontainer control I drop on my container. Has anyone tried something like this and gotten any results? How can I add an active-x control to my container to be instanciated?
>>>
>>>
>>>Don't know if it will help, but did you call SYS(2333) before attempting to instantiate the ActiveX control?
>>
>>This is certainly one I wouldn't have thought of. It didn't work, however. I'm starting to think that the problem lies somewhere with VFP and Active-X controls in general. For example, I created a new class based on the OLE Container class, selected the crystal reports activex for the class and saved it as oletest1. When I try to rename the class, to oletest2 for example, I get that same "object class is invalid for this container" error. I can't even rename my class? There must be something I'm missing here.
>>
>>So far I've found the crystal reports documentation to be poor. What documentation there is available is full of errors and inconsistancies.
>
>
>You don't need to put the Crystal Control in an OLE Container. Just drop it directly on the form.
>
>I agree with you on the Crystal Documentation. There are a couple of files >that ship with Crystal that may help. One is the Developer help file. The >other is the TechRef.Pdf, an Adobe Acrobat file.

I can't drop it on a form. What I am trying to do is add the activex control to my applications collection class so it can be referenced from anywhere within the app. In addition, I subclassed the active-x control because I am setting default values for many of the properties and adding some new properties of my own.

The best solution (the one that should have worked) is to simply subclass the control and add it to my collection class. That didn't work. So, I tried adding the control to a container and adding the container to my collection class. No luck. I then attempted to add the container to a form and add the form to the collection class. Same error. The last thing I tried was adding the activex control directly to a form and adding the form to the collection class. When I tried this I was surprised and delighted to find out that it...didn't work.

Right now the only option I have left is to develop my own crystal reports class using API calls, unless someone has a better idea?

Michael G. Emmons
memmons@nc.rr.com
Previous
Reply
Map
View

Click here to load this message in the networking platform