System.NullReferenceException problem

1414 byte By SupremeUK at 2007-11-25 11:31:58
Hi allI'm building a little windows form app in C#, MSVS 2005, .NET 2.0.5 where I have a form, and then a panel on the form, which changes if buttons on the form are clicked, or if an item is selected in the panel, and it works great with the first panel change, but on the second panel change,...

help with design of message passing infrastructure. MSMQ?

1094 byte By tpcampb at 2007-11-25 11:32:09
Requirements:Approximately 200 client machines will generate request messages at a rate of 1 message per minute.Each message should be relatively small 3-4 k max.These messages will be sent to a server machine to be processed. After the message is processed, a response message will be generated and...

List<byte> -> string -> List<byte>

1418 byte By Kensino at 2007-11-25 11:32:19
Does anyone know if there is a way to conver a List<byte> into a string, and then convert that string back into a List<byte> later? It doesn't look like List<byte> supports GetBytes. I was thinking about putting all the elements into a string that is comma delimited and then r...

Is Root ?

126 byte By zvenny at 2007-11-25 11:32:32
I'd like to check if the SelectedPath returned by FolderBrowserDialog is a root.<br/>Any suggestion how to achieve this ?

Encrypting large texts?

228 byte By Charu0306 at 2007-11-25 11:32:55
Is there any way of encrypting large texts? AFAIK, theres a AES encryption has some restrcitions encrypting really large data? It doesnt work...Or Iam getting it wrong..could you please post an example? <br/>Thanks,<br/>CT.

Please give me some feedback on whether you think this code matches the given sp

2517 byte By cjard at 2007-11-25 11:33:14
Below is the code, and in comments, the exact text of the spec that made me write it. Of concern to me is the way the spec goes woolly in steps d) and e) with phrases like "value obtained from D in a)" - do they mean the original D or the (processed D) which they earlier referred to as (D) in step...

Need quick advice / help

1690 byte By Stebel at 2007-11-25 11:33:37
HiI cannot resolve a problem with accessing the same array between 2 threads and a backgroundworker. Here is a sketch of code :class Result{public Result(int a,int b);public _a;public _b;}Result [] res ;bool bThread1=false;bool bThread2=false;ButtonClick(){ backgroundworker1.RunWorkAsync();}t1(){...

Issue with License Dialog in Windows Installer

780 byte By RaleTheBlade at 2007-11-25 11:33:43
Ive created a Windows Installer to aid in the installation of my program, and I have added a License Agreement dialog to the order of dialogs the installer will go through when launched.This License dialog gets its license information from license.rtf which is placed in the application folder. Howev...

Download a file from a web page icon

1544 byte By zhshqzyc at 2007-11-25 11:33:59
Suppose the icon map on http://www.google.com/ links a map file which I may know or not its file name.I want to run my program to download this map file and to save it to a client side that is like "C:\Map\...".How to modify the code?class TestUrl{ public static void Main() {...

How do you kill an application when all you have is the GUID?

276 byte By lagu2653 at 2007-11-25 11:34:06
It's a VPN client and the shortcut references a GUID/registry key/CLSID<br/>{c3a78f90-b4a7-12cd-b979-080a2b30b5eb} I've tried to find an application reference with regedit without success.<br/>How do you kill it when all you have is the GUID/registry key/CLSID?

How do i add EventHandlers to my Inherited or custom classes?

2 byte By dahwan at 2007-11-25 11:34:09
:)

How To: Create a Notification Area Application

425 byte By mariocatch at 2007-11-25 11:34:16
Hi All,I'm looking into developing a client side application that has server side communication, but will be run on a client machine as sort of a windows taskbar application. More specifically, a Notification Area application (in the area with the system clock/etc).Is there some sort of propert...

[RESOLVED] Select an item in a ListView by code

308 byte By JonnyPoet at 2007-11-25 11:34:21
Hi ! I have a ListViewControl which is set to Multilineselect = false so only one row could be selected. I need to be able to change the selection by code. But I cannot find something like SelectedIndex and SelectedItems is readonly. So how to do that ? Thx in before....

Can a program control or access data from another?

613 byte By chobo at 2007-11-25 11:34:43
Sorry if this sounds dumb, but is it possible to control or gain access to data in other applications? I'm not talking about making a macro type program that has predefined mouse movements and timings, but a program that can "tap" into another and access its data, or invoke some of its function...

I cant figure out why this isnt animating >=/

2692 byte By dahwan at 2007-11-25 11:34:55
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace _D_game_01{ public partial class GForm : Form { Point BallLocation = new Point(10, 10); Size BallSize = new Size...

How do I parse this XML??

2513 byte By mmx_nexus at 2007-11-25 11:35:00
Hi,I'm searching for an appropriate way to construct an object model from an XML.The xml is given below and the code for parsing it is also given below..<?xml version="1.0"?><!-- A fragment of a book store inventory database --><bookstore xmlns:bk="urn:samples"> <book genr...

How to use pointers in C#?

471 byte By EmbeddedC at 2007-11-25 11:35:06
Hello best programmers,I'm actually from the C/C++ corner, so maybe I'll ask a stupid question about C#. Suppose I call a function/method and give a pointer as an argument, is this possible in C# (I've read something about 'ref') and is it a good programming technique in C#...

Combo KeyPress MOBILE

360 byte By yoyosh at 2007-11-25 11:35:18
I`m working with .NET compact framework 1.1 unfortunatelly. Combobox does have event KeyPress, but it is not a design property. I suppose that th reason is that this event is "disabled" - so it never fires.Could anyone please help me - how could I capture an key press event on combobox? Anyhow...Tha...

Using delegate for receiving data.

901 byte By EmbeddedC at 2007-11-25 11:35:20
Hello best programmers,I manged to get a socketconnection with another pc and I can receive data and read it. Now I want to call a function in the main when I receive data. I understand I need to use a delegate which encapsulates a a function (or a method) with the right signature...Because I'm...

Problem using Process.Start

1132 byte By jimmygyuma at 2007-11-25 11:35:23
I've written a program to write web pages for me. They're all similar, I just fill in the blanks. I have a button to open the file in Firefox to make sure it looks okay and that works the way I want; it doesn't start a new instance of FF, the currently running instance just creates a...

path.changeextensions

802 byte By Leedogg at 2007-11-25 11:35:29
Hi,I can't get System.IO.Path.ChangeExtension to work. I've created a file, logon.log and placed it in the root of c:\. I just wanted to change the extension to a txt. Below you will find my code. There are no problems running the [System.IO.Path.ChangeExtension(@"C:\logon.log", ".txt"...

2 dimensional array??

1883 byte By ryno3185 at 2007-11-25 11:35:39
I have this 2-d array here and I need to get my program to add rows(which would be tests. I would like to be able to enter the amount of tests that i would like to output using the code i have(so if i only wanted test 1 i would enter 1 and so on) Does anyone know a good website that illistrates so...

Change properties of controll inside of a datagrid

353 byte By zander8778 at 2007-11-25 11:36:01
I am new to C# and ASP.Net and I am running 1.1I have a datagrid that has an image button in the rows of a particular column. I want to make the button visible in some of the rows but not others based on a conditional statement.I can't seem to figure out how to check this and make the button h...

Object Serialization(objects to/from "XML" files)

289 byte By surendra.aluri at 2007-11-25 11:36:21
Object Serialization<br/>How to serialize/deserialize objects to/from "XML" files.<br/>How to store the data in a XML file using Object Serialization. Will anybody help me regarding this. i need this urgently.<br/>Will anybody please send the example of this.<br/>thank you.

Creating a generic method for validation!

482 byte By mmx_nexus at 2007-11-25 11:36:28
Hi,Can i have a generic method for validating an array/arrays.and which fulfils the below mentioned criterias?1. The method should be capable of taking 'n' number of arrays.2.Array types could be string/datetime.3.Should basically check whether each incoming array is empty or not.4.Should...

A question about c# use COM object.

469 byte By winprock at 2007-11-25 11:36:52
//CodeIntPtr comObjPtr;SomeWinapiFunction(out comObjPtr); // Get a com object ptr.IUnknown obj = (IUnknown)Marshal.GetTypedObjectForIUnknown;(comObjPtr, typeof(IUnknown));//use obj.Marshal.ReleaseComObject(obj);My question is , do I need to call "Marshal.Release(comObjPtr)" ? I think "Marshal.Releas...

OpenGL programming in C#

253 byte By walkers25 at 2007-11-25 11:37:00
What is the best way to program a transparent overlay to draw on using OpenGL (using the CsGL library)? Activeborder for the Transparency key doesn't seem to work when working with OpenGL and the CsGL library. Any help would be greatly appreciated.

Preventing Data Fragmentation Over UDP Port

514 byte By RaleTheBlade at 2007-11-25 11:37:05
I have a port listener that listens to a particular UDP port which receives data from multiple sources, often at same or very close times. I think I may encounter a problem in that when two strings or more get to the port, the bytes are fragmented and jumbled together.Is there any way to "serialize"...

Get Line Height/Width

595 byte By Rehorav at 2007-11-25 11:37:15
I need to make a program that can retrieve the width of lines and put it into a histogram. Same thing with the height of lines, but a seperate histogram. I've already looked into histograms and I know how to do those ( I'm using C# for that ). Its how to retrieve the width and height of al...

Override the GetHashCode Method

1438 byte By saktya at 2007-11-25 11:37:21
I need to override the GetHashCode base on this Equals Method:public bool Equals( MyClass myClass) { //check the length if( this.Count != myClass.Count ) { return false; } //iterate through all elements in dictionary...

What is the difference between string and String ?

342 byte By Mike Pliam at 2007-11-25 11:37:23
Just started programming C# and I think I love it using VS 2005 standard edition.What is the difference between the blue-colored 'String', 'Double', etc and the more C++-looking 'string', 'double', etc ? They both seem to work interchangeably.What am I missin...

Is there any kind of analogue for the C++ friend qualifier in C#?

2759 byte By Mike Pliam at 2007-11-25 11:37:24
I've written a class that does complex arithmetic as a first serious attempt to use C#. To my surprise, it works very nicely. Yet it seems a bit awkward in that it appears that I need to include all the functions in my Complex class in another User class with the functions renamed with publi...

What is the syntax to access my C# dll library?

215 byte By Mike Pliam at 2007-11-25 11:37:25
Wow. I built a little DLL library using C#. Now, how do I have another C# program access and use the library ? I understand the general idea. I really need a code example.<br/>Thanks.<br/>Mike :wave:

DataGridViewCell How to Set Data Before clicking save

994 byte By comicrage at 2007-11-25 11:37:27
Hi,I have a datagridview which the user enter data (tex) to a cell. When the user enters the data and click on save, the data is not save to the property set. The grid column is databinded to an object property. However, to get the data to be saved via the property set method, I have to enter the da...

C users access .Net dll

200 byte By kselvaakumar at 2007-11-25 11:37:34
Can anyone please explain me in detail how C users can able to consume .Net dll for accessing its properties and methods?<br/>Reply at the earliest will be more helpful.<br/>Thanks<br/>Selva

DataGridView dataSource is an object property

390 byte By rohit361 at 2007-11-25 11:37:49
The datagridview column is databinded to an object property,the datasource create a column which is always readonly,is there any method to edit the cells,one thing is we can draw the cell on that particular cell, but this is also not working.can anyone know how to edit the cells in datagridview eve...

Calculating CPU usage on multi-processor system

569 byte By talk2venkat1983 at 2007-11-25 11:38:10
Hi All, I have come up with a code to calculate CPU usage which uses WIN32 API's. Code works fine in the single processor system. If I run the code on the multiprocessor system, initially for 3 to 4 iterations it gives somewhat acceptable values but afterwards, it starts giving some negativ...

form scaling

355 byte By novice_andrei at 2007-11-25 11:38:39
hello, i have an application made with System.Windows.Forms. It is a form that contains a treeview.Now, the app starts as a form in the middle of the screen. However, when I maximize the form, I need the treeview to scale to fit the new size, I mean in full screen, what method can i use for this?tha...

Using Method As Argument?

99 byte By code? at 2007-11-25 11:38:58
public void A()<br/>{<br/>}<br/>public void DoIt(this.A)<br/>{<br/>}<br/>can you do that?

Web service question

524 byte By chobo at 2007-11-25 11:39:08
Hi, I was playing around with web services and I noticed most tutorials say you should create a proxy class (.dll) out of the service.asmx?wsdl file. My question is what is the point? I'm using Visual Studio 2005, and when I create a new project to utilize that web service, I just add it as a w...

Executing Options Form

449 byte By JustinMs66 at 2007-11-25 11:39:10
i want to have an "Options/Preferences" form that gets executed upon button click. now i made the form in it's own form file, and right now i can execute it with:Options options = new Options();options.Show();but the problem is that the user can switch between it and the main Form, how can i ma...

restore from image data

168 byte By yolip at 2007-11-25 11:39:11
Hi guys,<br/>I am currently stored all the files and images into MS SQL database as image data. is that possible to restore them to physical files?<br/>Thanks

add items to system menu of window

422 byte By andreyostrov at 2007-11-25 11:39:37
Hi everyone,I have to write a windows service which can track mouse right click events on system captions of other window applications (or in TaskBar), add own item and process this item click.Writing a service is not a problem for me. How could I track user's clicks on system captions and modi...

PDBs for Release assembly for use in Windbg

376 byte By ireland at 2007-11-25 11:39:38
I wish to release pdbs for use with my release dlls with Windbg if a core dump occurs on my client.In my C# project properties in VS I see in the "Build" Tab I see and "Advanced" button, if I select this and then select the "Debug Info" pulldown and from the pulldown I select "pdb-only".Is this enou...

WCF Duplex service --> Update Client GUI

1002 byte By [Beer] at 2007-11-25 11:39:43
Hello!I am learning about WCF duplex services using these sites as learning guide- http://msdn2.microsoft.com/en-us/library/ms731184.aspx- http://msdn2.microsoft.com/en-us/library/ms752216.aspx- (and some other stuff found on google, msdn,...)I made a small change in the client implementation. I cre...

Has somebody made a surveillance thread which doesnt die?

843 byte By lagu2653 at 2007-11-25 11:39:58
I have a log-in window application. When the user presses the cancel button it kills another window by it's name and then it exits. The problem is that if somebody kills the log-in window by terminating the process in the task manager the other window is not killed.One solution might be to have...

Request for Best Practices in .NET socket IO

889 byte By cjard at 2007-11-25 11:40:18
Most the examples I see of doing .NET io either use syncronous blocking IO and the programmer handles the threads, or he uses async io (nonblocking?) and I suspect .NET does the threading in the background.. But are these the best ways, really? The java.nio package did away with blocking IO entirely...

Tab with Datagridview Getting IndexOutOfRange Exception when switching tab views

590 byte By comicrage at 2007-11-25 11:40:19
Hi,I got 3 tabpage containing separate datagridview controls. One of grid is loaded upon init. When I switch to the 2nd tab and request data and binded it to the empty grid, the grid will fill with 4 rows. I switch back to the initially loaded tab control grid, which contains about 20 rows. I get an...

Detect socket close

215 byte By nazgul27 at 2007-11-25 11:40:22
Hi guys,<br/>I am using asynchronous sockets on the server side. Every socket operation is asynchronous. How do I detect if a client closed the connection? I can't find any event for that<br/>thanks

\x0F? a chart? clarification?

4171 byte By w0lfshad3 at 2007-11-25 11:40:29
I found it in the following code, can someone clarify where i get a chart of these escape chars or what they are? Or clarify on the subject? lines:if (args.ControlText.Length > 0 && args.ControlText[0] == '\x0F') if (args.ControlText.Length > 0 && args.ControlText[0] == '\x13&...