ActiveX and c#
-
Hi ! I'd like to know how can I pass parameters to an ActiveX in a c# windows application. As far as I know, the ActiveX control implements IPersistPropertyBag so that the container in html can pass the params through the Tag PARAM in the HTML tag OBJECT. However, I don't know how to do it within a c# application. Please, somebody could help me ??? thx in advance,
-
Hi ! I'd like to know how can I pass parameters to an ActiveX in a c# windows application. As far as I know, the ActiveX control implements IPersistPropertyBag so that the container in html can pass the params through the Tag PARAM in the HTML tag OBJECT. However, I don't know how to do it within a c# application. Please, somebody could help me ??? thx in advance,
Derive AxHost, you've got the following protected load methods :
DepersistControl();
DepersistFromIPropertyBag(IPropertyBag propBag);
DepersistFromIStorage(IStorage storage);
DepersistFromIStream(IStream istream);
DepersistFromIStreamInit(IStream istream);
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
-
Derive AxHost, you've got the following protected load methods :
DepersistControl();
DepersistFromIPropertyBag(IPropertyBag propBag);
DepersistFromIStorage(IStorage storage);
DepersistFromIStream(IStream istream);
DepersistFromIStreamInit(IStream istream);
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
Sorry but I'm quite new in c# and I don't know exactly what u mean, could u please explain it? When I add my Ax control "myCtrl" in the aplication, I think Aximp.exe creates AxmyCtrl which is the wrapper for my control and is dervied from AxHost. However, if I derive this class, I can't find the protected methods u talked about. I've looked in the help for the members of AxHost and I don't find those protected methods. Could u tell me more exactly what should I do? thx for everything, ORi.
-
Sorry but I'm quite new in c# and I don't know exactly what u mean, could u please explain it? When I add my Ax control "myCtrl" in the aplication, I think Aximp.exe creates AxmyCtrl which is the wrapper for my control and is dervied from AxHost. However, if I derive this class, I can't find the protected methods u talked about. I've looked in the help for the members of AxHost and I don't find those protected methods. Could u tell me more exactly what should I do? thx for everything, ORi.
Using an ActiveX with .NET is achieved with one of these : - you simply want to drag&drop the component onto a form. So yes, you import it from the Toolbox Window, and when you drop it, the .NET environment creates two wrapper assemblies (one for the ActiveX layer, one for the underlying COM layer). That's perfect as long as you just need to call methods, properties, and stuff. I would think that, once activated in a form, the ActiveX would by itself (I mean with no additional code) selfs depersists, hence load the previous state, but eh... who knows... - the other solution is to bypass the wrapper assemblies, and derive the System.Windows.Forms.AxHost class. Once derived, you just need to implement a few methods to get this class actually attached to the underlying ActiveX. For more info on it, just googlesearch with "AxHost" : you'll find code. What I said in an earlier post is, once the class is derived, you may call one of the listed methods in the constructor (or any adequate place) to load the previous state.
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.