Jump to content
Sign in to follow this  
v3n0m

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

Recommended Posts

v3n0m

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

Share this post


Link to post
Share on other sites
jvetter713

Dim cAutoit As New AutoItX3Lib.AutoItX3

Share this post


Link to post
Share on other sites
v3n0m

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.

Share this post


Link to post
Share on other sites
Richard Robertson

You could also use

Dim cAutoIt As AutoItX3Lib.AutoItX3

cAutoIt = New AutoItX3Lib.AutoItX3()

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.