5

I'm working on a legacy app that needs to be continued in VS 2003; I cannot effectively debug it, though, because when I try to run it, I get the following dialog:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Deploy

Choose the device to target. If the .NET Compact Framework is not already on the selected device, it will be deployed along iwth your application.

Pocket PC 2002 Emulator
Pocket PC Device
Windows CE .NET Device
Windows CE .NET Emulator (Default)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I am running this (VS 2003) in XP Mode (Virtual Machine) on Windows 7. I do not have a connection (from XP Mode) to the device - a Symbol/Motorola PDT 3090 - so I get, "Unable to connect" when trying to run/debug/deploy in VS 2003.

What has been the case up to now is the developer would build the binary, adding debug messages, and then copy the binary over to the device and run it. Rather than continue this method, I would prefer to be able to debug it from within VS 2003. Is there a way to do this? None of the options (Pocket PC 2002 Emulator, etc.) seem to work...the device is attached to the computer via a usb. The Emulators won't work because they don’t have the necessary hardware (barcode scanner). So I need to use one of the *Device options, but have not been able to connect the usb port to XP Mode.

Does anybody have any ideas on how to debug without the constant copying-and-replacing of binaries, and the use of "show message"?

UPDATE

Alternately, if I can't run the app from within VS 2003 / XP Mode as an emulator, it would also be fine to run it on the attached Motorola handheld, attached via usb cable from the cradle to the desktop computer; I prefer the former, for the debugging capabilities afforded, but even the latter would be better than my current predicament (copying the files to the handheld device, detaching it from the computer, attaching it to the belt printer, firing it up, testing and repeat ad nauseum ad infinitum). ASAP (within two hours), I will set a bounty on this question.

UPDATE 2

If I try to run from VS 2003 in an emulator, and select "Windows CE .NET Emulator (Default)", I get:

"Emulator for Windows CE will not run within another copy of Emulator for Windows CE. You just had to try, didn't you?"

?!? Is it saying this because I'm in a VM (XP Mode) session?

Then I select "OK" (the only option), and get, "There were deployment errors. Continue?" That trick never works; it even causes the build to fail (a rebuild fixes that, though).

UPDATE 3

Perhaps my problem with not being able to debug by connecting to the device itself is related to this msg I saw when booting up this morning (but I don't know what to do about it, IF this is the problem - do I need to search for a new driver for the Motorola MC3100?):

Devices or applications disabled.
Virtual PC/Windows CE Emulator will cause Windows to become unstable. Windows has prevented these drivers from loading. click here for more details.

The "more details" are:

Virtual PC/Windows CE Emulator 
Microsoft 

--------------------------------------------------------------------------------

Issue Description: 

    A driver is installed that causes stability problems with your system. This driver will be disabled. Please contact the driver manufacturer for an update that is compatible with this version of Windows. 

    Contact Information: 

    Web Site: http://go.microsoft.com/fwlink/?LinkId=26320
    Telephone: 1-800-936-5800

That link (http://go.microsoft.com/fwlink/?LinkId=26320) ended up as: "Internet Explorer cannot display the webpage"

UPDATE 4

There is some headway (or perhaps just false hope) on the connecting to the device front:

I have 4 USB ports on my desktop machine. I plugged the USB cable into the 3rd from the top for the first time a bit ago. It then said it was recognized, and ActiveSync was finally able to make a connection.

So I then tried deploying the app again. The fourth option (the default - C.E. Device Emulator) failed as always. So did the penultimate choice (C.E. device). The second option, though (Pocket PC device), seems to possibly be working.

However, I got a cryptic err msg that just said:

#183:

I dismissed that and since then (it's been a good ten minutes now), the bottom of the VS Output windows has been saying "Launching Application" (with a blinking cursor beneath it) and the task bar has been claiming "Deploy started..."

Whether that is really of any value, though, it doesn't appear to be, as I am just "stuck" there...

Kara
  • 6,115
  • 16
  • 50
  • 57
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
  • I've got a non-VM XP machine with MS ActiveSync 4.5 and it connects fine to that model of device. I assume it is a VM issue. – tcarvin Feb 05 '13 at 19:58
  • I would prefer to run it in an emulator rather than actually on the device while debugging, anyway. – B. Clay Shannon-B. Crow Raven Feb 06 '13 at 17:22
  • Any reason for that? If you have access to the hardware I would recommend developing and debugging against the device instead. – tcarvin Feb 06 '13 at 19:26
  • That's the problem: the XP Mode MV I have to use for development cannot "see" the usb port that connects to the handheld device. – B. Clay Shannon-B. Crow Raven Feb 06 '13 at 23:41
  • Got it, you are in a tough spot. Some versions of ActiveSync and devices supported wireless connections, but I think you had to create a partnership first and you cannot even do that without being cabled to the PC. – tcarvin Feb 07 '13 at 12:52
  • Out of curiosity, have you tried using the serial connection? The cradle does have a serial jack. – tcarvin Feb 07 '13 at 12:54
  • I suppose it's worth asking - why are you "stuck" with CF 1.0, and not able to move to at least CF 2.0? If you have to install the app on the device, why can't you install the app plus a newer runtime? This would allow you to move to Studio 2008 and past a load of the problems you seem to be up against in the last couple days. – ctacke Feb 07 '13 at 21:18
  • I'm not sure which version of CF I'm working with; I know it's Visual Studio 2003 and .NET 1.1. The device is running CE 1.10.0006. The setup has to coincide with what the customers have/use. – B. Clay Shannon-B. Crow Raven Feb 07 '13 at 22:11
  • I guess my points are: Most devices that can run CF 1.0 can run CF 2.0 - the PDT3090 is CE 5.0, so it could even run CF 3.5. If you have to deploy an app, you can probably deploy more DLLs, and CF 2.0/3.5 is just "more dlls". If you can use CF 2.0/3.5, Studio 2008 is a *way* better environment. By moving to Studio 2008, you could save loads of time and headache (and thereby money and schedule). CF 2.0 and 3.5 perform better than 1.0, so the app would likely work better as a bonus. – ctacke Feb 08 '13 at 16:25
  • This is the reason I was given why we need to stick with VS 2003: "The MC3090 (older device) only has .NET CF 1.0 on it. The update would require clearing enough room in the flash folder to actually get the files (space is very tight on that device)." I can verify that is true - I cannot even copy the 412 KB .exe into it for lack of space (the newer one is a MC3100 and so far has no problems that way). – B. Clay Shannon-B. Crow Raven Feb 08 '13 at 16:39
  • Have you successfully connected your mobile device to the XP Mode VM using Active Sync (within the VM)? (Note that this is not the same as connecting to your windows 7 host pc using WMDC) – PaulH Feb 12 '13 at 18:47
  • @PaulH: No, I haven't; have you got any pointers on doing that? If so, please add it as an answer and, if it works, the bounty will be over. – B. Clay Shannon-B. Crow Raven Feb 12 '13 at 19:00
  • @PaulH: When I try to connect to my device using MS ActiveSync (the device IS physically connected to the computer via a usb cable), I get "Your device was not connected." – B. Clay Shannon-B. Crow Raven Feb 12 '13 at 19:48
  • Have you followed the instructions in my answer? – PaulH Feb 12 '13 at 19:53

2 Answers2

2

Windows CE .NET Emulator (Default)

This should be the one you want, if you are running Windows CE.

The Barcode Reader takes the code and converts it to a string for you, so your code will never need to "decode" a barcode.

So, when you are testing your software using the CE Emulator, simply select the textbox you want to read the barcode to, and type that value in using your keyboard.

  • I've tried all four options, including Windows CE .NET Emulator (Default), but they all fail. I'm not worried about entering the value in the edit box, it's sending to the printer that I need to know - how does the printer know that "123456" is a barcode, and print a barcode, as opposed to just printing "123456"? I think I found the answer to that issue separately, though (have to send the correct CPCL strings to the Zebra QL 220). – B. Clay Shannon-B. Crow Raven Feb 06 '13 at 17:58
  • As you are finding, if you need a barcode to print, you'll need the driver for the specific printer (i.e. your Zebra QL 220). –  Feb 06 '13 at 18:04
  • @jp2code I disagree, when developing for devices like the MC3090 you can and should interact with the barcode reader SDK. That way you can control if scanning is available for the screen or field you are working on, what field the scanned data goes into, and perform different validations or logic based on the barcode prefix or symbology. – tcarvin Feb 06 '13 at 19:28
  • @ClayShannon If you get stuck with the printing, post another question. But first, go and download Label Vista from the Zebra site. – tcarvin Feb 06 '13 at 19:31
  • If barcodes are expected to follow certain patterns (serial and model numbers), then you only need one text field on the form. Let your code read the text and handle the input accordingly. –  Feb 06 '13 at 21:31
1

In your Windows 7 host PC's task bar, right click on the XP Mode VS2003 application. In the menu that appears select "Manage USB Devices".

Shows right-click menu

Select your Windows Mobile device and hit the "Attach" button. Your XP Mode PC should connect via ActiveSync. (This assumes you've installed ActiveSync on the XP Mode VM. If not, you should do that first.)

Try rebooting the virtual machine. (Not the same as closing and re opening it). If that doesn't work, try a different USB port. You may end up reinstalling XP mode.

See also: How to Access USB Devices in Windows Virtual PC for Windows 7

PaulH
  • 7,759
  • 8
  • 66
  • 143
  • There is a "Manage Virtual Machines" but no "Manage USB Devices" – B. Clay Shannon-B. Crow Raven Feb 12 '13 at 21:29
  • We must be looking at different things. When I right-click on an XP Mode application I get a menu like the one I added to my answer. Do you not see something like that? – PaulH Feb 12 '13 at 21:41
  • Mine differs in that the items are: Recent Virtual Machines Windows XP Mode ----------------------- Tasks Manage Virtual Machines ----------------------- Windows Virtual PC Pin this program to taskbar Close all windows – B. Clay Shannon-B. Crow Raven Feb 12 '13 at 22:08
  • Okay, you're opening the entire VM desktop instead of just the application. That's okay too. On the menu at the top of your desktop, you should see "Action", "USB", Tools", and "Ctrl+Alt+Del". Select "USB" and then the select your device. The word "Attach" next to your device name should change to "Release" indicating you are attached. – PaulH Feb 12 '13 at 22:14
  • Okay, I'll try that; the application itself wouldn't be there as I can't run it from VS 2003 (chicken-and-egg). Okay, tried it: That was one of my earliest attempts; the err msg I get is, "Could not attach the USB device. You can attach the USB device to a different USB port or restart the virtual machine and try again." – B. Clay Shannon-B. Crow Raven Feb 13 '13 at 00:03
  • This seems to be the root of your problem. I use pb5 (same vintage as vs2003) through an XP mode vm on win 7 x64 daily and it works fine. You may need to reinstall XP mode or your USB drivers. – PaulH Feb 13 '13 at 02:19
  • PB5 = Platform Builder 5. Used by OEMs to build the WinMo or Win CE operating system. By the way, is there any reason you need to run VS2003 from within the XP Mode VM? Does it not work directly in Win 7? – PaulH Feb 13 '13 at 14:33
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/24452/discussion-between-paulh-and-clay-shannon) – PaulH Feb 13 '13 at 14:40
  • Windows 7 does not support VS 2003 / .NET 1.1: http://social.msdn.microsoft.com/Forums/en/netfxsetup/thread/a96a09e1-eb5c-4938-b854-8004dcf9b496 http://social.msdn.microsoft.com/Forums/en/vssetup/thread/368334b0-f551-4f77-95a3-1abbeb2e8075 – B. Clay Shannon-B. Crow Raven Feb 13 '13 at 16:12