VB.NET Automation

  • Thread starter Thread starter Andy
  • Start date Start date
A

Andy

Hello,

I am trying to automate a game with VB.NET but I am having trouble doing so.
I have added a reference to the library (GameLib 1.0) and typed the
following code.

Dim A as Object
A = GetObject("","GameLib.Game")

but I always get an error saying unable to create activex control.
Apart from GameLib.Game there is also GameLib.GameClass and GameLib.IGame
I have used Spy++ to identify the window as an ATL window.

In the registry, neithier GameLib.Game/Class or IGame appears in
HKEY_CLASSES_ROOT/CLSID, is this where all automation ojects are stored?

I have tried reading tutorials on COM,VB and automation but I cant make
sense of them.
What do I need to do with library and class file so that I can automate the
program?

Thanks
Andy
 
When you added the GameLib reference, the IDE should have created a new
class called GameLib for you. You need to reference this class instead of
the underlying COM object.

Mike Ober.
 
Back
Top