?
=?iso-8859-1?Q?Ibai_Pe=F1a?=
Hi,
I´m trying to use Bluetooth API from my project to activate it.
I have read the API documentation from here, and try to get it with this code:
//Define the method
[DllImport("BthUtil.dll",CharSet=CharSet.Unicode, SetLastError=true)]
internal static extern int BthSetMode( System.UInt32 dwMode );
//Bluetooth uses
int result = BthSetMode((System.UInt32)0); //-> returns 0
int result = BthSetMode((System.UInt32)1); //-> returns 1164
int result = BthSetMode((System.UInt32)2); //-> returns 1164
int result = BthSetMode((System.UInt32)3); //-> returns 87 if param >2
1- Looking the returned values, I think that 87 is that the value is not valid. I think that 0,1 and 2 values are the enumeration values. The code that I posted executes properly, but there is no changes in the blueetooth. Where can I found info about the returned values?
In the API documentation only says:"Returns ERROR_SUCCESS on success, or an error code describing the error on failure."
2- This method is supposed to take an enumeration value, but I cant define it properly. How did I define this enumeration?
3- Has somebody succedd to set the blueetooth on from its program ?
Any help would be appreciated.
I´m trying to use Bluetooth API from my project to activate it.
I have read the API documentation from here, and try to get it with this code:
//Define the method
[DllImport("BthUtil.dll",CharSet=CharSet.Unicode, SetLastError=true)]
internal static extern int BthSetMode( System.UInt32 dwMode );
//Bluetooth uses
int result = BthSetMode((System.UInt32)0); //-> returns 0
int result = BthSetMode((System.UInt32)1); //-> returns 1164
int result = BthSetMode((System.UInt32)2); //-> returns 1164
int result = BthSetMode((System.UInt32)3); //-> returns 87 if param >2
1- Looking the returned values, I think that 87 is that the value is not valid. I think that 0,1 and 2 values are the enumeration values. The code that I posted executes properly, but there is no changes in the blueetooth. Where can I found info about the returned values?
In the API documentation only says:"Returns ERROR_SUCCESS on success, or an error code describing the error on failure."
2- This method is supposed to take an enumeration value, but I cant define it properly. How did I define this enumeration?
3- Has somebody succedd to set the blueetooth on from its program ?
Any help would be appreciated.