java - Windows Mobile Bluetooth access on either Microsoft or Widcomm Stack -


i have java application running on windows mobile device. need able turn bluetooth on , off executing native code this. problem trying out on new device (the htc hd2) , native code doesn't work. reason hd2 device using widcomm bluetooth stack, whereas other device using microsoft stack.

i have found way of activating bluetooth on hd2 device using widcomm sdk. native code needs able run on device, somehow need able make decision @ runtime code run based on bluetooth stack present.

question 1: how can determine programmatically stack present?

question 2: if include header file required widcomm stack , try run on device doesn't use code fails. how can compile dll includes header file if widcomm dll exists?

i'm guessing can have dynamically:

  1. declare prototypes necessary widcomm functions in own code.
  2. use loadlibrary load widcomm dll.
  3. if loadlibrary call fails know you're on microsoft stack , can run standard microsoft stack functions.
  4. if loadlibrary succeeds you're on widcomm stack , can use widcomm functions.

it might bit messy depending on how many functions need widcomm header, can't statically compile in references functions, try , load , not find (which why you're seeing crash).

that's terrible bluetooth stack craziness exists on windows mobile well. thought confined desktop.


Comments

Popular posts from this blog

Cursor error with postgresql, pgpool and php -

delphi - ESC/P programming! -

c++ - error: use of deleted function -