Author Topic: Demo wcl.dll fails wclAPI load call in Windows Service application  (Read 4810 times)

Offline rameshwar

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
I am evaluating wcl for my solution. I downloaded WCL_Developer_Demo_NET 6.10.4.0. I created a Windows Service application with it. wcl.dll fails in wclAPI Load call. What can be the reason?

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3053
  • Karma: 1000
    • Soft Service Company
Re: Demo wcl.dll fails wclAPI load call in Windows Service application
« Reply #1 on: June 01, 2012, 09:36:21 AM »
Hello,

Please, check this page: http://www.btframework.com/howto.htm#redist
there described which files have to be referenced from your application when you use WCL.

Also, there is ServiceDemo in the WCL package, check that demo out too. It should help you to find a problem.

Offline rameshwar

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
Re: Demo wcl.dll fails wclAPI load call in Windows Service application
« Reply #2 on: June 01, 2012, 11:01:51 AM »
Installed WCL in  C:\Users\rameshwar\Documents\WCL
Built ServiceDemo.exe in ..\NET\demo\c#\40\ServiceDemo\bin\x86\Debug
Installed using installutil - Installed successfully
Started WclDemoService using Services.msc - Started successfully.

In Thread Proc:
Wnd = new ServiceWnd();
System.IO.File.AppendAllText("C:\\ServiceDemo.txt", "ServiceWnd constructed."); // Success

wclAPI = new wcl.wclAPI();
wclAPI.AfterLoad += new EventHandler(wclAPI_AfterLoad);
System.IO.File.AppendAllText("C:\\ServiceDemo.txt", "wcl.wclAPI constructed."); // Success

wclAPI.Load();
System.IO.File.AppendAllText("C:\\ServiceDemo.txt", "wclAPI.Load was called."); // Never called

Never reaches Application.Run

I am running Windows 7. Changed serviceProcessInstaller Account from LocalService to LocalSystem, no change in behavior.

Thank you.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3053
  • Karma: 1000
    • Soft Service Company
Re: Demo wcl.dll fails wclAPI load call in Windows Service application
« Reply #3 on: June 01, 2012, 01:22:16 PM »
Hello,

Thank you for so detailed information. We will check this problem and back to you shortly with solution/fixes.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3053
  • Karma: 1000
    • Soft Service Company
Re: Demo wcl.dll fails wclAPI load call in Windows Service application
« Reply #4 on: June 01, 2012, 03:19:07 PM »
We tryed to reproduce the issue but it works on our side. However, we used MS BT drivers. Which BT driver do you use?

Offline rameshwar

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
Re: Demo wcl.dll fails wclAPI load call in Windows Service application
« Reply #5 on: June 01, 2012, 06:26:02 PM »
Should it matter when I was able to compile BluetoothDiscoveryDemo.exe and run successfully?

When I run BluetoothDiscoveryDemo, a demo dialog pops and then the outputs are as following-

Radios- API: baMicrosoft  Address: (EC:55:F9:D8:38:DC)  Connectable: True  Discoverable: True Name: RAMESHWAR-PC

Devices- (D0:DF:C7:56:1A:c9) ClassOfDevice: 5767692 Name: GT-S5670 Paired: True RSSI: Error: 4

Anyways, below is my Device Manager report:
-----------------------------------------------------
Broadcom Bluetooth 2.1 USB - Device type: Bluetooth Radios  Manufacturer: Broadcom  Location: Port_#0004.Hub_#0004
Radio Information - Address: (EC:55:F9:D8:38:DC), Manufacturer Id: 15, HCI version 5.472 LMP version 5.16899
Driver - Driver Provider: Broadcom Corporation, Driver Date: 13-12-2010, Driver Version: 6.4.0.1200

Microsoft Bluetooth Enumerator - Device type: Bluetooth Radios  Manufacturer: Microsoft,  Location: on Broadcom Bluetooth 2.1 USB
Driver - Driver Provider: Microsoft,  Driver Date: 21-06-2006, Driver Version: 6.1.7600.16805

Why will the same setup work for Windows Application but not for Windows Service? In my opinion this could only be related to Message Pump and Interactive Desktop issue and presumably WCL is not suitable for Windows Service apps? What do you say?

Did you try to reproduce with Demo DLL that has a demo dialog popup?

Thank you.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3053
  • Karma: 1000
    • Soft Service Company
Re: Demo wcl.dll fails wclAPI load call in Windows Service application
« Reply #6 on: June 01, 2012, 07:39:03 PM »
Did you try to reproduce with Demo DLL that has a demo dialog popup?

You are absolutly right! This cause the problem as in service it can't show Nag-screen and service stops on wclAPI.Load. We tested only with full version and as tryed the demo one faced the same problem.

Unfortunately we don't have an idea how to avoid this right now so the better way I think is if you send me an e-mail to mike@btframework.com and i'll send you full version for your tests.

Offline rameshwar

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
Re: Demo wcl.dll fails wclAPI load call in Windows Service application
« Reply #7 on: June 01, 2012, 09:29:15 PM »
I am extremely impressed with your response. Thank you for your help and support.

I have sent you Email.

Thank you.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3053
  • Karma: 1000
    • Soft Service Company
Re: Demo wcl.dll fails wclAPI load call in Windows Service application
« Reply #8 on: June 02, 2012, 06:14:26 AM »
Hello,

I have just sent an answer with the link to the full version.

Offline rameshwar

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
Re: Demo wcl.dll fails wclAPI load call in Windows Service application
« Reply #9 on: June 03, 2012, 07:44:04 PM »
Thank you.

The full version is working successfully inside a Windows Service. To use as part of Windows Service application I needed to do two things - (1) The service must be set to Log on as Local System Account and not as Local Service (2) Be careful about not using wclShowError, which probably pops open a MessageBox.

I am continuing with my tests and hoping the tests to be successful.


Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3053
  • Karma: 1000
    • Soft Service Company
Re: Demo wcl.dll fails wclAPI load call in Windows Service application
« Reply #10 on: June 03, 2012, 08:45:30 PM »
Hello,

That's great news that it works on your side.

You can use wclErrors.wclGetErrorMessage(int iError) function to get error code description and log it. If it returns empty string than no error appears.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3053
  • Karma: 1000
    • Soft Service Company
Re: Demo wcl.dll fails wclAPI load call in Windows Service application
« Reply #11 on: June 26, 2012, 09:41:14 AM »
Hello,

Just wanted to ask how is you tests going?

Offline rameshwar

  • Newbie
  • *
  • Posts: 15
  • Karma: 0
Re: Demo wcl.dll fails wclAPI load call in Windows Service application
« Reply #12 on: June 27, 2012, 07:59:40 AM »
Excellent, no issues until now. Hoping to be completing tests in next two weeks. Until now tested with Bluetooth v2.3 and v3 devices, will test with more devices soon.  Thank you.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3053
  • Karma: 1000
    • Soft Service Company
Re: Demo wcl.dll fails wclAPI load call in Windows Service application
« Reply #13 on: June 27, 2012, 08:46:40 AM »
That's great news. Let me know if you need anything else.

 

Sitemap 1 2 3 4 5 6 7 8 9