Sign in to follow this  
Followers 0
JRowe

Com object assist request

1 post in this topic

#1 ·  Posted (edited)

I was wondering if someone could test this and maybe make it work for them. I've tried everything I know how to make it work and it doesn't, so I figured that before I try to recreate the functionality with DllCall, I'd ask for help.

Here's the Smilex.ocx, which is an activex wrapper for the SMILE library. It's another AI rabbithole I'm checking out that has to do with Bayesian Networks and Influence Diagrams.

The documentation is here.

I've attempted to load Animal.dsl file into the system. I used the ObjEvent error handler, it's returning Catatstrophic Failure, which is basically a codeword for "The programmer didn't really specify whatever is happening, so I'm gonna freak out and crash."

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")

Global $g_eventerror = 0

$Smilex = ObjCreate("SMILEX.SmileXCtrl.1")
if not IsObj($Smilex) then
    Msgbox(0,"Error","$Smilex is not an Object.")
else
    Msgbox(0,"Error","Successfully created Object $Smilex")
endif
$file = "c:/test/Animals.dsl"
$Result = $Smilex.ReadFile($file)

Func MyErrFunc()
   $HexNumber=hex($oMyError.number,8)
  Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !"      & @CRLF  & @CRLF & _
             "err.description is: "    & @TAB & $oMyError.description    & @CRLF & _
             "err.windescription:"     & @TAB & $oMyError.windescription & @CRLF & _
             "err.number is: "         & @TAB & hex($oMyError.number,8)  & @CRLF & _
             "err.lastdllerror is: "   & @TAB & $oMyError.lastdllerror   & @CRLF & _
             "err.scriptline is: "     & @TAB & $oMyError.scriptline     & @CRLF & _
             "err.source is: "         & @TAB & $oMyError.source         & @CRLF & _
             "err.helpfile is: "       & @TAB & $oMyError.helpfile       & @CRLF & _
             "err.helpcontext is: "    & @TAB & $oMyError.helpcontext _
            )

   $g_eventerror = 1 ; something to check for when this function returns
Endfunc

Something just occured to me. Could it be expecting an ascii string instead of unicode?

Nevermind. I'm just gonna use dllcall or a plugin, there's only 22 functions to interface with.

Edited by JRowe

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  
Followers 0