Jump to content

autoitx + vb.net 2003 = 'System.NullReferenceException' ?


v3n0m
 Share

Recommended Posts

hi folks, I've got a very annoying problem :S

I'm trying to use the autoitx3.dll in vb.net 2003.

afaik that shouldn't be a problem, but I can't seem to get it to work :whistle:

I registered the dll, added it by pressing project > add reference, and I added the line:

Dim cAutoit As AutoItX3Lib.AutoItX3

when I call a autoit function, like:

cAutoit.Send("a")

I get the followin error message:

An unhandled exception of type 'System.NullReferenceException' occurred in [exe name]

does anybody have a clue how to fix this? it worked perfectly in vb6, and it still works in vbscript too.

the reason I switched from vb6 to vb.net, is a very high cpu usage for my app, so the pc became almost unworkable, and the app works great in vb.net

only the implementation of autoitx :S

thanks in advance :)

v3n0m

Link to comment
Share on other sites

OMG!!!!!!! thanks man, that did the trick :whistle:

I think I know why I didn't add the NEW in the dim line: when I found that I couldn't get the thing to work, I copied the line from one of my older projects (in vb6), which was just

Dim cAutoit As AutoItX3Lib.AutoItX3

MAN!, thanks so much, now I can continue programming :)

the function I want (pressing a key, and keep it pressed) is even in vb.net (sendinput), but I couldn't get that to work :S

and I know I can with autoit, so this should solve the problem.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...