|
VS.NET 2003 comes with the Compact Framework and I recommend that. If you can find it, the Compact Framework for .NET 1.0 beta (it was released for .NET 1.1) will work.
If you just want an emulator, though, you can download these from http://msdn.microsoft.com[^]. They also come as part of the Pocket PC 2002 and 2003 SDKs, IIRC.
You could always install the .NET Compact Framework into the ROM image (keep in mind this is a hardware emulator - not a software emulator - so it's better) and transfer files using the emulator support software. This allows you to use VS.NET 2002 (without the beta .NET CF) or the command-line tools (comes with the Framework, though the Framework SDK includes additional tools) to write an test mobile apps without having a physical PocketPC device.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
thank you very much for the info
Will
|
|
|
|
|
OK, maybe I was bit lazy and looking for easier way to get whole picture ^_^. Thanks anyway Heath you're always coming to my aid it seems
c-ya
|
|
|
|
|
pekica wrote:
maybe I was bit lazy and looking for easier way to get whole picture
Sounds more like looking for the work done for you. It you really want to understand, studying it from another language you can't so easily translate or whatever will teach you far more since you'll actually have to research it instead of just copying and pasting. Would you agree?
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Yeah... but it will take me a lot more time to research. Nevermind I downloaded SDK and will look into it ^_^ if nothing else it'll remind me of good old Pascal times because of synatax .
c-ya
|
|
|
|
|
Nothing worth understanding every come easy. Do you think the regulars here learned anything by someone just giving us the answer - especially for an entire project? Even if a managed application did exist like you're looking for, it's wrong to just rip-off someone else's work.
Besides, legally, the project you look at is GPL'd. If you create any derivative work (work based on that project or including some of the source code - even modified) you have to GPL your application as well. If you don't, you break the law. If you do GPL your application you break your licensing agreement with Microsoft that you agreed to when you installed Visual Studio .NET (if you did).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
This question has 2 parts...either answer would fix a problem for me
My problem is that I need to query a database, and one of my parameters is the text from a combo box. If the user puts an apostrophe, then this messes up my query. So here are my questions:
How would I go about pre-processing a keypress event in a combo box so I can disable specific characters from ever being typed, such as the apostrophe?
~or~
How can I prevent an apostrophe (or probably quotes too) from screwing up transferring rows?
(I'm getting the error when I use this data in a Crystal Report, and when I build a select command for a data adapter, and include the text which contains the apostrophe.)
Thanks for any help, I apprecaite it
|
|
|
|
|
You can prevent apostrophe by placing 2 single apostrophe instead of one...
i.e.
string strName = "baby's day out";
..."where name='"+strName+"'";
change "strName" like this :
string strName = "baby''s day out"
thus after the text has been entered in the combo parse the string for single apostrophe. If present replace that with double like above example and then use the string in ur query.
hope this works...
regards,
Aryadip.
Cheers !! and have a Funky day !!
|
|
|
|
|
Thank you, that worked very well!
|
|
|
|
|
This is what happens when you don't use parameterized commands! I know that I've given you code samples before for this. Creating a SQL command by concatenating your params together is arcane and should not be used in .NET. If you use a SqlCommand , for example, then you should add SqlParameter s to its SqlCommand.Parameters collection property and use @paramname in your query without quotes. The command will do what's necessary. See the documentation for the SqlParameter (or OleDbParameter , or any of the others) in the .NET Framework SDK.
There are also a lot of other benefits to using parameterized commands, such as easy batch processing when you save the parameters as variables and simply update their Value property, then re-execute the command.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I'm trying to populate a TreeView with info I'm gathering via a PeekCompleted callback for a MessageQueue. My PeekCompleted method, which is "void static", does not have any trouble populating a ListBox but the compiler complains that I must use Control.Invoke() from the callback to use TreeNode.Add().
Here are my questions:
1) Why?
2) Should I use Control.Invoke() or do this another way?
All I'm trying to do is build a TreeView using data I collected from a callback method. What are my other options?
TIA,
Matt
|
|
|
|
|
Yes you should use Control.Invoke . This invokes the call on the thread on which the control was created, which is important. You should do this for your ListView as well. Modifying the control from a different thread causes problems in the message queue. The technical details get down into what is encapsulated by the .NET Framework (much of it, anyway): Win32 APIs.
To use Invoke , take a look at this sample code to safely add a TreeNode in the property thread:
internal void SafeAdd(TreeNodeCollection nodes, TreeNode node)
{
if (nodes == null || node == null)
throw new ArgumentNullException(nodes == null ? "nodes" : "node");
if (treeView1.InvokeRequired)
{
Delegate d = new AddTreeNodeHandler(nodes.Add);
treeView1.Invoke(d, new object[] {node});
}
else nodes.Add(node);
}
private delegate int AddTreeNodeHandler(TreeNode node);
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi guys,
I am trying to write an application which when installed will keep an watch over the network and generate report about it.
Can any one tell me how can I detect a SOAP call. I want specifically to detect and ensure that a SOAP call has been made and also extract out info like : by which applicaiton(the application and machine name) ,to which server, etc.
Thanks in advance...
regards,
Aryadip.
Cheers !! and have a Funky day !!
|
|
|
|
|
If you're talking about a network filter, you treat it like any other HTTP request or response. Extract the body and check if it uses the SOAP namespace. If so, you can extract additional information from the HTTP headers or from the WS-Routing or WS-Addressing elements, if available in the SOAP header.
If you just want to log information about SOAP calls, you can add a client or server sink to the chain that uses information from the IMessage that's passed to it to log information about the call.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I made 2 events on System.Windows.Form named as Click and DoubleClick.The sample code for them is
private void Form1_Click(object sender, System.EventArgs e)
{
MessageBox.Show("Click");
}
private void Form1_DoubleClick(object sender, System.EventArgs e)
{
MessageBox.Show("DClick");
}
but when i clicks(whether single or double) only the Form1_Click event occur.I want that on single click Form1_Click occur and on double click Form1_DoubleClick
occur.In other words i want to perform 2 different actions on single and double-click,please give any sort of help for this problem.
mughalali
|
|
|
|
|
I guess you can go about with it in the following manner...
private int clickCount = 0;
private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
clickCount ++;
}
private void Form1_DoubleClick(object sender, System.EventArgs e)
{
if(clickCount>=2)
{
clickCount=0;
MessageBox.Show("double click");
}
}
Cheers !! and have a Funky day !!
|
|
|
|
|
The proper solution is to use a timer, with the timeout value set to SystemInformation.DoubleClickTime . If the timer elapses before the DoubleClick event handler fires (which stops the timer), then execute your code in the timer's callback. This was the common approach that even Microsoft suggested back in the ol' MFC days (even was in a tutorial installed with VS if I remember correctly).
Using a counter as the other person suggested could lead to problems keeping the counter in sync with other events.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I am monitoring 2 MessageQueues (MSMQ) via the PeekCompleted callback.
It seems to be working but I get a lot of duplicate msgs. By duplicate I mean I receive 2+ messages with exact same System.Messaging.Message.Id.
Is this normal? Doesn't seem efficient to me and I wonding if I'm doing something wrong?
TIA,
Matt
|
|
|
|
|
hi, I want my text box to be displayed in a multi line style
and not a long line (even when the focus is not on the cell)
how do i do this (i already word wraped and multilined it)?
|
|
|
|
|
First of all, realize that the TextBox isn't used to display the data - only to edit it. That being said, you need to extend DataGridColumnStyle (or you could even extend DataGridTextBoxColumn and just modify the TextBox to be multi-line when editing) and override Paint method to draw your text on multiple lines. The Graphics class and supporting classes (like StringFormat ) provide easy support for doing this.
You'll also need to override GetMinimumHeight to provide the height (you should cap it at some reasonable limit) you'll need to draw your multi-line text (which you can determine using Graphics.MeasureString ).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for the pointers , I'll try them out.
|
|
|
|
|
I really hope someone can help me with this, I've looked everywhere.
I have a class that I want to save to a file, and it was working fine using a static method within the actual class:
static public void save(string fileName, CMyClass c)
{
IFormatter formatter = new BinaryFormatter();
Stream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None);
formatter.Serialize(stream, c);
stream.Close();
}
However, I want to use this class remotely, but when I call this method, using a transparent proxy, I get an exception when formatter.Serialize runs.
It says "Attempted to call a method declared on type System.Runtime.Remoting.Messaging.IMethodMessage on an object which exposes CMyClass."
I tried writing the save method as non static, and passing the this pointer to Serialize, but I get another error, which doesn't surprize me.
Does anyone know a simple solution for saving my class?
|
|
|
|
|
CMyClass must be remotable, first of all. This means it must derive from MarshalByRefObject or MarshalByValueComponent and be attributed with the SerializableAttribute (optionally implementing ISerializable if you want to explicitly control serialization).
A few things about design, though. First, never prefix classes with "C". There's a naming convention for every framework - like the .NET Framework - for a reason: to provide consistent naming through the framework. Microsoft has done a pretty good job of this throughout the .NET FCL (Framework Class Library) with only a few exceptions. See Naming Guidelines[^] in the .NET Framework SDK for more information.
Also, if an instance of CMyClass is what you're saving, then your method should be an instance method (not static). What you're doing works, but it's not a very good object-oriented design because the instance is what you're saving. Statics are usually reserved for properties, methods, and fields (like constants) that apply to the class, not an instance of the class.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Firstly, thanks for the information about naming conventions for the framework, I guess I'm just stuck in my ways because of many years of coding in C++ and using a C in front of classes.
MyClass does inherit from MarshalByRefObject, and it is attributed with the SerializableAttribute, sorry I missed them.
I do want to use an instance method to save the instance. Like so:
public void save(string fileName){
try
{
IFormatter formatter = new BinaryFormatter();
Stream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None);
formatter.Serialize(stream, this);
stream.Close();
}
catch(Exception e){
MessageBox.Show(e.Message);
}
}
Which would be ideal, however when this is run an exception is thrown with the following message:
"The type System.Runtime.Remoting.ServerIdentity in Assembly mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 is not marked as serializable."
Everything stored in MyClass is marked as serializable, it saves fine when using my static method, but not when called remotely. All other remote calls in MyClass work ok.
|
|
|
|
|
10+ years of C/C++, about 5 with Perl, 6 with Java and now about 3 with .NET: each uses a different naming convention. It's just something you have to get used to.
It's not that it wouldn't save when using a static method, just that it's not a very good OO design.
As far as the error goes (which would've been helpful), some member of your class uses the ServerIdentity Type, which isn't serializable. I suggest implementing ISerializable and serializing only those fields you want to save. There's no documentation for this Type so without digging through the IL I couldn't tell you want it does (though the name gives me a few ideas), but chances are that whatever field Type defines such a property is probably something you don't need to save.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|