InvalidActiveXStateException

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I am writing a control in C# that requires me to use an ActiveX control
created in VB6. It works fine running from inside the IDE in both debug and
release mode.

However, when I try to run an installed version, I get an
InvalidActiveXStateException whenever I try to access a method or property of
the ActiveX control. For instance, there is a connection property that is
defined in the ActiveX control as:

Public Function Connect(Hostname As String, Port As Long, _
Flags As Integer, UserName As String, _
Password As String) As Integer

Inside the C# code, I call it like this:
try
{
Result = axMyControl.Connect(ref m_HostName,
ref m_Port, ref Flags, ref m_UserName, ref m_Password);
}
catch (Exception e)
{
MessageBox.Show("Unable to connect to " + m_HostName +
"\n" + e.Message, "Connection Error",
MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}

The exception is always thrown here (and anywhere else I try to access the
code).

Any suggestions?

Thanks,
pagates
 
Hi pagates,

I have a similar issue with exception InvalidActiveXStateException.
Since your post, did you find out a solution to that issue?

Thanks
Marty
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top