Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
windows: fixes "class not registered" error
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrebnov authored and Vladimir Kotikov committed Apr 8, 2015
1 parent eabae9e commit 96284b3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/windows/BarcodeScannerProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ module.exports = {
*/
function startBarcodeSearch(width, height) {

reader = new WinRTBarcodeReader.Reader(capture, width, height);
reader = new WinRTBarcodeReader.Reader();
reader.init(capture, width, height);
reader.readCode().done(function (result) {
destroyPreview();
success({ text: result && result.text, format: result && result.barcodeFormat, cancelled: !result });
Expand Down
Binary file modified src/windows/lib/WinRTBarcodeReader.winmd
Binary file not shown.
10 changes: 5 additions & 5 deletions src/windows/lib/WinRTBarcodeReader/WinRTBarcodeReader/Reader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@ public sealed class Reader
/// <summary>
/// Data reader, used to create bitmap array.
/// </summary>
private readonly BarcodeReader barcodeReader;
private BarcodeReader barcodeReader;

/// <summary>
/// The cancel search flag.
/// </summary>
private readonly CancellationTokenSource cancelSearch;
private CancellationTokenSource cancelSearch;

/// <summary>
/// MediaCapture instance, used for barcode search.
/// </summary>
private readonly MediaCapture capture;
private MediaCapture capture;

/// <summary>
/// Encoding properties for mediaCapture object.
/// </summary>
private readonly ImageEncodingProperties encodingProps;
private ImageEncodingProperties encodingProps;

/// <summary>
/// Flag that indicates successful barcode search.
Expand All @@ -69,7 +69,7 @@ public sealed class Reader
/// <param name="capture">MediaCapture instance.</param>
/// <param name="width">Capture frame width.</param>
/// <param name="height">Capture frame height.</param>
public Reader(MediaCapture capture, uint width, uint height)
public void Init(MediaCapture capture, uint width, uint height)
{
this.capture = capture;
encodingProps = ImageEncodingProperties.CreateJpeg();
Expand Down

0 comments on commit 96284b3

Please sign in to comment.