Smart Device Programming with Visual Studio .NET (December 13, 2005)

Please note: Portions of this transcript have been edited for clarity

mikefos [MSFT] (Moderator):
Welcome to today’s MVP-hosted chat. Our chat today covers the broad topic of Smart Device Programming with Visual Studio .NET! We are pleased to welcome our Experts for today’s chat. I will have them introduce themselves now.

Introduction:

Ginny Caughey:
Hi, I'm Ginny Caughey. My company provides vertical market solutions to the solid waste industry on mobile and desktop computers.

tacke_MVP:
Hi, I'm Chris Tacke - cofounder of OpenNETCF

PeterFoot:
Hi I'm Peter Foot of In The Hand and OpenNETCF

DoobloDev:
Hi I assaf Kezurer from Dooblo

Sandeep (Expert):
Q: I am using VS 2003 and programming for .netcf  app for WindowsCE 4.2, can I upgrade to upgrade to vs 2005(I know .netcf 2.0 is not support in 4.2, but still like to use vs2005 if possible). Can VS 2005 still target .netcf 1.0 devices?
A: Yes. VS 2005 can target 1.0 devices

mikefos [MSFT] (Moderator):
Q: I'm using VS 2003 and programming for .netcf app for WindowsCE 4.2, can I upgrade to vs 2005(I know .netcf 2.0 is not support in 4.2, but still like to use vs2005 if possible). Can VS 2005 still target .netcf 1.0 devices?
A: Yes, Studio 2005 can create CF 1.0 apps. It only supports PPC 03 and WM05

Sandeep (Expert):
Q: Is it possible to develop both native and managed code for Windows Mobile 5 without using Visual Studio 2005?
A: VS 2005 is the supported way for developing native and managed code .

mikefos [MSFT] (Moderator):
Q: Is it possible to develop both native and managed code for Windows Mobile 5 without using Visual Studio 2005?
A: The CF 2.0 compiler is there is the free SDK, so you can command-line build. For native apps, you can use the eVC 4.0 compiler

PeterFoot:
Q: Is it possible to develop both native and managed code for Windows Mobile 5 without using Visual Studio 2005?
A: I'm not aware of a solution to develop for WM5.0 with native code without Visual Studio (The SDK requires it to install). For managed code you can compile from the command line with the .NET v2.0 SDK

Sandeep (Expert):
Q: Can I use eVC4.0 compiler to build WM5.0 application?
A: No. It is not supported

Ginny Caughey:
Q: Are there plans for integration of PB with vs.2005 like IDE?
A: Nothing has been announced yet for a future version of PB.

stevenpr_MSFT (Expert):
Q: Is there anyway in VS 2005 to force a dependency (e.g. of a 3rd party assembly I'm referencing) to rebind to a newer version of an assembly assuming it has the same symbols, etc)?
A: Yes. Version 2 of .Net CF (the version that ships with VS2005) supports the "assembly binding redirects" tags in application configuration files just like the full .Net Framework does.

mikefos [MSFT] (Moderator):
Q: Can I use eVC4.0 compiler to build WM5.0 application?
A: Yes, eVC 4.0 can generate code compatible with WM 5.0 - you just can't debug.

PeterFoot:
Q: Is native code development for Windows Mobile regarded as something that is only for professional developers and not for hobbyists? If I'm not wrong you can't you the Express edition either to develop for Windows Mobile?
A: None of the VS Express editions support device development.

Ginny Caughey:
Q: Is native code development for Windows Mobile regarded as something that is only for professional developers and not for hobbyists? If I'm not wrong you can't you the Express edition either to develop for Windows Mobile?
A: True, you can't use the Express editions to develop mobile apps, but that doesn't mean that mobile development is only for professionals. As I understand it, it was mainly a size/space decision.

BarryBo [MSFT] (Expert):
Q: When using the emulator in VS 2005 and attempting to test network connectivity, I always see a successful connect on a socket, despite the remote host not listening on that port. Is the activeSync acting as a proxy and accepting' the applications connect?
A: Most likely. ActiveSync's network emulation isn't 100% accurate.

tacke_MVP:
Q: Is there any recommended easy method for installation?  I have used InstallShield X in the past but this is buggy under VS 2005.
A: I need to interop with an existing library that takes a file path/name as input to process data. I have the data in a memory buffer. Is there a way to pass the data without writing it to an actual file? a I assume you are using PInvoke to call a method in an existing native dll? If so, if the type of the parameter that is the file name/path is a "string" (like wchar *), you can just pass a managed string object directly. If this is not the case, post a follow up question. Thanks, Steven

mikefos [MSFT] (Moderator):
Q: Hi, I'm Gerson DL, I wish do an installer to mobile device what's the minimum requirements? Having present the mobile devices are pockets
A: This may be useful: https://msdn2.microsoft.com/en-us/library/Aa446504

JasonFul_MSFT (Expert):
Q: a bit off topic: The GPS aPI and GPSID are a very welcome additions to WM5.0. Do you know if these aPI’s will be available for Windows XP as well? It would really help cross platform development of GPS-applications.
A: No, there are no plans to port these aPIs to the desktop.

mikefos [MSFT] (Moderator):
Q: Ok, sure. But the data are in memory! How do I get the buffer connected with the file system so I can pass a file handle, managed string, etc. without having to actually write the data? I could use GetMemoryMappedFileName() , but there isn't one.
A: so you have an open file and you want to pass data from it across the P/Invoke boundary?

Ginny Caughey:
Q: Does Sql Server 2005 Mobile Edition support concurrent connections?
A: Yes, SQL Mobile supports multiple concurrent connections, unlike SQL CE 2.0.

stevenpr_MSFT (Expert):
Q: Ok, sure. But the data are in memory! How do I get the buffer connected with the file system so I can pass a file handle, managed string, etc. without having to actually write the data? I could use GetMemoryMappedFileName() , but there isn't one.
A: So it’s the file's data, not its name that is in memory?

mikefos [MSFT] (Moderator):
Q: Is it documented somewhere which classes in OpenNetCF are usable or has been tested on which platforms such as WinCE 4.1? Where to report bugs? (Such as the version check in GuidEx.NewGuid seems to check for a 4.1 version, but it should be 4.10)
A: No there isn't a reference, although classes which are specific to a platform e.g. Windows Mobile should be marked in the documentation.

mikefos [MSFT] (Moderator):
Q: Can I use eVC4.0 compiler to build device driver or service for WM5.0 ?
A: Yes, eVC 4.0 can generate code compatible with WM 5.0 - you just can't debug.

tacke_MVP:
Q: Then If SQL Mobile is stand alone, when I need transfer the information it's supported by replication ?
A: Yes, you can use replication to transfer to and from SQL Mobile.

timg_msft (Expert):
Q: are DirectX Mobile applications always full screen applications or is it possible to have like a Panel in my GUI that renders from DirectX Mobile? I need fast drawing capabilities but I also want to use the GUI-controls for .NET CF.
A: For the 2.0 release of .NETCF, managed DirectX surfaces are limited to forms.

tacke_MVP:
Q: "There is SQL Mobile for the device, which can connect with MSDE", but this are external the engine exclusively ?
A: SQL Mobile is a stand-alone engine that runs on the device, if that's what you're asking.

Ginny Caughey:
Q: can you suggest a good reference book for programming CE application?
A: The classic reference for programming CE is "Programming Microsoft Windows CE" by Doug Boling.

mikefos [MSFT] (Moderator):
Q: why there are added RC2 when I transformed eVC project into VS2005 smartphone project?
A: Our experts today didn't understand this question. Could you consider re-posting and clarifying?

stevenpr_MSFT (Expert):
Q: Yes. The file data (content) is in memory. In fact there is no file. I am trying to avoid having to write this data to the file system, but I need to pass it to a library that needs a file name.
A: Thanks for the clarification. Just to make sure I understand: You have the contents of a file in memory, and you have a native aPI that takes a file name - that native aPI then manipulates the file in some way. Right?

Ginny Caughey:
Q: Will SQL Server 2005 Mobile support batch operations, like multiple inserts with SqlCeCommand?
A: SQL Mobile does not support batch operations.

tacke_MVP:
Q: Will there be a SDF-release soon aimed at .NET CF 2.0.
A: Yes, we're hard at work on SDF 2.0 - trying to have a by-Christmas release, but there's a lot of work still to do.

mikefos [MSFT] (Moderator):
Q: I have verified my email address for the windows manager. However, when I sign in I am told that I need to verify my address? If I try and re-verify I am told that I have already verified? I am not sure what else to do
A: Hey Jeff, I'm not sure that our experts can address this question today. Is this related to application development targeting Windows Mobile or Embedded devices?

PeterFoot:
Q: Is there support for programmatically establishing a Bluetooth PaN (tcp/ip over bluetooth) from a device in .NETcf or OpenNETcf?
A: The Microsoft Bluetooth stack on Windows Mobile doesn't support the PaN Profile (It may be available on custom CE based devices)

tacke_MVP:
Q: Is the native C++ compiler of PB5 different from eVC4? Why PB5 can not debug code produced by evc4?
A: The compilers are not identical. You can debug eVC code in PB by generating a PB project and adding the code to it - you cannot directly add an EVC project into PB.

tacke_MVP:
Q: To configure SQL Mobile by replication using a server with SQL server and if I've using actually subscribers with MSDE desktop, and I'm going to upgrade my solution to mobile I require modify my design ?
A: You can use MSDE in the publisher extreme, but please keep in mind it is not engineered for heavy transaction loads. In addition, you must configure the replication mechanism using only line command tools.

tacke_MVP:
Q: ctacke_MVP to configure SQL Mobile by replication using a server with SQL server and if I've using actually subscribers with MSDE desktop, and I'm going to upgrade my solution to mobile I require modify my design ?
A: Because MSDE lacks of GUI tools.

tacke_MVP:
Q: How to get USB device ID/device description after USB device is connected to windows mobile system? Such information is exist in the registry or certain file in the file system?
A: The USB PID and VID are transmitted with the USB packets. The host driver knows what to do with them.

PeterFoot:
Q: Can I use the Socket lib in .NETCF 2.0 to accomplish what is done in 32feet lib or even win32 aPIs?
A: 32feet uses Sockets for all it's data connections (System.Net.Sockets wrap winsock) - it also wraps all the custom Bluetooth stuff such as addresses and the Bluetooth specific P/Invokes and structures

stevenpr_MSFT (Expert):
Q: Does the 32 mb limit of a task "cell" apply to managed apps? can several managed apps share one task cell?
A: The 32 MB virtual address space limit does apply to managed applications as well. The NetCF CLR stores various things in there including jitted code, the gc heap and a number of other runtime data structures. Managed applications do not share a single slot. Here's an article that provides some background: https://blogs.msdn.com/stevenpr/archive/2005/12/12/502908.aspx

stevenpr_MSFT (Expert):
Q: Does the 32 mb limit of a task "cell" apply to managed apps? can several managed apps share one task cell?
A: Another follow up: managed dlls don't get loaded into the 32 MB space in the same way that native dlls to. Instead, the NetCF CLR memory maps them into the high memory area - so the size of the dll doesn't "count against you" as it does in the native world. Only the jit compiled code is stored in the 32MB slot. Thanks, Steven

mikefos [MSFT] (Moderator):
Q: Why I can't get LVN_ITEMaCTIVaTE notification when activate a listview item through a dialog under smartphone?
A: I think you've stumped our expert today with this one. Can you post it to the newsgroups so that someone can respond after today's chat?

mikefos [MSFT] (Moderator):
Q: So just let me understand... then, PB5 C++ compiler is same as in VS2005? Thanks
A: actually no, the Studio 2005 compiler is even newer than the PB 5.0 compiler.

mikefos [MSFT] (Moderator):
Q: Is it possible to develop WinCE device driver using eVC++ alone
A: Yes, you can create drivers with just eVC.

PeterFoot:
Q: Is it possibile to test BT communication using two desktops with BT adaptors before deploying to real devices?
A: Yes the BluetoothChat sample in 32feet has been tested between 2 XP machines. The same code is used in the Pocket PC and Smartphone versions of the sample

mikefos [MSFT] (Moderator):
Q: But the Idea is upgrade but making minimum impact to the final users that actually have laptops machines with the applications with full functionality, and they got pocket to migrate to Pocket, an option is SQL Mobile.
A: Are you going to use a full-fledged SQL Server on the publisher side? If so, you roadmap is pretty straightforward. SQL Mobile is certainly an option, but please check the final position about the licensing scheme on this theme.

mikefos [MSFT] (Moderator):
Q: Can you reveal some nice features that will be included in SDF 2.0?
A: Yes, I've been contemplating some blog entries with new features and class diagrams. Stay tuned - I hope to have something up this weekend.

PeterFoot:
Q: any recommendations on Mobile OS 2005 Smartphones (real devices, not emulators) to do testing with?
A: There aren't a huge number of WM5.0 Smartphones to choose from at the moment. The Orange C600 is a nice device, also shares it's "guts" with iMate SP5 and probably goes under many other names from different networkins/oems

stevenpr_MSFT (Expert):
Q: Exactly right. In Win32, I was using CMemFile to translate the buffer into an object for cache manager, and then GetMemoryMappedFileName() to get an object in object manager that could be sent to the library. I don't know how to do this in CE.
A: Max - I'm not real familiar with CMemFile and how you were using it. Let's take this offline. Send me an email at [email removed for transcript] and let's continue the discussion. That way I'll be more confident I can get you the right answer. Thanks, Steven

tacke_MVP:
Q: other than host driver, is there any way that application can get USB PID and VID?
A: I've never tried, but it *might* be in the registry once the device has connected and the driver has fully loaded

mikefos [MSFT] (Moderator):
Q: I would like to write a native control that can be used from .NET CF GUI-application. Do you know what I need to know to get started? I have succeeded writing a control for use on WinXP but there seems to be something missing when using it from .NET CF.
A: Is it a UI control? are you using COM?

timg_msft (Expert):
Q: Is there any definitive list of the exact differences between .NET20 and .NETCF20?
A: This is the best I could come up with. I'll see if we can get the transcript updated if I can find something better.

Ginny Caughey:
Q: How easy is it to convert a desktop application to a PPC application after desktop debugging and testing? any pitfalls?
A: It’s usually easier to convert from a PPC app to a desktop app since the PPC is more limited.

tacke_MVP:
Q: David: How easy is it to convert a desktop application to a PPC application after desktop debugging and testing? any pitfalls?
A: It could be easy or a very long task, depending on what classes you used from the desktop.

AlexFeinman:
Q: Is there any definitive list of the exact differences between .NET20 and .NETCF20?
A: .NET 2.0 documentation states explicitly for every method and class whether it is supported in CF. I am not aware of a single consolidated list. In any case it'll be pretty large unless you go in big chunks like "No Reflection.Emit namespace"

tacke_MVP:
Q: in this case, say I use 32 feet library on the desktop
A: The BT pieces migrate very easily. It's the non-BT stuff you need to be careful with.

AlexFeinman:
Q: Yes its a UI control written using COM
A: Yes, you can host an activeX control using a shim. There is an article on MSN to be published later this year that has examples of hosting activeX controls. Consider however that you might be better off writing a managed control. You can P/Invoke things from it as needed

mikefos [MSFT] (Moderator):
Q: What are smart device developers using for an x86 emulator for CE5.0/VS2005 development? There is something posted to the web, we've improved it a bit by dropping in our own custom NK.bin etc. Just wondering what others are doing?
A: Hey Arnie. I checked around a bit on this one and am afraid that we're not going to have a good answer for you within the scope if this chat. I do apologize.

tacke_MVP:
Q: For non-BT stuff, I will stick to NETCF 2.0. Would that make it easier?
A: If you stick with CF available methods and classes, yes, but the desktop project won't filter the available set to the CF.

mikefos [MSFT] (Moderator):
Q: Actually I've a server with MSSQL server 2000 at server and MSDE into all subscribers, and 50 pockets to migrate, and I'm doing merge replication
A: Right. well you can certainly use SQL Server Mobile in the mobile extreme, and keep SQL Server 2000 on the back-end. Remember the replication mechanism involves the use of certain HTTP-like features, the main traffic is sustained on port 80, etc. When dealing with SLQ Server 2000 and MSDE on a LaN, the replication traffic can use another ports, but when dealing with mobile devices, it is recommended the use of an HTTP server, etc. This ensures you can deploy your system using internet,etc

Ginny Caughey:
Q: Can you briefly talk about your feelings about programming under Managed and Native code? Can you tell the Pros and Cons of them?
A: I find managed code development more productive, but there are always some things that require native code such as device drivers.

tacke_MVP:
Q: now I'm really confused :-( you say PB5 can't debug app produced by eVC4 - although it will run on CE5 device? but driver dll made with eVC4 can be debugged on CE5 with PB5 kernel debugger?
A: Yes. The compilers are different, but the code files themselves will compile and run under any of the debuggers

AlexFeinman:
Q: If I remember correctly my problem was that .NET CF does not support the aximp.exe to convert it to a windows form
A: Correct, and yet there is a way. It's all in the article

tacke_MVP:
Q: Can you briefly talk about your feelings about programming under Managed and Native code? Can you tell the Pros and Cons of them?
A: That's a question beyond the scope of a chat, but IMHO most apps require a bit of both. Native has strengths (like speed and determinism) and Managed has it's strengths (like speed of development and portability)

tacke_MVP:
Q: actually in my case, the host driver is usbd.dll. But I couldn't find any PID/VID in the registry. (Or somewhere else?) So, I'm thinking, if I know exact which port I'm interested in, is there any way that I can request PID/VID again?
A: I suppose you might force a disconnect and reconnect, but I don't see how that would help your app. This really is a USB driver question, which is out of the scope of this chat. Can you tell us why you need the VID/PID?

PeterFoot:
Q: Thanks for the answer! On 32feet library, is it possible to get the source code to build my own 32feet library? I encountered some socket errors in the lib but have no clues. I think it would be easier I could trace the source code.
A: If you post the details to the forum I'll take a look, but any Socket errors which are passed through will be standard socket error codes which you can find from the SDK headers

mikefos [MSFT] (Moderator):
Q: Can anybody help with suggestions for debugging via an activeSync-connected device that doesn't seem to accept a privileged developer certificate? I need to execute privileged instructions, but the phone I am using Image/T-Mobile doesn't take the cert.
A: Per Alex Feinman, you'd need to find a legal way to unlock the device before this would work.

mikefos [MSFT] (Moderator):
Q: OK Carlos, actually I solved this using transfer by FTP with the merge replication, then the replication is transmitted by this way.
A: In this scenario, you must deal with some basic concepts of IIS. Mobile devices can communicate and replicate using this mechanism, you need then to "keep an eye" in your server side, since an IIS server is now added to your solution. If you decide to stick with SQL Server 2005 (full-fledged), you can manage your mobile instances directly from your desktop. This can shorten significantly your setup times, provided you're dealing with 50 devices.

stevenpr_MSFT (Expert):
Q: any special tips on performance tuning of GUI .NETcf code beyond what's recommended for .Net?
A: There is a performance FaQ on the netcf team blog that has some information about how to improve GUI performance: https://blogs.msdn.com/netcfteam/archive/2005/05/04/414820.aspx

AlexFeinman:
Q: The problem is this. I want do draw maps very fast on a control that uses an native DLL to read the map data. Using P/Invoke to read and write big amounts of data is not efficient.
A: You should be able to achieve sufficient speed from a managed control. In any case (provided you are using CF2), you have access to the native GDI handles, so you can use native screen painting. Not that it'll speed things up significantly - CF screen painting is pretty fast. So yes, you can to data transfers and painting in the native code, but making sure the control works in designer is pretty painful if you use native painting.

tacke_MVP:
Q:
So GDI has improved a lot in CF2.0?
A: yes

mikefos [MSFT] (Moderator):
Q: Carlos, this "keep eyes" is only from IIS ?
A: I meant, with mobile devices, you must add an IIS server on the back-end side if you try to use merge replication. I strongly recommend the evaluation for an upgrade to SQL Server 2005...

mikefos [MSFT] (Moderator):
Q: How I do it in SQL 2005 o r where I can find it documentation?
A: The management tools are greatly improved, and especially with SQL Mobile, there are many advantages for us, not present if previous versions. The documentation is quite straightforward... for example, in the help facility of SQL Server 2005, you can find a "how-to" recipe to achieve merge-replication , step by step. a good start could be https://msdn2.microsoft.com/sql/aa336364.aspx, take a look to the links there, and check MSDN online docs for SQL Server mobile.

mikefos [MSFT] (Moderator):
Thank you for joining us today for our Smart Device Programming with Visual Studio .NET chat. We hope that this has been a good use of time and appreciate all of the great questions.

A special thank you to the MVPs for their time, expertise and patience today! Thank you also to the Microsoft folks who logged in to assist! We’ll see you again for another chat next soon, please check http:/msdn.microsoft.com/chats> for the list of upcoming chats.

Top of pageTop of page