Author Topic: Adding a Window Mesage Loop to thread to use wcl  (Read 1972 times)

Offline bimyers

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Adding a Window Mesage Loop to thread to use wcl
« on: April 09, 2010, 08:59:12 PM »
I am currently trying to create library that allows two Bluetooth devices to communicate with each other through two-way communication using wcl. However, I have hit a bit of a snag stemming from the fact that wcl needs a Windows message loop on its thread to function correctly. I have looked at some of the posts and using the ServiceDemo example I have been able to let the two devices discover each other. However the program fails to authenticate using the OnPINRequest. Is there some way to either run wcl without calling Application.Run() or can I create a class or thread that will run all Wcl requests (using Application.Run()) without effecting the rest of the project?

BenjaminI. Myers

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3055
  • Karma: 1000
    • Soft Service Company
Re: Adding a Window Mesage Loop to thread to use wcl
« Reply #1 on: April 09, 2010, 09:10:36 PM »
Hi,

Unfortunately there is no way (in .NET) to skip Application.Run() call. However, it is possible to any unmanaged language (like C++/Delphi). Internaly WCL based on Windows messages and some Bluetooth stack require Windows Messages as well. So there is no way to use WCL without running message loop.

Offline bimyers

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: Adding a Window Mesage Loop to thread to use wcl
« Reply #2 on: April 12, 2010, 04:39:00 PM »
Ok, if I cannot skip Application.Run is there an example of connecting to a device (with PIN Authentication) using WCL in a console application. (Note SericeDemo covers discovery but using this example I cannot seem to create a functioning connection)

Thanks in advance

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3055
  • Karma: 1000
    • Soft Service Company
Re: Adding a Window Mesage Loop to thread to use wcl
« Reply #3 on: April 12, 2010, 06:09:05 PM »
Hello,

Unfortunatelly WCL does not include such demo. If you need one we can prepare some code for you. But it will cost some money as we do not teach how to develop on specific language. This task looks as not WCL specific one.

 

Sitemap 1 2 3 4 5 6 7 8 9