1

I tried to create an ocx control by code manually.(Because i need use this control in web application ,so I create a form application and use this control for test ) , current program is STA mode .

        AxC_FaceServerSdk axc = new AxCFaceServerSdkLib.AxC_FaceServerSdk();
        axc.CreateControl();
        axc.OnEventCConnect += delegate(object sender, _DFaceServerSdkEvents_OnEventCConnectEvent e)
        {
            MessageBox.Show("raised");
        };
        axc.C_ServerInit(30000, 0);

I think this control works normally since i saw linstener inside is working! But the event never raised !

Then tried another way :Drag ocx control into form , and use the following code :

        this.axC_FaceServerSdk1.C_ServerInit(30000, 0);
        this.axC_FaceServerSdk1.OnEventCConnect += delegate(object sender, _DFaceServerSdkEvents_OnEventCConnectEvent e)
        {
            MessageBox.Show("raised");
        };

Event raiesd !!

Anyone knows why ?

Zhou Cheng
  • 21
  • 4
  • Awesome! Resolved it ... See below : http://stackoverflow.com/questions/36853716/enable-activex-control-to-raise-events-without-running-in-a-system-windows-forms – Zhou Cheng Jan 02 '17 at 01:14

0 Answers0