Jump to content

Recommended Posts

Posted

this is how import in c#

[DllImport("BCRBTLib.dll", EntryPoint = "BCRBT_Disconnect",CharSet = CharSet.Auto)]
        [return: MarshalAs(UnmanagedType.I1)]
        public static extern bool Disconnect();

Posted

the same functuion works fine from c#.if somthing wrong in dll how come it's work from c#.and i dont have source code of dll.

ths

Madhu.

Posted

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

Posted

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 .

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
×
×
  • Create New...