c# - After running my project few times i'm getting erorr: Could not resolve COM reference "f8937e53-d444-4e71-9275-35b64210cc3b" what's that? -


this full error:

error   1   not resolve com reference "f8937e53-d444-4e71-9275-35b64210cc3b" version 1.0. specified image file did not contain resource section. (exception hresult: 0x80070714)   usingautoit 

never had before google didn't find reference long number , letters.

this form1 complete code not long. maybe dllimport make problem ? didn't before. strange error.

using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms; using system.threading; using autoitx3lib; using system.runtime.interopservices; using system.diagnostics;  namespace usingautoit {     public partial class form1 : form     {         [dllimport("user32.dll")]         public static extern bool setforegroundwindow(intptr hwnd);           static autoitx3lib.autoitx3class au3;         static thread thread;         static bool threadshouldexecute = true;         static int = 0;         string processname = "gamecapture";         string existingprocessname = "game capture hd";         string processfilename = @"c:\program files (x86)\elgato\gamecapture\gamecapture.exe";         intptr windowhandle;          public form1()         {             initializecomponent();               au3 = new autoitx3lib.autoitx3class();             au3.autoitsetoption("wintitlematchmode", 4);              if (au3.winexists(existingprocessname, "") == 0) // window not found             {                 int processid = au3.run(processfilename, "", au3.sw_show);                 bringtofront(processid);                 thread.sleep(10000);                 au3.mouseclick("left", 358, 913, 1, -1);              }             else             {                 process[] processes = process.getprocessesbyname(processname);                 bringtofront(processes[0].id);                 au3.mouseclick("left", 358, 913, 1, -1);             }         }          public static void bringtofront(int processid)         {             process process = process.getprocessbyid(processid);             intptr handle = process.mainwindowhandle;              if (handle == intptr.zero)                 return;              setforegroundwindow(handle);         }           private void form1_load(object sender, eventargs e)         {             system.windows.forms.timer t1 = new system.windows.forms.timer();             t1.interval = 50;             t1.tick += new eventhandler(timer1_tick);             //t1.enabled = true;             t1.enabled = false;         }          public static point getmouseposition()         {             var position = system.windows.forms.cursor.position;             return new point(position.x, position.y);         }          private void form1_mousemove(object sender, mouseeventargs e)         {          }          private void timer1_tick(object sender, eventargs e)         {             label1.text = string.format("x={0}, y={1}", getmouseposition().x, getmouseposition().y);         }     } } 

but had first register using regsrv32 after register add reference dll file.

this normal, visual studio stores guid of type library in project file. type library description of types exported com component. similar metadata in .net assembly. finding library "f8937e53-d444-4e71-9275-35b64210cc3b" guid in project file requires visual studio in registry, hkcr\typelib key. not going there until after com component registered. yes, regsvr32.exe, in general better use component's installer.

i had change property embed interop types false

that because used autoitx3lib.autoitx3class in source code. synthetic class generated type library, makes com components implement multiple interfaces bit easier use. such synthetic class cannot embedded, that's why had set property false. simple workaround omit "class" type name use interface. fix:

    static autoitx3lib.autoitx3 au3;     ....     au3 = new autoitx3lib.autoitx3(); 

Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -