Use an Ocx

  • Thread starter Thread starter Juan Carlos
  • Start date Start date
J

Juan Carlos

Hi

I have an ocx developed in VB 6.0 and I nedd to use it in
Window Form application in C#. When I do it, I get a
System.NullReferenceException

I've added the reference and in my application I wrote:

//Global Variables
Monitorsdn.MonitorSendClass sendMon = null;
short local = 0, remoto = 0;
string socket = "C", sPath = "C:\mon.ini"

public myForm() {
InitializeComponent();
InitializeOcx();
}

private void InicializeOcx() {
short shEvent = 1;
sendMon.Monitor(ref shEvent, ref local, ref remoto, ref
socket, ref sPath);
}

Do I need do or include something else??

What's wrong???

J.C.
 
Hi

Well I was wrong because I didn't add the ocx to my form
and it has never used in my application. Well I'm sorry.

Now I have another problem with the ocx control I get this
exception:

'System.Resources.MissingManifestResourceException' in
mscorlib.dll

Aditional information: Could not find any resources
appropriate for the specified culture (or the neutral
culture) in the given assembly. Make
sure "frmKernel.resources" was correctly embedded or
linked into assembly "Kernel".

It happens when the application try to execute the method
InitializeComponent() in this sentence:

this.axMonitorSend1.OcxState =
((System.Windows.Forms.AxHost.State)(resources.GetObject
("axMonitorSend1.OcxState")));

Regards
 
Back
Top