Jump to content

calling c++ function


madhutm
 Share

Recommended Posts

hi

sry i dont have permission to gave my dll.in side my dll c++ function is like this.

bool BCRBT_Control(int control,LPBYTE datain,int lenin,LPBYTE dataout,int* lenout)

from c# i am calling this function like this.

 

         int ctl=0xf901;

         str_in=1E.

          byte[] inData = new byte[0];
            byte[] outData = new byte[0xff];
            int outLen = 0;
            inData = ConvertHexStringToByteArray(str_in);
            Control(ctl, inData, inData.Length, outData, ref outLen)

please help me how to call this function from autoit

Link to comment
Share on other sites

solved my problem

here's the code

 Local $input = GUICtrlRead($hInput)
        Local $dd =  StringFormat("%X",$input)
        Local $outLen = 0;
        Local $ctl =0xf901;DllStructCreate
        Local $tStruct2 = DllStructCreate("byte[" & 0xFF & "]")
        $inLen =0;



        Local $tStruct = DllStructCreate("byte[1]")
        DllStructSetData($tStruct,1,'0x'&$dd)


        Local $dll = DllOpen("C:UsersMadhu.V4bcr200btv4_runtimeBCRBTLib.dll")
          Local $tl1 =   DllCall($dll,"boolean:cdecl","BCRBT_Control","int", $ctl, "struct*", $tStruct, "int", DllStructGetSize($tStruct), "struct*", $tStruct2, "int*", $outLen)
          Local $tt = DllCall($dll,"boolean:cdecl","BCRBT_Connect")
 

Thanks everyone .

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