|
I could be wrong here, but it sounds like you developed your app on one version of the .NET Framework and the Pocket PC is running the other? (1.0 and 1.1)...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I believe the problem could be because I just installed the Whidbey release. So maybe VS.NET2003 has compiled my app against CF 2.0 rather than 1.0. How can i change what version of the framework an application uses?
|
|
|
|
|
Well, since your using the beta version, I don't know if this is going to work. Go to your Project Properties and find the Supported Runtimes option. The problem is, I don't know if your going to find this option in a CF Project! If not, you'll have to install the Whidbey Framework on your Pocket PC.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I decided to uninstall the CF on the xda and then reinstall it. But before installing it i decided to give the app a go, and strangely it works fine now, although i removed the cf from the settings->remove programs. Oh well it works now!
|
|
|
|
|
I have a .NET client app and a .NET console server app. Whenever the server throws an error, the exception information is as follows, regardless of the type of exception thrown: "The server encountered an internal error. For more information, turn on customErrors in the server's .config file"
Well, I'm currently not using a .config file for the server. Is there a way to turn on custom errors through code? RemotingConfiguration.CustomErrorsEnabled apparently has no effect, unless I'm using it wrong. Any ideas?
#include "witty_sig.h"
|
|
|
|
|
Not using a Web.config file? Why not? You should. It's just a file named Web.config put into the web application's root directory (not necessarily the web server's root directory) with the following (for your needs):
<configuration>
<system.web>
<customErrors mode="On" />
</system.web>
</configuration> Otherwise, you can handle the HttpApplication.Error event and do whatever you want. Typically you implement this in an IHttpModule implementation, but you'd need a .config file to configure your ASP.NET application to use it! You can also handle this in your Global.asax file (or its code-behind file) as well, but many times it's better to abstract your code by making it modular and/or service-oriented.
Seriously, though, you should use a Web.config file. You can configure runtime settings (not just for ASP.NET, but for all of .NET), security, impersonation, etc. etc.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I'm sorry I should've been more clear. The server application is not a web application. It's a standard .NET console application that talks to clients via .NET Remoting. Web.config applies only to web applications correct?
#include "witty_sig.h"
|
|
|
|
|
Correct, but the error resolution message you're getting is typical of ASP.NET web applications, which is why I assumed you were using ASP.NET. What exactly, then, is returning you such an error?
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
An example would be when the client tells the server to perform some task and waits for return. While the server is performing some task, it will throw an exception. The client catches the exception, but doesn't tell me the exception type, message, stack trace, etc. and tells me to enable custom errors on the server if I want more information.
#include "witty_sig.h"
|
|
|
|
|
What I mentioned before is close, but now that I understand your client/server app a little better, I can tell you that you need to configure pretty much the same thing, except instead of using <system.web> use <system.runtime.remoting> and set the mode attribute to "on" (lower-case "o", for some reason - not very consistent).
This .config file would be named the same as your client application + .config at the end. The RemotingConfiguration.CustomErrorsEnabled method is merely a way to determine if custom errors are displayed based on the locality of the remote call.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thank you Heath I'll give that a whirl.
#include "witty_sig.h"
|
|
|
|
|
Did this actually work? Could you post an example or emial it to me. I am having the same problem and I am not having any success getting it to work. Currently, I am also not using a config file.
C LaMorticella
Client Instant Access
|
|
|
|
|
I have a form that is being maximized. The form is a child form of an MDI parent and there is another child form docked on the left as a menu. Therefore, when the form is maximized it needs to be maximized to (for instance location 256, 0, 200, 200 instead of 0,0,456,200 (where above is x, y, width, height). I'm having a real issue finding an event that fires BEFORE a maximize command to set the bounds and the maximizedbounds property doesn't seem to be doing any good. Any ideas, events, etc.?
Brian
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." - Douglas Adams
|
|
|
|
|
Override WndProc and handle the WM_SIZING (0x0214) message. This is sent to a window procedure (and keep in mind that almost all Windows Forms controls encapsulate native controls and dialogs) before being resized. The Message.WParam specifies the edge that is being resized and the Message.LParam specifies the RECT (which you must define in managed code - a System.Drawing.Rectangle will not suffice because it stores coordinates differently).
Set the Message.Result to new IntPtr(1) to signal that you've processed it and don't want your Form to be resized.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Is it possible to get a reference to the object that is calling a method (maybe through something like Reflection)?
i.e. something like:
<br />
public class A<br />
{<br />
private B b;<br />
<br />
public A()<br />
{<br />
b.SomeMethod()<br />
}<br />
}<br />
<br />
public class B<br />
{<br />
public void SomeMethod()<br />
{<br />
if(callingInstance.Type == typeof(A)<br />
}<br />
}<br />
|
|
|
|
|
You can get the calling assembly using Assembly.GetCallingAssembly , but not the calling type. Since this is an object-oriented development platform, a more appropriate implementation would accept the caller as a parameter to the method, typically declared as an abstract class or an interface. The caller would have to implement that interface or extend that abstract base class and override whatever members are appropriate to call, so that your method or class can call those methods without knowing about a specific implementation of those methods.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello!
I want to check if a program is installed. For instance I want to see if the Visual C++ Toolkit 2003 is installed on my computer. How can I do this in C#?
Thank you for helping me!
|
|
|
|
|
|
Even after enumerating and possibly finsing the correct registry key, you should check for the exsistence of the dll or exe. Windows applications are infamous for not removing all registry entries after an un-install or even people will delete directories without using the un-install. Top and bottom is even if it has a registry key, don't assume that it's there.
Just expanding on what Heath mentioned.
Yes, I program in VB, but only to feed my addiction to a warm place to sleep and food to eat!
Visit my Code Project blog (Mobile Audio project)[^]
|
|
|
|
|
True to a point (although he didn't ask about files - merely products), but Windows Installer - unless you explicitly change the execution sequence from the default or change the Component table attributes or transitive condition to keep the component installed during uninstall - will remove all files it placed there originally. Windows Installer really is a powerful package distribution system, something I've been working with since it's 1.0 beta days and am currently beta testing for 3.0. If you're interested, you should take a look at the Windows Installer SDK on MSDN.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
[original posting]I want to check if a program is installed. For instance I want to see if the Visual C++ Toolkit 2003 is installed on my computer. How can I do this in C#?
The point I'm refering to is that just because something has a registry entry, doesn't mean it exists, only that it was installed at some point in time. I know from experience not to take anything for granted if it has a registry entry.
Heath Stewart wrote:
(although he didn't ask about files - merely products),
He wants to see if a specific product is installed. I merely wanted to point out that an un-install may have failed or been un-installed incorrectly (like deleting directory - infamous in users ) and still have left registry entries that may be included in the enum.
Regards,
Eric C. Tomlinson
P.S. Haven't used Windows Installer yet, all the clients I work for have subjected me to Installshield Maybe someday I'll be able to use it on something that I write (and actually finish)
Yes, I program in VB, but only to feed my addiction to a warm place to sleep and food to eat!
Visit my Code Project blog (Mobile Audio project)[^]
|
|
|
|
|
I know that non-Windows Installer products are notorious for this, but Window Installer packages are actually transacted - you won't see this behavior (except, perhaps, from poorly-written custom actions where the developer doesn't take rollbacks into account or simply can't).
It's Windows Installer I'm defending, not installs. Regarding installs in general, I wholy agree with you...except for one problem: proprietary installs are just that - proprietary. There may be no way to determine where to even look for a product if the install information (or, rather, the uninstall information) doesn't tell you. This is another reason why Windows Installer kicks butt: it's a relational database and tracks everything from files, registry entries, and feature and component installation states.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
First I want to thank you all for your great help.
All I wanted to do is to check if the Visual C++ Toolkit 2003 is installed on a system. I give my programs only to users who uses the Uninstall packages. So there won't be problems with deleting program directories or something.
But there is only interesting thing:
When I open my Control Panel and double click "Software" (in German) or "Add Or Remove Programs" (something like that in English). However, I got a list with all currently installed programs. How is this?
|
|
|
|
|
Add/Remove Programs uses the IAppPublisher shell interface, a COM interface not available in .NET, though you can declare it in managed code. COM servers containing implementations of IAppPublisher are in the HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\AppManagement\Publishers registry key. Unfortunately, COM interop with .NET requires that you import the typelibs - if available - from each of these before you can create an instance of them.
So, I recommend reading about the IAppPublisher interface in the MSDN Online Library[^] and creating a mixed-mode Managed C++ assembly. This way, you can work with native COM and expose the functionality you need to managed code. Writing an MC++ assembly this way allows you to reference it in your other managed projects, like a C# project.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
does anyone know where to find (if possible) how to implement a web service running on a Pocket PC and make an application that uses it on the same Pocket PC (in C#)?
thanks
|
|
|
|