Advertisement

07.23.2008 at 05:25AM PDT, ID: 23588146
[x]
Attachment Details

ActiveX OCXState  Initialization in C# without Form

Asked by BasiKobrA in C# Programming Language, ActiveX

Tags: C#

Hello,

Situation : (.NET 1.1, VS2003) I'm creating a C# application which uses a specific ActiveX control (not a web application!). When I use a form and add the ActiveX control the Visual Studio way, everything works fine. But since the control does not provide/need a GUI, I want the application to be able to use it without GUI.
The problem is that I don't know how to initialize the ActiveX control programatically to set in the correct OcxState.

I tried the solution presented here :
http://www.experts-exchange.com/Programming/System/Windows__Programming/Active-X/Q_23204692.html

While trying to translate this to C#, the MethodInfo turned out to be null, cause my .NET does not seem to know "System.Windows.Forms.UnsafeNativeMethods.IPropertyBag.Write".
But since I don't need to set Properties, I removed the stuff I believed are unnecessary in my case.

Then end up setting the OcxState of the ActiveX control, but still the first method invocation on the control fails.Start Free Trial
 
 
[+][-]07.24.2008 at 06:34AM PDT, ID: 22078896

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 07:37AM PDT, ID: 22079608

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 07:45AM PDT, ID: 22079691

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 12:32PM PDT, ID: 22082681

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 12:37PM PDT, ID: 22082734

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.25.2008 at 08:22AM PDT, ID: 22089362

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.25.2008 at 08:35AM PDT, ID: 22089500

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: C# Programming Language, ActiveX
Tags: C#
Sign Up Now!
Solution Provided By: TheLearnedOne
Participating Experts: 1
Solution Grade: A
 
 
[+][-]07.25.2008 at 09:27AM PDT, ID: 22090032

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628