Author Topic: Transport not available error when running from ActiveX browser plugin  (Read 24186 times)

Jov

  • Guest
Hi Mike,

I am attempting to write a browser plugin using the firebreath framework. My plugin works perfectly from Chrome and Firefox but it fails in IE. The error is "Specified transport is not available". As far as I can tell, the only difference between those two cases is that FF and chrome use NSAPI and IE uses ActiveX plugins.

I have read the FAQ: wcl2wbt.dll is present in the plugin installation dirextory. The plugin uses lazy loading for WCL and preloads WCL2WBT and WCL from the plugin installation directory by default (in every browser). Attaching a debugger to IE shows the correct DLLs to be loaded.

Do you have any idea why this might be the case?

This is all with FF (18a2) , Chrome (23.0.1271.64 m) and IE8 and under WinXP Service Pack 3.

Thank you for any suggestions.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: Transport not available error when running from ActiveX browser plugin
« Reply #1 on: November 13, 2012, 08:26:40 PM »
Hi,

I guess it is because it can not find wcl2wbt.dll (which is required for WidComm support). Try to place the DLL into system directory.

Jov

  • Guest
Re: Transport not available error when running from ActiveX browser plugin
« Reply #2 on: November 14, 2012, 10:52:31 AM »
Hi Mike,

do you do something special when loading wcl2wbt.dll ? Both the WCL DLLs are found and preloaded manually by my plugin code and when WCL.dll is actually loaded and tries to load WCL2WBT.dll, it is already in memory. I have tested this both with and without wcl.dll and wcl2wbt.dll in the system32 directory.

Best regards

Jov

  • Guest
Re: Transport not available error when running from ActiveX browser plugin
« Reply #3 on: November 14, 2012, 11:29:51 AM »

Could this be due to ActiveX plugins having limited rights? "Low integration mode" ?

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: Transport not available error when running from ActiveX browser plugin
« Reply #4 on: November 14, 2012, 11:58:14 AM »
Hi,

WCL uses LoadLibrary to load wcl2wbt.dll. However, then it calls WidComm initialization routine and if it fails then WidComm will not be available even wcl2wbt.dll is loaded. Unfortunately I don't know why it may appears with IE plugin but by our experice WidComm with new wcl2wbt.dll (default one used by WCL) does not work in services.

Jov

  • Guest
Re: Transport not available error when running from ActiveX browser plugin
« Reply #5 on: November 14, 2012, 02:32:33 PM »
Thank you.

You might be interested in the following code snippet:

Code: [Select]
// first we retrieve the path of wcl DLL.
if (!GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
                            (LPCSTR) &_some_function_from_wcl_dll_,  &hmod))
       {
  throw new exception ("GetModuleHandle failed");
       }

DWORD dwLen = GetModuleFileName(hmod, szPath, MAX_PATH);

        // build path for wcl2wbt dll based on wcl.dll path.
wstring s = szPath;
wstring path = s.substr(0, s.find_last_of ('\\') + 1);
wstring wcl2wbtdllpath = path + L"wcl2wbt.dll";

// now we load the wcl2wbt dll
mWCL2WBT = LoadLibrary (wcl2wbtdllpath.c_str());

With this code, the wcl dll will always find the wcl2wbt.dll if it is in the same directory as wcl.dll, whatever that directory is and regardless of how wcl.dll is loaded (with default search path or explicit path). If this fails, you can always fall back to loading it without absolute path, of course.


Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: Transport not available error when running from ActiveX browser plugin
« Reply #6 on: November 14, 2012, 02:38:50 PM »
Thank you for your code! It's very useble!

Jov

  • Guest
Re: Transport not available error when running from ActiveX browser plugin
« Reply #7 on: November 14, 2012, 03:10:05 PM »
About the original topic: I switched back to the old wcl2wbt and now the first time, the radio is detected and discovery started. I get an error during discovery and after that I get the transport not available error and later on, only "no radios available".

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3675
  • Karma: 1000
    • Wireless Communication Libraries
Re: Transport not available error when running from ActiveX browser plugin
« Reply #8 on: November 14, 2012, 03:15:54 PM »
Can you send me your ActiveX code (project) to mike@btframework.com. I'll take a look on it what can be wrong there (as far as I rememebr it doesn't work with IE?).

Jov

  • Guest
Re: Transport not available error when running from ActiveX browser plugin
« Reply #9 on: November 14, 2012, 04:02:15 PM »
Thank you, I'll ask permission for that and send you the code and all the issues I've seen so far.

 

Sitemap 1 2 3 4 5 6 7