TheAutomator Posted August 8, 2015 Posted August 8, 2015 (edited) Hello I'm not so familiar with the scriptcontrol, can you help me with this little problem?Why is this script not working correctly?Global $oVbs = ObjCreate('MSScriptControl.ScriptControl') With $ovbs .Language = "VBScript" .AllowUI = True .AddCode('Class Test:Public Function X:X = 123:End Function:Set C = New Test') .AddCode('MsgBox IsObject(C)'); should be true, no? EndWith MsgBox(0,'',$oVbs.Eval('C').X)Also: how do I add code to the global module?Thanks,TheAutomator Edited August 8, 2015 by TheAutomator Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone MiniMark Editor
Danyfirex Posted August 9, 2015 Posted August 9, 2015 You're not Closing your Class Global $oVbs = ObjCreate('MSScriptControl.ScriptControl') With $ovbs .Language = "VBScript" .AllowUI = True .AddCode('Class Test:Public Function X:X = 123:End Function:End Class:Set C = New Test') .AddCode('MsgBox IsObject(C)'); should be true, no? EndWith MsgBox(0,'',$oVbs.Eval('C').X) Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
TheAutomator Posted August 9, 2015 Author Posted August 9, 2015 You're not Closing your Class !!Thank you Danyfirex, I feel stupid now Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone MiniMark Editor
Danyfirex Posted August 9, 2015 Posted August 9, 2015 You're wellcome. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now