Exception of type 'System.Windows.Forms.AxHost+InvalidActiveXStateException' was thrown

后端 未结 2 1525
执笔经年
执笔经年 2021-02-09 01:47

I am getting an error in my simple project.

This is my code:

if (axZKFPEngX1.InitEngine() == 0) {
    label1.Text = "Connected";
}
else {
    lab         


        
相关标签:
2条回答
  • 2021-02-09 02:00

    The answer by Constantin is Fulfill your requirement but here I wanted to add one more thing with it. If you wanted to reflected this changes via all the threads and not only by calling thread (in multiple thread scenario) then use

    CreateControl();
    InitWB();
    SkinAllThreads();
    

    Actually in multiple threading scenario if your skinning code is in one of the thread then may be it is not reflect change for other current thread so at that time this code is play important role in it.

    Here is some Documents I mention kindly go through it for reference :

    1. initwb() method
    2. DirectSkin other Methods
    3. Adding Direct Skin to Application
    0 讨论(0)
  • 2021-02-09 02:07

    try to call CreateControl() from your component first.

    0 讨论(0)
提交回复
热议问题