Archived Months
June 2003
July 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
December 2007
January 2008
February 2008
March 2008
April 2008
all groups > c# > february 2006 > threads for wednesday february 22

Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

Run vbs from C#
Posted by MAF at 2/22/2006 9:09:17 PM
I need to find a way to run a vbs on the same thread that I am currently on. Here is the code I have now and this causes the scripts to be run out of order. I want to have the application wait until the process is finished before executing the next script. Process scriptConsoleProcess; ...more >>


how to parse <?xml version="1.0" encoding="UTF-8"?> with xpath? is it possible?
Posted by Daniel at 2/22/2006 9:08:21 PM
how to parse <?xml version="1.0" encoding="UTF-8"?> with xpath? is it possible? ...more >>

Is there an easier or better way to compare Types?
Posted by james at 2/22/2006 7:36:26 PM
AssumeSomeFunctionExists ( Type someType, Type someOtherType) { // I want to know // 1. Are the two the same Type // 2. Are they members of the same Inheritance branch // a) Is someType a subclassof someOtherType or // b) Is so...more >>

String.Replace() in .net 1.1 does NOT work!
Posted by Andrew at 2/22/2006 7:01:27 PM
Hi, guys, The following source code did not work: string pathVal = "2006\"; pathVal.Replace("\\", "/"); I still had the value "2006\", not "2006/", the one I expected. I then tried the second line as: pathVal.Replace('\', '/'); still no luck. Any ideas? Thanks....more >>

Queue Collection not working properly.
Posted by MAF at 2/22/2006 5:31:25 PM
I have a collection setup as a queque collection and when I attempt to deque the collection I get two objects off of the collection instead of one. This usually happens the first time I attempt to deque the collection here is a sample of my object that inherits from the System.Collection.Queu...more >>

Creating a ClassFactory but still have to perform explicit cast on return
Posted by Dan Holmes at 2/22/2006 5:13:28 PM
I am trying to simplify my object creation code so i created a class factory. public class IAFClassFactory { public Object Create<T>() { Type t = typeof(T); return (T)Activator.GetObject(t, "tcp://kit-dev:9988/" + t.ToString()); } } This is the caller ...more >>

Posting 3rd party software announcements
Posted by Andrew at 2/22/2006 5:05:35 PM
I produce a number of products that are of real value to programmers. I normally post release announcements in such places as the Delphi 3rdparty newsgroup where they are well received. I am interested in spreading the word to .net programmers but I don't see an equivalent 3rdparty group. ...more >>

newbie boxing question
Posted by Jacob at 2/22/2006 3:08:50 PM
Hi All, My C# book says that this code string s = 10.ToString(); will box the literal 10 to an object (i.e. allocate a temporary class on the heap). However, if I view this in assembly view (vs2005) I get something like this: int i = 5; 00000057 mov dword ptr [ebp-40h],5 st...more >>



At wits end dealing with "Assembly's manifest does not match assembly reference". Need help understanding the process.
Posted by Richard Lewis Haggard at 2/22/2006 2:58:40 PM
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here really understand how this could be an issue. The assemblies that the system is complaining about...more >>

Reference variable dynamically
Posted by Roger at 2/22/2006 2:47:16 PM
Is it possible to reference a variable dynamically? For instance, string a; this.controls("a") = "foobar"; ...more >>

Whats the point of SortedList.IndexOfKey
Posted by john conwell at 2/22/2006 2:28:16 PM
So you pass in the Key and it returns the array index of the key. but you cant do array index lookups. the indexer of the sortedlist does a binary search based on the key. So whats the pointof this method? is there a way to return a array item based on the index?...more >>

Different control theme in design mode and run mode
Posted by Bartek Tatkowski at 2/22/2006 2:04:01 PM
I have a problem with my C# program. In design mode in Visual Studio (2005) all the controls, like buttons, menus etc. show up as the modern XP theme. However, when I compile and run the program, they show up as the old Win95/Win2k theme. I'll provide screenshots if needed. ...more >>

PInvoke - Structures
Posted by Mythran at 2/22/2006 1:28:04 PM
[StructLayout(LayoutKind.Sequential)] struct MyStruct { public int Number; } [StructLayout(LayoutKind.Sequential)] struct MyStruct { private int mNumber; public int Number { get { return mNumber; } set { mNumber = value...more >>

crossthreading issue
Posted by Andrew Bullock at 2/22/2006 1:18:59 PM
Hi, I've got a wierd problem... Here is my code: public partial class frmMain : Form { private MYClass myClass; private void btnRun_Click(object sender, EventArgs e) { myClass = new MYClass(new CallBack(doStuff)); Thread t1 = new Thread(new ThreadStart(myClass.Run)...more >>

loop over the controls in my form
Posted by be.special NO[at]SPAM gmail.com at 2/22/2006 1:10:18 PM
hi! i have a class chooseLevel : Form and i need to loop over all the radio buttons that are on my form, and check their text. if their text is smaller than 4, i got to disable them. how do i do it? thanx alot ...more >>

Typecasting DateTime
Posted by Michel Racicot at 2/22/2006 1:09:59 PM
I need to put a DateTime variable in a MemoryStream via a StreamWriter. Is there a way to convert the DateTime object into another data type (UInt64 for exemple?) Or is there an easy way to put it in my memory stream? Thank You ...more >>

ColorMatrix - What do all the values do??
Posted by Mark Ingram at 2/22/2006 1:08:50 PM
Right, ive got the following array with which to setup a color matrix. bm[0][0] = 1; bm[0][1] = 0; bm[0][2] = 0; bm[0][3] = 0; bm[0][4] = 0; bm[1][0] = 0; bm[1][1] = 1; bm[1][2] = 0; bm[1][3] = 0; bm[1][4] = 0; bm[2][0] = 0; bm[2][1] = 0; bm[2][2] = 1; bm[2][3] = 0; bm[2][4] = 0; b...more >>

Multiple character constants in C#?
Posted by myjunk12 NO[at]SPAM gmail.com at 2/22/2006 1:04:13 PM
Hi, In C++, I could create an enum like this: enum Position { Quarterback = 'QB', LeftCornerback = 'LCB', RightOutsideLinebacker = 'ROLB' } The multiple character constants get packed into an integer. Up to 4 characters are put in the integer, one per nibble. Can this be done...more >>

Need help with StreamReader
Posted by Sean Campbell at 2/22/2006 12:41:27 PM
Hi there! I need to read the contents of a text file into a string array. I must be doing something wrong because my try...catch goes straight to the catch. Here is major part of my code: try { using (StreamReader sr = new StreamReader(@"C:\Test.dat")) { ...more >>

How To..Mouse
Posted by Pohihihi at 2/22/2006 12:35:07 PM
I have a form A with lots of control on it. I am trapping MouseHover and = MouseLeave to change opacity of the form. Problem is that when I move = mouse over one of the control on the form MouseLeave is fired on the = form. How can I control if mouse is on any part of form or on its = childcontr...more >>

Windows service interacting with the desktop.
Posted by UJ at 2/22/2006 12:21:01 PM
Can any other accounts beside the local system account interact with the desktop of a windows service? TIA - Jeff. ...more >>

ListView Select Sometimes Fails
Posted by rlg at 2/22/2006 12:14:12 PM
We have C# 2005 multi-threaded app. A background thread is processing data and periodically updating the contents of a ListView. Sometimes, the user clicking on a ListView item will not select the item (in the MouseClick event, ListView.SelectedItems.Count = 0). Initially we assumed it was...more >>

Assign value to an object created by a reference
Posted by andrea at 2/22/2006 11:50:35 AM
I want to setup properties value to an object created by reference. I do the following. T t = Activator.CreateInstance<T>(); Type newItem = typeof(T); newItem.GetProperty("PropertyA").SetValue(t, "Hello", null); It works fine, but I see that there is a GetProperties method that returns ...more >>

What control would be best for.....
Posted by CG3000 at 2/22/2006 11:46:36 AM
creating a label to be printed out on a label printer. The image on the label would be a jpeg file with labels and text beside that image. This image and text would be printed out by a printer that prints labels. Is there a document control that will display the image with the text I need p...more >>

Trouble opening a file using BufferedStream
Posted by curt.bathras NO[at]SPAM gmail.com at 2/22/2006 11:08:40 AM
I am trying to open and read a file using the following: BufferedStream stream = new BufferedStream(File.OpenRead(aFilename)); If the file specified by aFilename is being used by another application, an IOException is thrown with the message: "The process cannot access the file because it is...more >>

word interop assembly not loading
Posted by R Reyes at 2/22/2006 9:52:28 AM
Can someone please explain to me why I can't get the MS Word Interop assembly to work in my VS2005 project? I'm trying to manipulate MS Word from my Web Form application and I can't get passed this screen below. Please help, thanks in advance... Configuration Error Description: An error...more >>

Newbie C# Deployment Question
Posted by jndb72 at 2/22/2006 8:56:55 AM
Hi All, I'm a newbie to C# who's just completed their first project. I'm now trying to deploy my project on a new pc for testing. However, it appears to be installing the files in the same location as where they have been developed. eg C:\Documents and Settings\username\My Documents\Visual St...more >>

loading a dictionaryEntry, Specified cast is not valid.
Posted by andrewcw at 2/22/2006 8:40:22 AM
Typically I get a DictionaryEntry from a foreach when walking a Hashtable. My impression is that the foreach returns one item of the hash. One of my commonly used functions received takes a DictionaryEntry as a parameter. In several instances I dont want to recreate a foreach item. but th...more >>

Make a Windows Service start a windows program.
Posted by UJ at 2/22/2006 8:31:06 AM
Is there any way for a windows service to start a windows program ? I have a service that will need to restart a windows app if it needs to. TIA - Jeff. ...more >>

A service can't run MessageQueueing....
Posted by UJ at 2/22/2006 8:17:38 AM
I have a program that works just fine as a windows program. I took an object from it and put it in a service. This object uses MessageQueueing. When I try and start up the app I get the following error message in the event log: Service cannot be started. System.Messaging.MessageQueueExcep...more >>

Webservice question
Posted by Steven Blair at 2/22/2006 6:02:27 AM
Here is my problem: I need to write web application which can do the following: View Accounts Add an Account Update an Account Close an Account My first thought was an ASP.NET pp using a C# dll containing the functionality. The drawback with this, is the interface is restricted because...more >>

Threads with Sockets in them? or Asynchronous Sockets?
Posted by Ronodev.Sen NO[at]SPAM gmail.com at 2/22/2006 5:15:36 AM
the way my program needs to go is -- 1) open a socket and listen on it 2) moment a client connects to the socket - process some data (by sending it to another machine), get the result and send it back to the SAME socket - the data isnt a large value (measured in bytes rather than MB or GB) ...more >>

Maximum number of opened sockets in localhost
Posted by RicercatoreSbadato at 2/22/2006 4:50:56 AM
I use Win XP, which is the maximum number of sockets I can open on the localhost? ...more >>

Maximum number of opened sockets in localhost
Posted by RicercatoreSbadato at 2/22/2006 4:50:46 AM
I use Win XP, whis is the maximum number of sockets I can open on the localhost? ...more >>

CodeDom Parser
Posted by Buddy at 2/22/2006 4:17:30 AM
Is there any good free parsers out there which can parse a CS file into CodeDom? ...more >>

How do I parse a string number into a float with four decimal places?
Posted by Phil Mc at 2/22/2006 3:37:12 AM
OK this should be bread and butter, easy to do, but I seem to be going around in circles and not getting any answer to achieving this simple task. I have numbers in string format (they are coming in from an excel sheet): Examples. 45,666.0041 5664456.12 -5465.25568 ETC I need to format ...more >>

Enforce that a class can only inherit one interface
Posted by Niklas at 2/22/2006 3:25:26 AM
Hi Is it possible in one way or another to enforce that a class only inherit from one of the derived interfaces of a base interface of some kind. For example. public class MyClass2 : IMyInterface1 => OK public class MyClass2 : IMyInterface1, IMyInterface2 => Error Regards /Niklas p...more >>

Catching exceptions thrown from threads?
Posted by Alex at 2/22/2006 2:33:48 AM
Hi Is it possible to catch exceptions thrown by a System.Threading.Thread object? i.e. I have an instance of a class that is created using the normal Thread/ThreadStart method, but once it starts, there will be no try/catch block to catch any exceptions thrown (other than the ones that m...more >>

Simple reflection example?
Posted by Ryan at 2/22/2006 2:27:05 AM
Hi all, I've been banging my head on this for two days so I'd appreciate any pointers from the knowledgable amongst you. I have a win app that recurses through a path looking for assemblies to load, it then attempts to load each file in turn and examine its properties for a 'marker' propert...more >>

Reading the files from CAB files using C#
Posted by sajin at 2/22/2006 2:13:54 AM
Hi all , I have a CAB file ( say Test.CAB ) and it contains xml ,text files , .. dwp files etc . how can i read the file through program ( C# ) Thanks in advance Sajin ...more >>

Override VS2005 options
Posted by Code Monkey at 2/22/2006 2:03:48 AM
I'm using VS2005 for a web project using master pages, but I'm getting rather tired of the HTML output being something like: ctl00_MainContentHolder_xxxxxx is there any way of overriding the ctl00_ part of it? ...more >>

interceptors in c#
Posted by akhila.deshpande NO[at]SPAM gmail.com at 2/22/2006 1:38:32 AM
Hi, I am looking for jboss like interceptor support in .Net. In an application, these interceptors werehooked in Jboss/JVM. they kept track of all methods called and wrote details to log file. This also tracked calls across JVM's I am not able to find something similar in dot net. Chec...more >>

How to get the used interface on an object
Posted by Niklas at 2/22/2006 1:00:28 AM
Hi How do I get the currently used interface on an object? See code below for an example. Regards /Niklas using System; namespace TestInterfaces { class Class1 { [STAThread] static void Main(string[] args) { MyClass2 y = new MyClass2(); WriteClass(y); //Returns M...more >>

List Box & Ajax
Posted by Peter at 2/22/2006 12:39:38 AM
Does anyone have an example of a listbox being populated with data from database while user types the search text in a textbox. I have found examples where a text box is being validated while user types in the textbox or listbox gets populated using Ajax after user clicks on submit button, ...more >>

CodeDom
Posted by BuddyWork at 2/22/2006 12:10:30 AM
Hello, Can CodeDom be used to read an existing CS file. ...more >>

XML Serialization and Generic Collection
Posted by Mirek Endys at 2/22/2006 12:00:00 AM
I have a problem with XMLSerialization. My object are more complex, but for the solution i written example of my code bellow. All is working, in the XML file i have all elements and their attributes, I have there two XMLElements named MyItem, but these elements has no attribute 'Name'. Any...more >>

Why "(500) Internal Server Error" throwed?
Posted by Andy Chen at 2/22/2006 12:00:00 AM
Hi, When I am using the fowllowing code to open page http://spaces.msn.com/members/mailcall/ .... try{ string url = http://spaces.msn.com/members/mailcall/; HttpWebRequest httpReq = null; HttpWebResponse httpResp = null; httpReq = (HttpWebRequest)WebRequest.Create(url); httpResp = (HttpW...more >>


DevelopmentNow Blog