T
Tim
I'm writting a chat program in C# to use between two compaq ipaq's. To
accomplish this, I use 4 functions of coredll.dll to use COM 7 to read and
COM write to read from the bluetooth-connection:
extern static uint CreateFile( string lpFileName, uint dwDesiredAccess, uint
dwShareMode, uint lpSecurityAttributes, uint dwCreationDispostion, uint
dwFlagsAndAttributes, uint hTemplateFile );
extern static bool ReadFile( uint hFile, byte[] lpBuffer, uint
nNumberOfBytesToRead, ref uint lpNumberOfBytesRead, ref uint lpOverlapped );
extern static bool WriteFile( uint hFile, byte[] lpBuffer, uint
nNumberOfBytesToWrite, ref uint lpNumberOfBytesWritten, bool lpOverlapped );
extern static bool CloseHandle( uint hObject );
The problem is, when I write on the one device, I don't receive anything on
the other device. The program won't go past the ReadFile function in the
listen-thread. The function call is like this:
private void ReceiveLoop(){
byte[] inbuf = new byte[5];
uint overlap = 0;
do
{
keepLooping = ReadFile( inFileHandler, inbuf, (uint)inbuf.Length, ref
numReadWrite, ref overlap );
if( keepLooping )
mrh( ByteArrayToString( inbuf ) );
}while( keepLooping );
}
Thanks,
Tim.
accomplish this, I use 4 functions of coredll.dll to use COM 7 to read and
COM write to read from the bluetooth-connection:
extern static uint CreateFile( string lpFileName, uint dwDesiredAccess, uint
dwShareMode, uint lpSecurityAttributes, uint dwCreationDispostion, uint
dwFlagsAndAttributes, uint hTemplateFile );
extern static bool ReadFile( uint hFile, byte[] lpBuffer, uint
nNumberOfBytesToRead, ref uint lpNumberOfBytesRead, ref uint lpOverlapped );
extern static bool WriteFile( uint hFile, byte[] lpBuffer, uint
nNumberOfBytesToWrite, ref uint lpNumberOfBytesWritten, bool lpOverlapped );
extern static bool CloseHandle( uint hObject );
The problem is, when I write on the one device, I don't receive anything on
the other device. The program won't go past the ReadFile function in the
listen-thread. The function call is like this:
private void ReceiveLoop(){
byte[] inbuf = new byte[5];
uint overlap = 0;
do
{
keepLooping = ReadFile( inFileHandler, inbuf, (uint)inbuf.Length, ref
numReadWrite, ref overlap );
if( keepLooping )
mrh( ByteArrayToString( inbuf ) );
}while( keepLooping );
}
Thanks,
Tim.