Jump to content

DLLCall or ObjCreate


Recommended Posts

I have a DLL that works with a piece of hardware (SComm.dll). I have a Class Library for this DLL (contains different Methods, Properties, Events, etc.). I have tried to do a DLLCall with this SComm.dll file and put a Method name in the Function parameter like this:

$dll = DllCall("SComm.dll","str","GetSignalStrength")

This returns a "Function Not Found" error. So I did some searching and I now think that I should be using this DLL with COM objects. However, I have tried to create an object with various classes and keep getting failure. Do I need to register the DLL in my system? Maybe I'm using the wrong Class?

I'm happy to solve this problem myself, but if someone can point me in the right direction it would be very helpful. I have checked in my system's Component Services but cannot find my class listed. Maybe I'm looking in the wrong section. Maybe my class needs to be registered. Any help is appreciated.

Link to comment
Share on other sites

  • Moderators

The only issue I've ever had with a COM dll is it not being registered, once that happened, the objects were created quite easily.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Sorry to post several times between responses - but I think this may be relevant. I looked in the OLE Viewer and found my object. It's called SiriusComm.Sirius. However running this:

$oSirius = ObjCreate("SiriusComm.Sirius")

MsgBox(0,"isObj",isobj($oSirius))

Returns 0.

Link to comment
Share on other sites

Ok. I resolved this issue. Solution is below if anyone else has a similar problem.

Apparently my DLL was a .net assembly. I had to use regasm.exe to get the dll registered in the com library. Then I had to use the /codebase switch in regasm to register the DLL in the GAC.

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...