Smile package releases
Smile package releases
All I'm seeing is a bunch of headers and a few compiled libs.
Is there a dll release, or a visual studio solution available? Or should I just use the dll that comes with GeNIe?
I'm not so much interested in developing or changing anything in SMILE as I am in using it, and Smilex doesn't work with Unicode, so the COM interface seems to be out of the question.
Thanks!
Is there a dll release, or a visual studio solution available? Or should I just use the dll that comes with GeNIe?
I'm not so much interested in developing or changing anything in SMILE as I am in using it, and Smilex doesn't work with Unicode, so the COM interface seems to be out of the question.
Thanks!
-
- Site Admin
- Posts: 1457
- Joined: Mon Nov 26, 2007 5:51 pm
Re: Smile package releases
The only '.dll release' is the wrapper for .Net. What's your programming environment?
I use a windows scripting language called AutoIt. It's capable of using dlls much the same way c and c++ can. It can also use com objects, but AutoIt recently became strictly Unicode, which is what I assume is causing the issues with SmileX.
Is there an easy way to recompile SmileX with Unicode compatibility? Otherwise, I'll have to create a windows dll and expose the functions, which shouldn't be too hard. The source code provided is nicely written. Thanks for the quick reply.
Is there an easy way to recompile SmileX with Unicode compatibility? Otherwise, I'll have to create a windows dll and expose the functions, which shouldn't be too hard. The source code provided is nicely written. Thanks for the quick reply.
-
- Site Admin
- Posts: 1457
- Joined: Mon Nov 26, 2007 5:51 pm
Yes, but it's not going to consume the exported C++ classes (due to decorated names, thiscalls instead of stdcalls, objects passed as arguments - just to name a few problems with that approach).JRowe wrote:I use a windows scripting language called AutoIt. It's capable of using dlls much the same way c and c++ can.
SmileX implements IDispatch and uses BSTRs for strings. Is it possible to use AutoIt with BSTRs?Is there an easy way to recompile SmileX with Unicode compatibility
I'm passing a valid BSTR object to the com interface, and in turn getting a catastrophic failure.
I use SysAllocString to create a valid BSTR pointing to my filepath (which is valid.)
So, it looks like this:
I initialize the com object
Much like VB, I can now access SMILEX methods using the $Smilex object.
I first get a BSTR to pass to ReadFile()
I've verified that $hBSTR[0] is indeed a valid BSTR (the function returns an array, in which index[0] contains the result of the dll call). I in turn attempt to pass it to $Smilex.Readfile, like so:
So, $Smilex.ReadFile() is receiving a BSTR.
Is it expecting a pointer to a BSTR pointer, or a pointer to the text? Passing the BSTR itself doesnt seem to be working.
http://msdn.microsoft.com/en-us/library/ms221458.aspx is where I was shown to create BSTRs.
The error I'm receiving is "catastrophic failure", which I'm assuming just means that whatever the error is, it wasn't specifically handled, so I'm not too worried about that.
Much thanks! Could it be an issue with me having exported a .dsl from Genie 2, instead of using Genie 1?
I use SysAllocString to create a valid BSTR pointing to my filepath (which is valid.)
So, it looks like this:
I initialize the com object
Code: Select all
$Smilex = ObjCreate("SMILEX.SmileXCtrl.1")
I first get a BSTR to pass to ReadFile()
Code: Select all
$hBSTR = DllCall("oleaut32.dll", "hwnd", "SysAllocString", "wstr", "c:/test/Animals.dsl")
Code: Select all
$Smilex.ReadFile($hBSTR[0])
Is it expecting a pointer to a BSTR pointer, or a pointer to the text? Passing the BSTR itself doesnt seem to be working.
http://msdn.microsoft.com/en-us/library/ms221458.aspx is where I was shown to create BSTRs.
The error I'm receiving is "catastrophic failure", which I'm assuming just means that whatever the error is, it wasn't specifically handled, so I'm not too worried about that.
Much thanks! Could it be an issue with me having exported a .dsl from Genie 2, instead of using Genie 1?
-
- Site Admin
- Posts: 1457
- Joined: Mon Nov 26, 2007 5:51 pm
-
- Site Admin
- Posts: 1457
- Joined: Mon Nov 26, 2007 5:51 pm
I checked that with VBScript and AutoIt. AutoIt can create an instance of SMILEX.SmileXCtrl.1, but UpdateBeliefs can't be invoked. VBScript fails to create the object.JRowe wrote:Nope, its crashing on $Smilex.UpdateBeliefs(). I'll work on getting that running first, lol. Thanks for the help, I appreciate it.
-
- Site Admin
- Posts: 1457
- Joined: Mon Nov 26, 2007 5:51 pm
You can try at http://genie.sis.pitt.edu/SmileX/manual/SmileX_0.htmlJRowe wrote:Is there a working example of Smilex around somewhere? I can't seem to find a complete script, just the snippets in the documentation.
SmileX is no longer developed. We keep it on the site just for the people who need easy access to SMILE functionality from VBA.
I've tested on my systems, and it appears that the Smilex object from the download is broken. The javascript, vbs, and autoit calls to the com object all result in catastrophic failure, from win XP SP3, SP2, and on the Acer netbook. Another guy on the AutoIt forum has the same issues.
VB test:
JS test:
Are the sources for the activex control available, or could they be made available for fixing? Failing that, I think I'll have a go at recreating the functionality in a regular c++ dll and calling it from AutoIt.
Thanks again
VB test:
Code: Select all
Dim Smilex : Set Smilex = CreateObject("SMILEX.SmileXCtrl.1")
Smilex.AboutBox
Set Smilex = Nothing
Code: Select all
var Smilex = new ActiveXObject("SMILEX.SmileXCtrl.1")
Smilex.AboutBox()
delete SmileX
Thanks again

-
- Site Admin
- Posts: 1457
- Joined: Mon Nov 26, 2007 5:51 pm
It turns out that the issue is not related to Unicode. SmileX is an ActiveX control and expects to be hosted in proper ActiveX container (so the control initialization is done), not the automation host like scripting engine. However, the fix is quite simple - see http://support.microsoft.com/kb/146120 for boring tech details. New SmileX build is ready for download. I tested it from VBScript, it seems to work fine.