|
Forget it, I already figured that out myself .
H.
|
|
|
|
|
for others who may want to know how to do it Drag files from explore work like similar way the other drag and drop work except you check that the draged item format is DataFormats.FileDrop by using GetDataPresent
and handle the files in drop handler after convert them to array of string some thing like string[] fileNames= (string[])e.Data.GetData(DataFormats.FileDrop);
MCAD
-- modified at 18:56 Monday 12th September, 2005
|
|
|
|
|
I get an exception when trying to read in my XML document, which is the settings for my serial port. The error is this:
There is an error in XML document(2, 2)
<CommBaseSettings xmlns="> was not expected
Here is a snippet of the xml document
<?xml version="1.0"?>
<CommBaseSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<port>COM3</port>
<baudRate>2400</baudRate>
<parity>none</parity>
Can someone help me out in inderstanding what is going on here?
Thanks
FYI I'm using a class called CommBase from MS that some dude wrote up in an MSDN mag some years ago. Soe far it works great, just getting the settings to read in. Saves them just fine.
Thanks
Tom Wright
tawright915@yahoo.com
-- modified at 17:37 Monday 12th September, 2005
|
|
|
|
|
Does the file open up correctly in Internet Explorer without any errors?
<?xml version="1.0"?>
<CommBaseSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<port>COM3</port>
<baudRate>2400</baudRate>
<parity>none</parity>
</CommBaseSettings>
seems to open up correctly.
Regards
Senthil
_____________________________
<font face="Verdana" size=1><a href="http://blogs.wdevs.com/senthilkumar">My Blog</a> | <a href = "http://www.codeproject.com/script/articles/list_articles.asp?userid=492196">My Articles</a> | <a href = "http://geocities.com/win_macro">WinMacro</a></font>
|
|
|
|
|
Hi
I have a status bar in my main form. This status bar displays different text. I need to display a tooltip with a text (on mouse over) if the text is too large to fit into the status bar - if it's not completely visible (similar functionality as in Visual Studio). How do I determine if the length of the text string is larger than the current width of the status bar panel? Currently I'm using, e.Graphics.MeasureString, to compare length of the string in pixels to the length of the status bar panel in pixels, but that hasn't been giving me the the results I wanted.
Thank you in advance
-- modified at 16:58 Monday 12th September, 2005
|
|
|
|
|
Hi, im moving a .xls file to another directory, but if this file exists i want to rename it and still move it. For example, if i have a ex.xls in a directory and im trying to move another file with the same name, i want to rename it like to ex1.xls and move it. How can i do this? any ideas?
Thanks in advance.
|
|
|
|
|
|
a simple function as such should do the trick.
void MoveMe(string filename)
{
int x = 1;
string newfile = filename;
while(System.IO.File.Exists(newfile) == true)
{
String[] tmp = filename.Split(Convert.ToChar("."));
newfile = tmp[0] + x + "." + tmp[1];
x++;
}
System.IO.File.Move(filename, newfile);
}
-- modified at 13:45 Monday 12th September, 2005
|
|
|
|
|
do the variables filename and newfile includes the directory?
|
|
|
|
|
in this case, yes. The file name is split at the "." in the filename.
So if filename = C:\Autoexec.bat then newfile = c:\Autoexec1.bat
Because of design, if a file name consists of more than one period, you will receive unexpected results.
|
|
|
|
|
Hello all
I am starting a mailer application project in c# using Visual Studio .Net. As I need to learn more about the process of sending emails (e.g email message structures, SMTP Protocol etc.) , I would appreciate it if you could send a few links to relevant reading material and examples.
And equally important - I need to know which classes and assemblies deal with sending email messages (I saw something about microsoft.uddi.dll in the Visual Studio help).
Will appreciate any help,
Thanks,
Gal
|
|
|
|
|
|
That's great, it will really help me get started.
Thanks a lot.
Gal
|
|
|
|
|
Hi,
I would like to build an application for both smartphones and pdas running windows mobile 2003 or 2005. what is the best practice to develop such application?
regards,
rnv
|
|
|
|
|
|
In the C# books I've read, drawing objects such as pens, brushes, etc are usually created in a using declaration in OnPaint(). I don't see anything wrong with this as it seems to be more resource friendly but I've heard others say these objects should be cached, such as storing them as instance fields. Are there any guidelines for going one way versus the other?
|
|
|
|
|
The only guidelines I can suggest are:
1) How many times a second are you going to repaint your form? If your writting an analog clock that repaints itself every 50 milliseconds, you'll want to create your pens and brushes once and cache them so you're not creating and destroying them a couple hundreds times per second. If you only repaint the form when Windows tell you to, then you could probably get away with creating and destorying your pens and stuff on demand.
2) If you're painting alot of static stuff. In the clock example, the clock face and hands don't change between any repaints. Just the positions of certain items change. In this case you could get away with caching your drawing objects. If you're painting dynamic data that frequently changes the colors of what your drawing between repaints, then you'll have to create and destroy your drawing objects on demand.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks Dave,
Those are some good examples of when caching might be useful.
|
|
|
|
|
Hello everyone,
I am working on a data acquisition project. Every 1/5 second I read data from a device. It's delivered in a two dimesional array. I want to put samples in a file every 2 seconds. Is there a way to add a twodimensional to another twodimensional array?
I did only find the CopyTo, but it only supports onedimensional arrays.
Software: Visual Studio 2003 C#
Thanks in advance,
Souza
|
|
|
|
|
Is it a 2D array or a jagged array ? If a jagged array, I think you add them one single dimensions array at a time.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello Christian,
You are right about the jagged array. But I get the smples in a 2d array. And there is nothing there can be changed about that. Thanks for your post anyway.
Souza
|
|
|
|
|
How to get acces to each element of the array, which is a member of the class, on which we are using reflection?
|
|
|
|
|
so in example:
Class Test
{
public int[,] a = new int[4,4];
void fun()
{
Type ClassType = typeof(Test);
FieldInfo[] Values = ClassType.GetFields();
foreach(FieldInfo val in Values)
{
???
}
}
}
|
|
|
|
|
|
I have to make a de/serialization similar to XML, but my own
Nevertheless, there is one more problem. During reflection I may have some different arrays of different types (not only int32, but also double, char, etc).
That`s why i cannot declare
int[,] reflecteda = aField.GetValue(this) as int[,];
The information about type of the array is hidden in aField.FieldType which gives eg. "System.Int32[,]". How to declare the needed array, which type is hiden there?
tnx in advance
|
|
|
|