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# > january 2006 > threads for monday january 9

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 29 30 31

open a form
Posted by doller at 1/9/2006 11:43:46 PM
Dear all, I am new to VB.C# .I have 2 forms i want to call form2 on command button click placed on form1. how can i do that . from Doller ...more >>

Calling native C++ function using DefinePInvokeMethod and returning a calculated value as a pointer/by reference
Posted by Marek at 1/9/2006 11:15:42 PM
Hi I need to call a native function in a C++ dll from my C#. The C++ function declaration is shown below. The C# code that I have been trying to perform the call is also shown below. All it is trying to do is to pass in two integers, add them together and return the result in the third pa...more >>

Playing a mpeg file.
Posted by UJ at 1/9/2006 10:17:56 PM
I know this isn't the right place but I don't know where to ask it so here goes - what com/.net object would I use to play a .mpeg file? I don't want to use Window's media player because it has the control buttons on it. I just want to play a video and not let the user do anything to it. Once...more >>

Multiple screens on the same form
Posted by Quina at 1/9/2006 7:40:43 PM
Hi. Is there someone that can tell me how can I have multiple screens on the the same form, displaying only on at the time? Thank you all for any replys. Jo=E3o Carias ...more >>

Scalability of asynchronous sockets?
Posted by taskswap NO[at]SPAM gmail.com at 1/9/2006 7:39:26 PM
I have a legacy application written in C that I'm trying to convert to C#. It processes a very large amount of data from many clients (actually, upstream servers - this is a mux) simultaneously. I've read through what must be dozens of ways to do socket communication in C#, and it seems they a...more >>

user32.dll api and keyboard layout
Posted by Dan at 1/9/2006 7:10:01 PM
Sorry if this post may sound a bit off-topic, but I could not find a specialized newsgroup. I have created a dotnet 2.0 library containing some user controls and written in C#. One of the controls (an extension of RichTextControl) needs to programmatically change the keyboard layout, so it i...more >>

deserialization of xml with unknown object type?
Posted by KenK at 1/9/2006 7:09:45 PM
Hi all, Been reading all day about object serialization techniques in C# and my problem is that everything I read is requiring a "known" object class. Is there a way to create an object from the xml code itself without casting it through an object? If not, what is the best way to allow ...more >>

Viewing Event Log
Posted by Zen at 1/9/2006 7:02:56 PM
Hi, Would someone please point out where I can go to view the event log for the following code? I thought it was the Event Viewer | Application in the Computer Management but I didn't see it. thanks! catch(Exception ex) { // Create a trace listener for the event log. EventLogTrac...more >>



Post my code for FileNotFoundExecption problem, help !
Posted by roopeman at 1/9/2006 6:22:02 PM
I wrote one program which can query processes info., it 's work well in my local Computer, but failed and got the below error when i query remote host processes,anybody can help me ? that 's when remove "\\\\host008" , it 's work well,when i add "\\\\host008",it's got error ! "Unhandled Exce...more >>

Peformance of Deserialization vs new Object construction
Posted by Brian Richards at 1/9/2006 6:12:21 PM
I have an object that I'm serializing (binary) that contains other internal objects that are also serialized. The Object contains two other member objects (let's call them source, and depend) one of which has a state that depends value is derived from source. My question is (if this can be gener...more >>

ASCII charcters from 0x21 to 0xff
Posted by Scott Starker at 1/9/2006 5:14:33 PM
Hi all. What I want to do is create a control array using labels (I already figure out how to create a control array) with 1 label equal to the ASCII font character it displays. What I have found out is every font character from 0x79 to 0xA0 that get converted to a string contains the 4 sid...more >>

Pinvoke - LockWindowUpdate
Posted by Gene Vital at 1/9/2006 4:38:46 PM
I am using the LockWindowUpdate API to lock my form while updating and then Unlock when I am done. It was pretty simple to make the call to lock the form with the form handle but how do I Unlock it? I can't seem to get it. Thanks. ...more >>

SQL Server security exception
Posted by RSH at 1/9/2006 4:05:30 PM
I created a C# class that connects to a SQL Server. I am creating a object on initialization but I keep getting a security exception: "Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934...more >>

What does this error dialog mean?
Posted by stax at 1/9/2006 3:42:59 PM
Hi, lately a lot users of my application complain it won't even startup, there seems to be a few problems. Here is a screenshot a user made of a error dialog I've never seen before: http://server2.ihostphotos.com/show.php?id=61788 Here is my source code: http://www.planetdvb.net/sta...more >>

DataGrid, AllowNew, pasting inserts rows
Posted by whitecrow at 1/9/2006 3:42:07 PM
Hi All, I have a DataGrid that is a visual representation of a DataSet. It was created like so: dataset = new DataSet(); adapter.Fill(dataset); dataGridTable.DataSource = dataset.Tables[0]; dataGridTable.TableStyles.Clear(); DataGridTableStyle tableStyle = new DataGridTableStyle(); dataGr...more >>

Not showing a form when an application runs
Posted by RSH at 1/9/2006 2:33:40 PM
I'm sure this is a basic question but how do I get an application to run but not show a Form until I'm ready to show it? The application uses this code: static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new ...more >>

PInvoke, System.BadImageFormatException
Posted by cwjacklin at 1/9/2006 2:33:36 PM
I read this article on http://msdn.microsoft.com/msdnmag/issues/03/07/NET/ which describes how to invoke C win32 dll from C# But I am running into a weird situation. I have an existing C win32 dll which I want to call from C#. When I use syntax like this [DllImport("User32.dll")] sta...more >>

Context menu and TabControl question
Posted by Hardy Wang at 1/9/2006 2:30:07 PM
Hi all, I have a TabControl in my WinForm, I programmatically all tabs to this control, and add some other controls to each tab. I would also like to set a context menu to each tab, BUT what I need is right-click on each tab name/text to popup the menu, when user right clicks the TabPage ...more >>

Exceptions as return values
Posted by dcassar NO[at]SPAM cmcdataworks.com at 1/9/2006 2:22:41 PM
I have had a lively discussion with some coworkers and decided to get some general feedback on an issue that I could find very little guidance on. Why is it considered bad practice to define a public member with a return type that is derived from System.Exception? I understand the importance o...more >>

USING clause with TRY...CATCH blocks
Posted by Joel Finkel at 1/9/2006 2:20:02 PM
Consider the following, where Foo implements IDisposable: try { using (Foo myFoo = new Foo()) { myFoo.Execute(); } } catch (someException) { // some stuff } finally { // some other stuff } If the call to Foo.Execute() throws an exception, is Foo displosed? ...more >>

Text effects: outline, shadow...in a RichTextBox?
Posted by nick.spacek NO[at]SPAM gmail.com at 1/9/2006 2:16:14 PM
Hi everyone, I'm wondering if it's possible to add outlining or shadow to text in a RichTextBox? On www.bobpowell.net he has some tutorials on how to do so using GDI+, which I realize isn't available for RTBs. Is there a way to reproduce the RTB control using GDI+ instead of GDI? Or are there...more >>

How to view that method is inlined?
Posted by Michael Nemtsev at 1/9/2006 1:51:14 PM
AFAIK, method could be candidate for inlining. But is it possible to view after compiling that method became inlined? Are there some keywords in ILDASM that can show that method is inlined? --- WBR, Michael Nemtsev :: blog: http://spaces.msn.com/members/laflour "At times one remains fa...more >>

I want to handle external events from my c# app
Posted by Paul Fi at 1/9/2006 1:49:24 PM
I want to handle external events from my c# app, especially to events from windows explorer (windows shell) and windows media player how do i go about handling such external events? *** Sent via Developersdex http://www.developersdex.com ***...more >>

Dns.GetHostEntry .NET 2.0
Posted by RWF at 1/9/2006 1:42:04 PM
I am trying to do a reverse DNS lookup using Dns.GetHostEntry in .NET 2.0, but it seems to kind of crap out when the result is an answer with multiple records. It doesnt seem to give any type of answer. The old Dns.GetHostByAddress seems to work partially by atleast returning 1 IpHostEntr...more >>

SV 2005 date conversion error....baffled
Posted by Tim at 1/9/2006 1:24:25 PM
Hi, The following code works just fine in VS 2003 but in VS 2005 I am getting an error: The code: DateTime dClose = System.Convert.ToDateTime(now.Date.ToString("MMM dd, yyyy") + " " + storeClose.Hour + ":" + storeClose.Minute); The error: threw an exception of type 'System.IndexOutOfR...more >>

OutOfMemoryException When Loading Huge file into MemoryStream
Posted by Naamat at 1/9/2006 1:12:05 PM
Hello, I am the sample FPSEPublish (http://blog.baeke.info/blog/_archives/2005/3/3/393158.html) code to upload a document to Sharepoint (WSS). This works perfectly for samll documents. Problem: When I attempt to upload a huge document (300Megabayte) on a PC with 3.6Gig RAM I am gettin...more >>

Question about Databinding - binding controls to members of my business object.
Posted by Michael.Suarez NO[at]SPAM gmail.com at 1/9/2006 1:00:57 PM
Let's suppose I have an instance of MyClass, which has the properties MyText1 and MyText2, and sets the values of MyText1 and MyText2 to 'A' and 'B' in it's constructor. Let's also suppose I have a Form with textBox1, textBox2, btnShowValue, and btnNew. Let's also suppose I have this code. ...more >>

Design Question
Posted by Nate at 1/9/2006 12:48:02 PM
Ladies and Gentlemen, I have 2 design questions for ya'll. And this pertains to developing an ASP.NET application. Question #1 Which is the correct way (and why) for designing class methods? 1. Use reference (input/output) parameters to return multiple pieces of information to the c...more >>

looking for .NET component. . .
Posted by KenK at 1/9/2006 12:19:35 PM
Hi all, I'm trying to find a component that will act sort of like Borland's RunTime Inspector or DevExpress's Vertical Grid. My goal is to parse an xml file and create a properties editor of that xml file. The DevExpress vertical grid appears that it has to be bound to a data component ...more >>

C# and Windows API
Posted by Usman at 1/9/2006 12:14:38 PM
Hi ! I am working over windows API but i am stuck with few structs of win dll's that how can i use them using PInvoke (as i cant use Interop so i have to go with PInvoke). The problem is that how can i convert Windows Struct and deffinations into C# deffinations to delcare them atleast...more >>

Graph control with input
Posted by Arkady Frenkel at 1/9/2006 12:03:18 PM
Hi, all! Maybe some can help me to find control which shows the graph but with possibility to move points of the graph with mouse e.g, so the graph change the position of the the point and return x,y of point moved. Some links if possible on such products TIA Arkady ...more >>

LogonUserA / Impersonation
Posted by Craig S at 1/9/2006 11:43:47 AM
I've implemented the impersonation method shown here: http://support.microsoft.com/?id=306158 under the section "Impersonate a Specific User in Code". Essentially just interop the LogonUserA function in advapi32.dll, execute the code you want, and then undo impersonation. However, this onl...more >>

Identifing file type or OLE component migration to .net
Posted by talam at 1/9/2006 11:30:04 AM
We had an old application developed using Visual Basic Language. We are trying to replace that application with .net 2005, C# Language. In the old application, we had a file attachment component. Purpose of this component was to attach a file to a ticket and store the file in the database (Sy...more >>

Execute command of OS
Posted by alberto at 1/9/2006 11:26:14 AM
How can I execute a command of the operating system like "cls" from a C# code? Thank you ...more >>

ConvertToInt16
Posted by SimonZ at 1/9/2006 11:06:23 AM
If I have for example next select statement in SQL stored procedure: CREATE PROCEDURE test as SELECT 1 as dataNumber If I read this number with dataReader Int16 dataNumber dataNumber=rdr.GetInt16(0); I get an error - invalid cast. If I use convert function than it works: dataNum...more >>

Windows Service Start Parameters
Posted by Al at 1/9/2006 10:40:04 AM
Although it is not recommended to use the Start Parameters for a service, I am wondering why i get an IndexOutOfRange error when i try to access the args[] in the OnStart method. I place say, "Hello" in the field on the services Start Parameters text box, and then write to the EventLog to mak...more >>

IsSerializable
Posted by INeedADip at 1/9/2006 10:20:56 AM
Is there a way to check and see if an object is serializable without just attempting it and catching the error? ...more >>

A File like app.config
Posted by chris.dannemiller NO[at]SPAM gmail.com at 1/9/2006 10:17:59 AM
I am creating a number of files that I want to act like app.config where the application will copy them to the bin/debug or bin/release at compile time. Also I would like the control previews to load these files from the project right now it is trying to load them from Visual Studios common dire...more >>

dynamic reflection from xml file security
Posted by TS at 1/9/2006 10:11:27 AM
i have code that creates assemblies and classes from the assemlby and methods from the classes to set properties of dynamically created controls. How i should go about validating the assemblies, classes, & properties declared in the xml file? Thanks ...more >>

How to double click DataGrid?
Posted by Brett Romero at 1/9/2006 9:59:02 AM
I'm allowing double clicks on a DataGrid by using a counter and timing. However, the user must click two different cells for the double click to work. The reason is once they click into a cell, it can be edited. At that point, a double click does nothing. Is there a way to disable editing on ...more >>

Forward Engineering From Visio 2003 to C# code
Posted by Zen at 1/9/2006 9:29:10 AM
Hi, Would anyone know how to forward engineer an UML diagram created in Visio 2003 sp2 to C# code? Thank you very much! ...more >>

Delegates or events ?
Posted by GTi at 1/9/2006 9:26:39 AM
[now with correct date and time] I have this solution: [File A - WIndows EXE] -> [File B - LIB DLL] -> [File C - Plugin DLLs] A knows about B but not C C knows about B but not A Type A can be a EXE file or NT Service There can be many of type A loaded but not necessarily the same file....more >>

ScrollBars in MDI Child Windows
Posted by james NO[at]SPAM nospam.com at 1/9/2006 9:11:04 AM
How can I control the placement of scrollbars in mdi child windows? I need to place a control at the top of my child form and this control needs to always be visible. The rest of the page needs to scroll. However the default behavior has the control scroll with the rest of the page. Even a...more >>

painting and refreshing
Posted by Nikola Bucic at 1/9/2006 9:08:03 AM
I have a problem with picturebox. I'm drawing on it with picturebox.DrawString, picturebox.DrawRectangle, etc. and it's working fine. But when I open another window over it I lost that. Triggering picturebox.Invoke() or picturebox.Refresh() clears picture box. How to solve problem of clearing ...more >>

DefinePInvokeMethod causing PInvokeStackImbalance when returning a value from the native function call
Posted by Marek at 1/9/2006 9:00:52 AM
Hi I'm trying to call a native C++ dll using the following code (both C# and C++ code segments included). When I make the call to the method (AddTwoDoubles) that has no return value all is fine. When I try and call a function that returns a double (AddTwoDoubles2) I get the following messag...more >>

overrtiding Edit in a datagrid
Posted by melanieab at 1/9/2006 8:14:02 AM
Hi, I have a datagrid and a datatable, and have overrided the Edit method so that the background cellcolor isn't effected when a cell is clicked on. Everything's fine, although now the column won't sort when clicking at the top. Here is some of my code: from Form 1: PropertyDescriptorC...more >>

Database Options
Posted by Eric at 1/9/2006 8:07:02 AM
I am looking for some assistance in choosing a database. I am working on a network management appliction. I need to have a database that will hold a moderate amount of data on the users pc. I have a few requirements: 1. Easy to set up (hopefully no setup required by the user beyond the ...more >>

What control should I use to display an editable table of data?
Posted by joshlaw NO[at]SPAM gmail.com at 1/9/2006 7:54:13 AM
Hi! I've got some data that I want to display and edit in table-format, just like you would in Excel. It seems like this should be fairly straightforward, but I can't find any controls that do what I want. The closest one I've found is a ListView, but it will only let me edit the first column ...more >>

(Delphi-like) Limited-bounds-types?
Posted by matko at 1/9/2006 7:47:43 AM
As far as I can see, there is no similar way of replicating the following Delphi-code in C#... Is that true? type IntRange = -5..5; CharRange = 'a'..'z'; TColors = (Red, White, Green, Blue, Yellow); ColorRange = White..Blue; ...more >>

AppDomain closing ?
Posted by JPSutor at 1/9/2006 7:29:25 AM
when I use the AppDomain.UnLoad method (which calls the Thread.Abort method), I get the following error message AppDomain can not be unloaded because the thread 1378 can not be unwound out of it It seems to take time doing this. If I wait for about 30 seconds, it seems to get unloaded. An...more >>

Assing address to pointer
Posted by Vlad at 1/9/2006 7:12:04 AM
In the following code: unsafe class X { byte* _address; void test() { _address=(byte*)144220152; } } Why the watch windows shows a differtent address for _address variable ? ...more >>

Reflection Question - Convert VBScript to C#
Posted by CJ at 1/9/2006 6:03:19 AM
Hi I'm trying to send email via a c# app, and I've come across various ways to do it, but the way that seems best given my constraints is this little vbscript: Dim theApp, theNameSpace, theMailItem set theApp = CreateObject("Outlook.Application") Set theMailItem = theApp.CreateItem(0) ...more >>

Object referenced by events can be garbage collected !
Posted by Olivier Fermy at 1/9/2006 5:29:04 AM
I have created a sample project where i have referenced an object only with an event : textBox.VisibleChanged += new EventHandler(this.textBox_VisibleChanged); When i call GC.Collect(), the object is disposed and garbage collected ! I thought that event references are strong references and n...more >>

Parsing multipart response.
Posted by Vijay at 1/9/2006 4:21:02 AM
Hi, In my application i have to parse through a multipart response. In my case the first part is a xml portion and second part is byte stream [image] portion. How can i parse through the various parts in the response and get the values in each part....more >>

Using hashing in collectionbase
Posted by myPosts at 1/9/2006 3:33:32 AM
Hi all, I am having class which is derived from collectionbase class. I am adding some string elements to this collection. What i want is to add support of hashing into class which i have derived from collectionbase. Because currently i am adding strings to my collection and at a time o...more >>

Setting focus to a particular cell in DataGrid
Posted by sailu at 1/9/2006 3:07:33 AM
Hi, Anyone knows how can i set the focus to a particular cell in DataGrid. Thanks, Sailaja. ...more >>

MyXaml for CF 2.0
Posted by wittmannstefan NO[at]SPAM yahoo.de at 1/9/2006 2:24:01 AM
I didn't have any problems with running MyXaml 1.00 (for Compact Framework) on my Pocket PC with MS Visual Studio 2003. But since I have installed VS 2005 I tried this without success; - although it works with a regular Windows-Application with any MyXaml.dll-Version. An error occurred: "NullRe...more >>

Disposing Com+ Object
Posted by sternr at 1/9/2006 1:27:56 AM
Hey, I have a C# assembly that inherits from ServicedComponent and is installed in the Com+ with ServerActivation. And I have a C++ application that calls this Com+ object successfully, But the problem is that I cant seem to dispose the object! I tried calling the following code: myComPlus->...more >>

C# and filesystem monitoring
Posted by Mantzas at 1/9/2006 1:21:02 AM
HI, i am trying to build a little windows services that logs all changes in an direcoty on the hd. Now this will work on a pc in a lan. Is it posible to get the ip or the user who did this change on a lan??...more >>

How to have DataGrid AutoScroll without stealing the focus ?
Posted by Sharon at 1/9/2006 1:13:02 AM
I have added an auto scroll feature to my DataGrid control like this: private void DoAutoScroll() { DataView dv = m_DataGrid.DataSource as DataView; DataGridCell cell = m_DataGrid.CurrentCell; cell.RowNumber = dv.Count; m_DataGrid.CurrentCell = cell; } But this the last lin...more >>

Disposing Com+ Object
Posted by sternr at 1/9/2006 1:01:58 AM
Hey, I have a C# assembly that inherits from ServicedComponent and is installed in the Com+ with ServerActivation. And I have a C++ application that calls this Com+ object successfully, But the problem is that I cant seem to dispose the object! I tried calling the following code: myComPlus->...more >>

System.IO.File.Copy changes the current Directory
Posted by Avi at 1/9/2006 12:23:24 AM
Hi All, I am using following function to copy a file. System.IO.File.Copy(sourcefile,destFile); I am giving absolute path in destFile. (eg. "C:\avi.txt") After execution of this call, my current directory changes to "C:\". How can I prevent this? I want my current directory to rema...more >>

System.IO.FileNotFoundException problem ?
Posted by roopeman at 1/9/2006 12:05:41 AM
I wrote one program which can query processes info., it 's work well in my local Computer, but failed and got the below error when i query remote host processes, anybody can help me ? "Unhandled Exception: System.IO.FileNotFoundException: Explorer.EXE at System.Diagnostics.FileVersionInf...more >>


DevelopmentNow Blog