|
First of all, WinXP is not a server platform. It won't scale and as of WinXP SP2 your connections will be even more limited.
Second, why not just use SQLCE (support is in the .NET CF) and replicate the data between SQLCE and the MSDE/SQL Server? This functionality is easy to set up and replication can be controlled.
I mean, if MSMQ does exist on the particular Windows CE .NET platform (presumably, Microsoft Windows for Pocket PCs have it but I don't have "PocketPC 2003" yet - and OEM's don't have to include it in the platform builder), you're still stuck with writing the listener on the server and queuing messages on the client. Replication between the SQLCE and MSDE/SQL database is easy and there's almost nothing to write.
See Designing "Sometimes Off-line" Microsoft .NET Compact Framework Applications[^] for an article on database replication.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I need some direction on how to code a class to view computers on a workgroup from a wireless device. This will be for a pocket PC. What im trying to do is have the pocket PC search each computer (or have the user pick a computer) and the device will connected to it, so i dont have to keep typing in the ip address. The host (computer) will e running a program what will send information on a port, and if its the info the client (pocket PC) need then a connection is setup between the two, so the client can send commands to the host.
modified 16-May-21 21:01pm.
|
|
|
|
|
Unfortunately it has proven otherwise. I have a simple C# form with a label control(prompt), an OK button, and a Cancel button. When the form loads, the OK button is disabled and the form spawns a worker thread that does some work (runs a pin-pad in this case) and calls a callback function when it is done. In the callback function I re-enable the OK button, and I want to set the focus to the OK button but I can't seem to do it. I used the Focus() method and it fails even though the CanFocus property is true. I also set the ActiveControl property of the form but this failed also. Does anyone have any sage advice for me?
Neil Van Eps
"Sweet liquor eases the pain" - Lionel Hutz from the Simpsons
|
|
|
|
|
You will need to Invoke everything coming from the other thread.
|
|
|
|
|
When getting/setting properties or calling methods on a control from another thread, you need to use Control.Invoke . If you're not sure if you need to invoke the method (properties are just getter and setter methods), you can use Control.InvokeRequired . More information and examples can be found in the .NET Framework SDK regarding these members.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
So just because you declare a callback function doesn't mean it runs in the parent thread. Got it - thanks.
Neil Van Eps
"Sweet liquor eases the pain" - Lionel Hutz from the Simpsons
|
|
|
|
|
It runs in the thread context in which it was invoked.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
i am working on some reports to export to Excel - in the code I am using the ExportReport() method.
Previously, this all worked fine - the user would click on a button which would kick off this code. A dialog would appear prompting the user to name and save the file. Upon completion of the export, the user would get an "export complete" message box - the file would then be in the correct location.
Now, for some reason, this functionality is not working - the dialog still comes up to prompt the user for the name/location. But after specifying this and clicking OK, nothing happens. No file is created.
Have no idea what is causing this...but is it related to the code not being able to find the u2ddisk.dll??
|
|
|
|
|
Probably, but you give absolutely no details. What reporting engine are you using (presumably Crystal Reports since you mentioned u2ddisk.dll)? Is this on another machine? Has the machine been altered (i.e., new hardware or software installed)? If you deployed your solution to a new machine, did you include all the required files (like the 4 or 5 Crystal Reports merge modules for a Windows Installer package)?
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I apologize for the lack of details...I am using my own machine but it was recently altered. There was a dll problem and the sysadmin tried to get it back to its orignial state. He reinstalled VS and supposedly brought everything back to its original state.
I am using the Crystal Reports reporting engine as part of VS.NET 2002. I am having these problems in debug mode - haven't yet deployed these reports onto another machine. In the code I create a CrystalReportViewer to call ExportReport() which was working before my machine was "rebuilt" and now does not seems to. As an aside, I had to manually add a registry entry this morning for the crpe32.dll as there was not value for it and VS could not load that dll when it tried to run the code generator tool. I should have the 4 merge modules included - the big thing is that all this worked fine before but having problems since VS.NET was reinstalled.
Thanks for any help you can provide. Let me know if there are other details you need.
|
|
|
|
|
Sounds like lots of registry values and environment variables weren't restored. The Crystal Reports assemblies should be, for example, installed into the Global Assembly Cache (GAC). The Crystal Reports unmanaged runtime also needs to be re-registered or added to the PATH environment variable (I honestly don't remember which, though you should find more information on their web site).
This is definitely a breaking change, something you should've mentioned before. Re-installing VS.NET is hardly a solution if the admin isn't sure what's wrong (a common problem it seems). I would recommend uninstalling VS.NET completely - including the .NET Framework - and reinstall it all, including the Crystal Reports stuff (runtime, designer, assemblies, etc.).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I'm about to write a C# application to, er, do stuff (not important). I'm going to provide request handlers that can take input from database tables, MSMQ and JMS queues (thank god for J#), Web service requests, HTTP requests, and maybe socket connections using a simple proprietary protocol or even a drop directory. Its admin interface will be ASP.NET pages.
I know pretty well how to write the logic in a nice way to satisfy all the requests from different input. My main question right now is how to arrange the components. I think I'm going to write the main body of the application as a Windows service, which'll give the benefits of startup, shutdown and even power-management hooks, as well as easy administration. I obviously need IIS for the Web services and HTTP support, which is great because it allows me to delegate security responsibilities for that stuff to IIS and the Web applications, as well as the opportunity to spread the load.
I figure the best thing to do is use a TCP/IP remoting channel with a binary formatter between the IIS applications and the Windows service, yes? (I've done some reading and practicing with remoting, but never used it in the real world.) Once I've done this, should I think about just making remoting another method of direct input into the Windows service? I mean, how valuable is it in general to provide access to something via remoting? I mostly see mention of it as a way to provide internal communication between components.
-Jeff
here, bloggy bloggy
|
|
|
|
|
Using .NET Remoting to talk to a Windows Service is very common, and the whole concept of communication between some server object (in this case, an ASP.NET Web Service) is not uncommon at all. Before (and still) server objects talk to COM+ services, which provide a lot of nice features for (almost) free.
As far as how ASP.NET talks to the back end, if you're not sure about Remoting perhaps consider using a provider pattern to make abstract calls to implementations: one could talk to .NET Remoting while another talks to another Web Service or directly to a database...whatever. Every since .NET 1.0 beta days when I realized how great the CTS was, I've been using a provider pattern for most of my bigger apps (including the solution I've architected here - though in a rush-to-market start-up I didn't have as much time as I needed, but will someday get around to revamping). Much of the .NET Framework already uses a provider pattern (.NET Remoting channels and sinks, System.Net authentication modules, etc., and ASP.NET stuff), and 2.0 will use it even more heavily (with great improvements).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
provider pattern
That's a good name for it. That's what I'm used to doing, now. I create an interface for something that takes input, then make one implementation for every type. I do the same for the methods of output. Then, for things that need a synchronous response that depends on processing, I give the ability to associate a particular input method to a particular output method ("sink"). Each request carries context information, etc. Next I write the threading code, so that one thread is attached to each method of input. These threads read in requests (sometimes assigning them priorities; sometimes that's down the processing chain).
Each request is dropped into an in-memory queue at this point, and winds up getting processed eventually. Any sensed admin requests are sent to the front of the queue. Sometimes I make the same thread that processes the request write the output, but when performance is important I usually dedicate a separate thread to each sink too, especially if the same response or result has to be written to more than one output.
Since you bring it up, I have to say that the word "sink" to refer to output is awesome. I formed most of my personal naming preferences doing Java work, where everything in the API is "reader" and "writer" organized, with an occasional "sink" in there usually as the contribution of an old C coder! The word "sink" is now one of my favorite things about .NET. I really am a naming freak.
So you're saying that I could make the ASP app front end another method of input besides remoting, an interesting suggestion. Whatever I do with this thing, though, I'm going to have to provide synchronous responses for both the ASP and Web service requests, so I'm concerned about performance; like, I wouldn't want to funnel HTTP requests through the Web service.
I'll just have to try wading into the remoting stuff, I guess. I have zippo experience with COM+, although I've done some reading on it. I'm sure I'll have plenty of annoying questions in a week or so.
-Jeff
here, bloggy bloggy
|
|
|
|
|
Each request to the Web Service (and .NET Remoting objects when hosted in IIS) get their own HttpContext , which runs in a separate thread of execution. While you may call a method synchronously in your client application, the web application uses a free-threaded model to execute it.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Mmhmm, that's good to know from a performance standpoint. So what you're saying, I think, is that Web services aren't plain awful on performance from a threading perspective, which I'm prepared to believe. I'm mostly worried about making the application consume too much of the available network resources, and I also figure that the encoding/decoding overhead of a binary formatter is going to be less than that of XML serialization and deserialization.
I was thinking a while back about writing a lightweight Web services provider that could be used outside of IIS, just to provide an easy point of entry into things like Windows services. I wouldn't be able to easily (read as ever) provide all of the built-in security functionality of Microsoft's Web services implementation, but I could make it easy to cobble together communication between your components in a snap. I don't know, maybe I'm overafraid of this remoting stuff. It seems pretty similar to Java RMI, which wasn't all that complicated.
-Jeff
here, bloggy bloggy
|
|
|
|
|
It's okay to be afraid of Remoting at first, but once you get the hang of it it's great! There you can use a BinaryFormatter which does improve performance (even just serializing/deserializing, not to mention the bandwidth required).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I've created a custom button and placed it in the designer toolbox. When I make changes to the button dll and rebuild it, I can then place the new button, with all the new features, on my form. The problem is that none of the previously-created buttons have the new features. Is there a way to tell the designer to use the new dll instead of the old one?
|
|
|
|
|
The designer has little to do with it. All the code is serialized to your code file (your .cs source file) and an assembly reference is added to your project references. In real-world solutions, you common add multiple projects to a solution and use project references - not assembly references (right-click on project, select Add Reference, then click the Projects tab). This keeps the version numbers in sync, as well as the makes the build configurations the same.
As far as the toolbox goes, putting controls you're currently developing in there is a big mistake since they change often.
Also, if you're working on a multi-project solution, I highly recommend NOT using automatic versioning (i.e., using an asterisk - * - in the AssemblyVersionAttribute common found in AssemblyInfo.cs). This can get to be a big pain really fast, especially when not all your assemblies are bound to each other (like a plug-in type application).
If you're building UserControl derivatives in the same project in which you're working, the designer usually (it's supposed to) adds them to the toolbox for the active project automatically.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath,
Thanks for your reply.
The control dll and the application are separate projects in the same solution. I set the version of both assemblies to 1.0.5000.0 (no auto-increment). The dll is added to the application as a reference project, just as you suggest. But still the old buttons are not updated when I rebuild the dll - not even if I remove and re-add the reference.
|
|
|
|
|
You also need to close and re-open the form or whatever container (like a UserControl ). Also, the new assemblies aren't copied into the target directory until you build the project with the dependencies on the other.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi!.
There's a way to write an application such as Visual C++ SDI app., with multiple views, (forms views)?.
For example: I have two bars and selecting differents options, (buttons), I want to change the visualization, (the controls are others), in a kind of view or window in the center.
I use to do that with SDI application in VC++, but how could I do the same in C#.
Thank you.
Demian.
|
|
|
|
|
|
Is there any way to get processor related data from C#? I know there is Win API procedure but it, as far as I know, gives me specification related data (type, speed, etc).
I need something, to be specific => that will tell me % of processor ocupancy so I can for example when processor ocupancy drops below 10% to take some action.
Any ideas?
|
|
|
|
|
I've never done it, but one way you can do this is using the PerformanceCounter class. Read the docs-- it's pretty easy to understand how to go about it.
-Jeff
here, bloggy bloggy
|
|
|
|
|