Jump to content

Kharlog

Members
  • Posts

    18
  • Joined

  • Last visited

Kharlog's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Ok, the solution is very simple (can't believe that i have wasted weeks of my time finding workarounds ). All you have to do is going to configuration manager and choosing to build your project for x86 processor architecture. Problem solved
  2. Sorry for late reply, I had other things to worry about. I tried compiling the code in Windows XP 32-bit version and It compiled with C# 2.0 without problems. Now I could just compile in this windows or turn off the 64-bit mode somehow. But certainly is what caused the error. Thanks for your help Uten, you've been most helpful. If I find out how to compile it succesfully in 64-bit OS I'll let you know. Version info: mscorlib,2.0.0.0,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll SharpDevelop,2.0.0.1291,D:\appz\Sharpdevelop2b3\bin\SharpDevelop.exe System.Windows.Forms,2.0.0.0,C:\WINDOWS\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll System,2.0.0.0,C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll System.Drawing,2.0.0.0,C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll ICSharpCode.Core,2.0.0.1291,D:\appz\Sharpdevelop2b3\bin\ICSharpCode.Core.dll ICSharpCode.SharpDevelop,2.0.0.1291,D:\appz\Sharpdevelop2b3\bin\ICSharpCode.SharpDevelop.dll log4net,1.2.9.0,D:\appz\Sharpdevelop2b3\bin\log4net.dll System.Configuration,2.0.0.0,C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll System.Xml,2.0.0.0,C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll WeifenLuo.WinFormsUI.Docking,0.99.0.3,D:\appz\Sharpdevelop2b3\bin\WeifenLuo.WinFormsUI.Docking.dll ICSharpCode.TextEditor,2.0.0.1291,D:\appz\Sharpdevelop2b3\bin\ICSharpCode.TextEditor.dll StartPage,2.0.0.1291,D:\appz\Sharpdevelop2b3\AddIns\AddIns\Misc\StartPage\StartPage.dll Microsoft.mshtml,7.0.3300.0,C:\WINDOWS\assembly\GAC\Microsoft.mshtml\7.0.3300.0__b03f5f7f11d50a3a\Microsoft.mshtml.dll CSharpBinding,2.0.0.1291,D:\appz\Sharpdevelop2b3\AddIns\AddIns\BackendBindings\CSharpBinding\CSharpBinding.dll Microsoft.Build.Framework,2.0.0.0,C:\WINDOWS\assembly\GAC_MSIL\Microsoft.Build.Framework\2.0.0.0__b03f5f7f11d50a3a\Microsoft.Build.Framework.dll Microsoft.Build.Engine,2.0.0.0,C:\WINDOWS\assembly\GAC_MSIL\Microsoft.Build.Engine\2.0.0.0__b03f5f7f11d50a3a\Microsoft.Build.Engine.dll System.Web.Services,2.0.0.0,C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll System.DirectoryServices,2.0.0.0,C:\WINDOWS\assembly\GAC_MSIL\System.DirectoryServices\2.0.0.0__b03f5f7f11d50a3a\System.DirectoryServices.dll System.Design,2.0.0.0,C:\WINDOWS\assembly\GAC_MSIL\System.Design\2.0.0.0__b03f5f7f11d50a3a\System.Design.dll System.Data,2.0.0.0,C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll System.Data.SqlXml,2.0.0.0,C:\WINDOWS\assembly\GAC_MSIL\System.Data.SqlXml\2.0.0.0__b77a5c561934e089\System.Data.SqlXml.dll MonoAddIn,2.0.0.1291,D:\appz\Sharpdevelop2b3\AddIns\AddIns\Misc\MonoAddIn\MonoAddIn.dll ICSharpCode.Build.Tasks,2.0.0.1291,D:\appz\Sharpdevelop2b3\bin\ICSharpCode.Build.Tasks.dll NAntAddIn,2.0.0.1291,D:\appz\Sharpdevelop2b3\AddIns\AddIns\Misc\NAntAddIn\NAntAddIn.dll XmlEditor,2.0.0.1291,D:\appz\Sharpdevelop2b3\AddIns\AddIns\DisplayBindings\XmlEditor\XmlEditor.dll ICSharpCode.NRefactory,2.0.0.1291,D:\appz\Sharpdevelop2b3\bin\ICSharpCode.NRefactory.dll FormsDesigner,2.0.0.1291,D:\appz\Sharpdevelop2b3\AddIns\AddIns\DisplayBindings\FormsDesigner\FormsDesigner.dll Microsoft.Build.Tasks,2.0.0.0,C:\WINDOWS\assembly\GAC_MSIL\Microsoft.Build.Tasks\2.0.0.0__b03f5f7f11d50a3a\Microsoft.Build.Tasks.dll Microsoft.Build.Utilities,2.0.0.0,C:\WINDOWS\assembly\GAC_MSIL\Microsoft.Build.Utilities\2.0.0.0__b03f5f7f11d50a3a\Microsoft.Build.Utilities.dll Debugger.AddIn,2.0.0.1291,D:\appz\Sharpdevelop2b3\AddIns\AddIns\Misc\Debugger\Debugger.AddIn.dll Debugger.Core,2.0.0.1291,D:\appz\Sharpdevelop2b3\AddIns\AddIns\Misc\Debugger\Debugger.Core.dll
  3. That is a good question. There is an article about using hotkeys in C#. I find that a bit hard to understand but it works anyway. Including hotkey-setting functions to AutoItX would be very nice.
  4. Yeah, that might be the reason. I'm running AMD Athlon 64 processor. I have also Windows XP Professional 32-bit edition installed. I might try compile in that OS as well. I'll search for that. My version info: mscorlib,2.0.0.0,C:\XPX64\Microsoft.NET\Framework64\v2.0.50727\mscorlib.dll SharpDevelop,2.0.0.1291,D:\appz\Sharpdevelop2b3\bin\SharpDevelop.exe System.Windows.Forms,2.0.0.0,C:\XPX64\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll System,2.0.0.0,C:\XPX64\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll System.Drawing,2.0.0.0,C:\XPX64\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll ICSharpCode.Core,2.0.0.1291,D:\appz\Sharpdevelop2b3\bin\ICSharpCode.Core.dll ICSharpCode.SharpDevelop,2.0.0.1291,D:\appz\Sharpdevelop2b3\bin\ICSharpCode.SharpDevelop.dll log4net,1.2.9.0,D:\appz\Sharpdevelop2b3\bin\log4net.dll System.Configuration,2.0.0.0,C:\XPX64\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll System.Xml,2.0.0.0,C:\XPX64\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll ICSharpCode.FiletypeRegisterer,2.0.0.1291,D:\appz\Sharpdevelop2b3\AddIns\AddIns\Misc\FiletypeRegisterer\ICSharpCode.FiletypeRegisterer.dll ICSharpCode.TextEditor,2.0.0.1291,D:\appz\Sharpdevelop2b3\bin\ICSharpCode.TextEditor.dll WeifenLuo.WinFormsUI.Docking,0.99.0.3,D:\appz\Sharpdevelop2b3\bin\WeifenLuo.WinFormsUI.Docking.dll StartPage,2.0.0.1291,D:\appz\Sharpdevelop2b3\AddIns\AddIns\Misc\StartPage\StartPage.dll CSharpBinding,2.0.0.1291,D:\appz\Sharpdevelop2b3\AddIns\AddIns\BackendBindings\CSharpBinding\CSharpBinding.dll XmlEditor,2.0.0.1291,D:\appz\Sharpdevelop2b3\AddIns\AddIns\DisplayBindings\XmlEditor\XmlEditor.dll System.Data,2.0.0.0,C:\XPX64\assembly\GAC_64\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll System.Design,2.0.0.0,C:\XPX64\assembly\GAC_MSIL\System.Design\2.0.0.0__b03f5f7f11d50a3a\System.Design.dll System.DirectoryServices,2.0.0.0,C:\XPX64\assembly\GAC_MSIL\System.DirectoryServices\2.0.0.0__b03f5f7f11d50a3a\System.DirectoryServices.dll System.Web.Services,2.0.0.0,C:\XPX64\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll Microsoft.Build.Engine,2.0.0.0,C:\XPX64\assembly\GAC_MSIL\Microsoft.Build.Engine\2.0.0.0__b03f5f7f11d50a3a\Microsoft.Build.Engine.dll Microsoft.Build.Framework,2.0.0.0,C:\XPX64\assembly\GAC_MSIL\Microsoft.Build.Framework\2.0.0.0__b03f5f7f11d50a3a\Microsoft.Build.Framework.dll ICSharpCode.NRefactory,2.0.0.1291,D:\appz\Sharpdevelop2b3\bin\ICSharpCode.NRefactory.dll FormsDesigner,2.0.0.1291,D:\appz\Sharpdevelop2b3\AddIns\AddIns\DisplayBindings\FormsDesigner\FormsDesigner.dll MonoAddIn,2.0.0.1291,D:\appz\Sharpdevelop2b3\AddIns\AddIns\Misc\MonoAddIn\MonoAddIn.dll ICSharpCode.Build.Tasks,2.0.0.1291,D:\appz\Sharpdevelop2b3\bin\ICSharpCode.Build.Tasks.dll NAntAddIn,2.0.0.1291,D:\appz\Sharpdevelop2b3\AddIns\AddIns\Misc\NAntAddIn\NAntAddIn.dll Microsoft.Build.Tasks,2.0.0.0,C:\XPX64\assembly\GAC_MSIL\Microsoft.Build.Tasks\2.0.0.0__b03f5f7f11d50a3a\Microsoft.Build.Tasks.dll Microsoft.Build.Utilities,2.0.0.0,C:\XPX64\assembly\GAC_MSIL\Microsoft.Build.Utilities\2.0.0.0__b03f5f7f11d50a3a\Microsoft.Build.Utilities.dll Debugger.AddIn,2.0.0.1291,D:\appz\Sharpdevelop2b3\AddIns\AddIns\Misc\Debugger\Debugger.AddIn.dll Debugger.Core,2.0.0.1291,D:\appz\Sharpdevelop2b3\AddIns\AddIns\Misc\Debugger\Debugger.Core.dll We seem to have exactly same versions of those "things" we both have.
  5. Thanks for your effort Uten. By saying it works only with C# 1.x I mean that it doesn't work when compiled with VS2005 or #develop 2. I tried the code you wrote and get the same error (BadImageFormatException). How did you get that version listing? And btw, I'm using Windows Xp x64 Professional Edition SP2 and IE 6.0.x.
  6. Ok, I tried it with ints. Now the method definition looks like that: [DllImport("AutoItX3.dll", EntryPoint = "AU3_PixelGetColor")] public static extern int PixelGetColor(int x, int y); The code actually works now. With longs it returned always the same number. I didn't realize that before. But the code still works only with C# 1.x and not with 2.0.
  7. Afaik, because im uncertain. Obviously C# have changed. It might be the 64-bit support that causes the problem. Now, what can I do about it? Any way to get it to work? It would be so much easier to use AutoItX than to implement those useful functions myself I thought that i could compile the autoitx stuff with for example C# 1.x and use the executables from the program coded with C# 2.0. But that wouldn't be too practical...
  8. I read \AutoItX\StandardDLL\VC6\AutoIt3.h. There are all the exported functions listed. From that file: AU3_API long WINAPI AU3_PixelGetColor(long nX, long nY); That means (afaik) that i must use long (int64) as a method type and for parameters. It works properly with C# 1.x. Only with 2.0 it results a runtime error.
  9. I tested the betaversion 3.1.0.11. I got same results.
  10. Ok, i investigated this a bit further. I wrote a C# code: using System; using System.Runtime.InteropServices; using System.Security.Permissions; class autoitxtest { [DllImport("AutoItX3.dll", EntryPoint = "AU3_PixelGetColor")] public static extern long PixelGetColor(long x, long y); public static void Main() { Console.WriteLine(PixelGetColor(400, 400)); } } This works nicely (prints the color value) with Sharpdevelop 1.1 and VS2003. But when i compile this with Sharpdevelop 2 or VS2005 i get a runtime error (exception): System.BadImageFormatException was unhandled Message="An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)" Source="testi4" StackTrace: at autoitxtest.PixelGetColor(Int64 x, Int64 y) at autoitxtest.Main() in D:\ohjelmointi\testi4\testi4\CodeFile1.cs:line 22 at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() So AutoItX doesn't work with C# 2.0. At least it doesn't work the same way it used to work with version 1. Anyway, i need those new features C# 2.0 has. Can I get AutoItX to work with C# 2.0 somehow? [edit] oh, i forgot to mention the AutoItX version i used. It's 3.1.1.0. [/edit]
  11. Is there actually someone that can get AutoItX work with VS2005?
  12. I've recently updated to VS2005 from VS2003. I was able to use AutoItX with VS2003 but when i try to use it in VS2005 the program crashes in runtime. It even crashes if i just create an object (AutoItX3Lib.AutoItX3 au3 = new AutoItX3Lib.AutoItX3() for example) of it. I didn't have any problems with VS2003. I'm using AutoItX as interop (references -> add). The assembly reference settings are defaults. Any idea what's going on?
  13. Thanks a lot, i got the point.
  14. I have an array $array1 (0,1,2,3,4) and another array $array2 (5,6,7,8) and i need to add $array2 to $array1 so that $array1 would become (0,1,2,3,4,5,6,7,8). How to do that? I found function _ArrayAdd from the help file but I think it just puts the another array inside one array element so that $array1 would become (0,1,2,3,4,(5,6,7,8)). Am I right about that one?
×
×
  • Create New...