swieru Posted October 10, 2015 Posted October 10, 2015 Hello,I am trying to write very basic script to use COM object. It is a specific object allowed to communication with software on the industrial controller.I can create reference to a COM object by function ObjCreate. Thanks to ObjectName function I can read all information about object. Problem is that, I can trigger (only) one method of this object, named Disconnect().When I want to use the other method instead of Disconnect(), for example, ReadValueN I have problem with arguments for this method. I tryed many variants, combinations, without positive result. My error monitoring function (for COM errors) reports: "Bad variable types" or "Type mismath".I studied many examples, many documentations but I have no idea how it should be.Below is description for method, data etc based on OLE/ COM Object Viewer.long ReadValueN( [in] long TARGET_id, [in] PARAM_DEF* pParamDef, [out] BUFFER* pResBuffer);typedef struct tagPARAM_DEF{ unsigned char Param1; unsigned char Param2; unsigned char Param3; unsigned char ParamT[8]; short Number; unsigned char ValueF; unsigned char ValueD; } PARAM_DEF; typedef struct tagBUFFER{ unsigned char BuffA1; unsigned char BuffA2; unsigned char BuffA3; unsigned char BuffTable[256]; } BUFFER;$structParamDef = DllStructCreate("byte; byte; byte; byte[8]; short; byte; byte") $structBuffer = DllStructCreate("byte; byte; byte; byte[256]") $response = $myObject.ReadValueN(0, DllStructGetPtr($structParamDef), DllStructGetPtr($structBuffer)) ;$response = $myObject.Disconnect() ; is workingCould someone write me what is wrong and how it should be? And especially - why?thanks in advanced
Danyfirex Posted October 10, 2015 Posted October 10, 2015 If you provide referency for the object you're using maybe should be easy to help you. 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