I am developing a project for Windows Mobile 6.5 MC75A Mobile computer. I connectd my MC75A Mobile computer to the Zebra printer(ZEBRA qln420) via Bluetooth.
I am developing application in vb.net.in my project i added PrinterCE.NetCF.dll and i copyed the same dll into windows folder in mobile device. in application print button click i given code like this:
Dim prce As PrinterCE
Try
'No License Key for evaluation
prce = New PrinterCE(PrinterCE.EXCEPTION_LEVEL.ABORT_JOB, "YOURLICENSEKEY")
prce.SelectPrinter(True)
prce.DrawText("Hello World")
prce.EndDoc()
Catch exc As PrinterCEException
prce.ShutDown()
MessageBox.Show("PrinterCE Exception", "Exception")
Finally
prce.ShutDown()
End Try
but this is not working fine ..throwing error.while clicking print button.how i can achieve this?
Did you try using the SDK from Zebra? It walks you through adding it to your project and has examples for connecting to and printing using BT.
https://www.zebra.com/us/en/products/software/barcode-printers/link-os/link-os-sdk.html
Related
I am having trouble with adding my Pos Printer to PosDM in Configurattion XML and with command line add device.
i had searched a lot about this but got nothing Useful
i had tried the command line add device like:
"posdm adddevice SWD\PRINTENUM{9475957E-9973-435B-AF15-4591F5938233} /type:PosPrinter /soname:"EPSON TM-T82 ReceiptSA4"
by using this i got "no SO found that matches!"
i also added the logical name of device in configuration.xml:
but when i use the command "Posdm listdevices" i doesnt show me my printer
"SWD\PRINTENUM{9475957E-9973-435B-AF15-4591F5938233}" is the DevicePath as a standard Windows desktop printer.
EPSON OPOS/OPOS for.NET should not support that mode.
If it is visible on the device manager, it is a usage mistake.
Disconnect the printer, uninstall the printer driver, use the OPOS ADK for.NET, see Appendix-C in the appropriate printer manual, change the hardware settings, and reinstall the device driver (USB serial?) .
Configurattion XML of PosDM settings should be set in the GUI by running the SetupPOS tool of EPSON OPOS for.NET as an administrator instead of the command line.
For details, refer to the SetupPOS User's Reference Manual.
To set the default printer in code behind try:
app.ActivePrinter = "EPSON TM-T82 ReceiptSA4";
So I am trying to connect to a Polar H7 Heart Rate Monitor, and I need to use a WPF application to do it. I'm using Windows 10.
Now I have done this with a UWP application already and it works perfectly, but I'd like to use WPF (if it is possible) instead to do the same.
I found this post on how to use Windows 10 APIs in WPF/winforms/etc and thought perfect, that's what I need. I successfully added the Bluetooth API to my WPF project and threw in the code that was working for my UWP project, but it doesn't work.
Here's a snippet of my code up to where it stops working:
DeviceInformation _devicePolar = null;
string StatusInformation;
string StatusInformation2;
var devices = await DeviceInformation.FindAllAsync(GattDeviceService.GetDeviceSelectorFromUuid(GattServiceUuids.HeartRate));
foreach(var d in devices)
{
Debug.WriteLine(d.Name + " " + d.Id);
}
if (null == devices || devices.Count <= 0) return;
foreach (var device in devices.Where(device => device.Name == "Polar H7 DCB16C16"))
{
_devicePolar = device;
StatusInformation = string.Format("Found {0}", _devicePolar.Name);
break;
}
if (_devicePolar == null) return;
var service = await GattDeviceService.FromIdAsync(_devicePolar.Id);
if (service == null) return;
Now, this call
await GattDeviceService.FromIdAsync(_devicePolar.Id)
is returning null. I was actually having the same problem when I made the UWP application and I found out it was because I forgot to throw in this
<Capabilities>
<Capability Name="internetClient" />
<DeviceCapability Name="bluetooth" />
</Capabilities>
Into my manifest file. Once I put that in (on my UWP application) it worked fine. But there seems to be no equivalent place for this piece in a WPF application. Now going back to the blog post on how to add Win 10 libraries to WPF, this bit seems to be telling me that was the case all along:
The second set of APIs that you can’t use are ones that depend on an app’s package identity. UWP apps have package identities while PC software does not. Package identity information can be found in the app manifest file.
And looking further into the Microsoft topic linked in the post it does specify about Bluetooth that "Not all APIs are currently supported for packaged apps." Which is terribly non-specific.
Also should mention, before trying this I tried to use the 32feet library, but my device was not showing up at all while other devices (not LE) were, so I am assuming that 32feet just doesn't support BTLE. I found this asking the same about 32feet and that is what led me to try what I have detailed above instead, but I'm still not 100% clear on whether or not I can simply use 32feet to connect to BTLE devices.
So my question is, am I right that what am I trying to do (WPF application using Windows 10 API to connect to Bluetooth device) can't currently be done? If not, what am I doing wrong?
Update after two years the question posted: I think there's still no library supporting WPF Bluetooth LE. A pretty straight forward proof is that, Windows settings, which is under UWP, supports Bluetooth LE devices, while Control Panel on Windows 10 doesn't.
The only solution I can come up with now is buying a Bluetooth dongle which has virtual COM port feature, so ideally I can talk to the BLE device like using serial connection. Haven't tested yet, will update later if this works.
The Application and Voice commands are not shown in Cortana when typing "what can I say?"
I am attempting to use Voice Commands in the Foreground with Cortana and am running the Cortana Voice Command Sample and have been unable to get Cortana to show the application or Open / Perform Voice commands for the application named "AdventureWorks".
I am using the Cortana Voice Command Sample which I am running from Visual Studio 2015 locally on Windows 10 in debug. According to this link this should create an unpackage version of the sample on my local machine that I should be able to see from the Start screen which I cannot.
I have activated Microphone under the capabilities of the app and included the en-GB resources.resw file and changed the Package.appxmanifest to the Default language of en-GB to match in an attempt to ensure that Cortana's language matches with the application to eliminate that as a potential issue.
Here is the link showing that a unpackaged version of the application should be visible in the Start screen after running the app from VS (with or without debugging):
How to deploy a Metro App to the Desktop?
Cortana Voice Commands Sample:
https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CortanaVoiceCommand
Note:
The application is standard apart from me including the en-GB resource file, changing the package.appxmanifest location to en-GB and adding Microphone to the capabilities of the application. Developer mode has also been enabled on my pc.
Update: There are no exceptions happening when adding the vcd.xml to the VoiceCommandDefinitionManager.. It looks like it should be working..
I have also noticed that when running the sample I cannot see the picture of London or the microphone icon saying "listening" like in this video: https://channel9.msdn.com/Events/Build/2015/3-716 at 04:16
At this time google searches for "application not showing in Cortana" does not show any useful results.
Has anyone else had any luck getting this sample to work? or similar issues? Also are you using the en-GB version?
Any help or ideas would be appreciated
I have successfully tested the AdverntureWorks sample using en-US.
Also I have developed another sample regarding Cortana Foreground.
Basically I have created the VCD and then installed it:
protected async override void OnLaunched(LaunchActivatedEventArgs e)
{
...
// Install the VCD
try
{
StorageFile vcdStorageFile = await Package.Current.InstalledLocation.GetFileAsync(#"HomeControlCommands.xml");
await VoiceCommandDefinitionManager.InstallCommandDefinitionsFromStorageFileAsync(vcdStorageFile);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("There was an error registering the Voice Command Definitions", ex);
}
}
And then handled the activation:
protected override void OnActivated(IActivatedEventArgs e)
{
// Handle when app is launched by Cortana
if (e.Kind == ActivationKind.VoiceCommand)
{
VoiceCommandActivatedEventArgs commandArgs = e as VoiceCommandActivatedEventArgs;
SpeechRecognitionResult speechRecognitionResult = commandArgs.Result;
string voiceCommandName = speechRecognitionResult.RulePath[0];
string textSpoken = speechRecognitionResult.Text;
IReadOnlyList<string> recognizedVoiceCommandPhrases;
System.Diagnostics.Debug.WriteLine("voiceCommandName: " + voiceCommandName);
System.Diagnostics.Debug.WriteLine("textSpoken: " + textSpoken);
switch (voiceCommandName)
{
...
}
}
}
The detailed process is described here
I had exactly same issue.
Make sure you have microphone capabilities turned on for your Package.appxmanifest otherwise it doesn't work.
Tu turn it on select your Package.appxmanifest in Solution Explorer go to Capabilities and check Microphone.
More info: http://jamescroft.co.uk/blog/universal-windows-8-dev/how-to-get-your-apps-cortana-ready/
Hope this helps,
damtur
I had the same problem as you, as noted by DevEnitly, if your region is set, for example, to UK and in your VCD file your CommandSet's language is en-US it won't work, simply changing the CommandSet's language to us-gb (or whatever language fits your region) should do the trick (it did for me), also note that, if you want to support different languages you should add more CommandSets. Hope this solve your problems.
I have a Zebra GK420t printer plugged in via USB to a PC.
The PC is running MS Visual Studio.
I have created a new Project -> Other Languages -> Visual C# -> Smart Device -> Windows Mobile 6 Professional project.
I have created a class:
using System;
using System.Collections.Generic;
using System.Text;
using ZSDK_API.Comm;
using ZSDK_API.ApiException;
namespace Zebra2
{
class CTest
{
static void Main(string[] args)
{
try
{
// Instantiate connection for ZPL USB port with a given port name.
ZebraPrinterConnection thePrinterConn = new UsbPrinterConnection("USB001:");
// "LPT" is the default prefix for most Windows CE/Mobile USB ports
// Open the connection - physical connection is established here.
thePrinterConn.Open();
// This example prints "This is a ZPL test." near the top of the label.
String zplData = "^XA^FO20,20^A0N,25,25^FDThis is a ZPL test.^FS^XZ";
// Send the data to printer as a byte array.
thePrinterConn.Write(Encoding.Default.GetBytes(zplData));
// Close the connection to release resources.
thePrinterConn.Close();
}
catch (ZebraPrinterConnectionException e)
{
// Handle communications error here.
Console.Write(e.StackTrace);
}
}
}
}
In Visual, I added a Reference for the ZSDK_API.dll successfully.
When I try to add a reference for the ZebraUsb.dll, I get the error message:
A reference to 'ZebraUsb.dll' couldn't be added.
If I build the code without the reference for this dll, the build is successful.
But at runtime, an exception is raised on the line where the Open() method is invoked.
The error message is:
An unhandled exception of type ZSDK_API.ApiException.ZebraGeneralException' occurred in ZSDK_API.dll.
Additional information: Can't find PInvoke DLL 'ZebraUsb.dll'.
Second problem:
I'm not sure what argument I should give to the UsbPrinterConnection constructor.
On the PC, the port for the printer is USB001.
I'm not sure how it's being seen from the emulator.
The printer can also be seen as a share via \\PC\printer.
Can you help me?
Best regards.
For all USB printers on Windows PC you normally have to add the printers USB driver first. This driver can be a USB Serial one or something special. Such drivers do not exist for Windows Mobile.
The Zebra GK420t is a desktop barcode label printer and not designed to be used from Windows Mobile.
You may install the printer on your Windows PC and share it over the network, either using Windows Printer Sharing or TCP/IP printer services (LPR). Then you might write an application that sends print commands over the network to this shared connection.
Zebra also offers a range of portable printers and a Windows Mobile SDK. These may match your needs more than the GK420t.
I want to connect a single wiiMote to my app using WiiMoteLib, but I want the connection done internally ie. the user has only to run the app (and should have no need to connect the wiiMote with windows wizard or bluesoleil). The app is in C# and the language cannot be changed.
Thanks!
Does 32feet.NET do the job?
BluetoothAddress addr = ... address from discovery or known address...
var dev = new BluetoothDeviceInfo(addr);
dev.SetServiceState(BluetoothService.HumanInterfaceDevice, true); // this line!
You may also need to handle pairing, perhaps using BluetoothWin32Authentication and handling its callback, see http://32feet.codeplex.com/wikipage?title=Bluetooth%20Security and http://32feet.codeplex.com/wikipage?title=BluetoothWin32Authentication
There is an example of how to do this here using the Microsoft Bluetooth API and the HID API:
http://www.richlynch.com/code/wiipair
It works quire well.
Its in C++, but its pretty easy to convert to C#.