CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2008
    Posts
    3

    error with Bluetooth and RFCOMM sockets

    Hello. I'm trying to construct a simple program that connects to a bluetooth device using RFCOMM sockets. I've stumbled on a page that has some sample code: http://www.lenholgate.com/archives/000102.html

    I have installed Windows SDK and Visual Studio (express edition). The problem is that if I compile my program, the compiler dumps a bunch of errors. I've come to the conclusion that the header Ws2bth.h is giving those errors even if I write an "empty" C++ program and only include the header. Is there a reaon wy this is happening? Do I need to turn on a switch to the compiler. Please help.

    Greets,
    Luka

  2. #2
    Join Date
    Nov 2002
    Location
    California
    Posts
    4,556

    Re: error with Bluetooth and RFCOMM sockets

    Your #include files are probably included in the wrong order. Try it in the following order:

    Code:
    #include <Winsock2.h>
    #include <Bthsdpdef.h>
    #include <Ws2bth.h>
    #include <BluetoothAPIs.h>
    See "Using Bluetooth" at http://msdn.microsoft.com/en-us/libr...58(VS.85).aspx which explains this ordering of includes.

    Mike

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured