-
- Which One is faster????
by Saurabh Surana
- 8 Replies
- Last post
by Matthew Watson
- I have heard that in C# .Net the notation if (flag) should be prefered over if(flag == true) or if(true == flag) Is there a difference in above statements Which one gives better performance and why Many Thanks,
-
- Problems Unit Testing
by jelamb
- 9 Replies
- Last post
by jvince0812
- I can't seem to get unit testing to work. I'm using Nunit, and can't get the following code to execute when I debug: [Test] public static void TestGraphicEngineForm() { MessageBox.Show("Yay!"); } I'm working through the Space Commander tutorials and hit this problem. Really frustrating. Any ideas
-
- Synchronizing for loops running on seperate threads
by Salamandras
- 10 Replies
- Last post
by OmegaMan
- Greetings I would like some help on achieving synchronization between multiple threads running a for loop. In more detail I would like each thread to be in the same iteration with each other thread, meaning no thread would be in the fifth iteration when another is in the second or in the first... So the results would go Thread1 = iteration 1 Thread2 = iteration 1 Thread3 = iteration 1 Thread4 = it
-
- help a c++ guy with pointers please
by Razer1911
- 3 Replies
- Last post
by eradicator
- I have a GUI program with the followin structure:
A class Foo() that contains a collection Dictionary dict
The allmighty class Form1() that you have to have for graphics,
in this class I do
Foo f = new Foo(); and then I want to display and edit the contents of the dictionary dict in this class, for example in a listBox.
In order to do this in C++ I would have this code i
-
- Read a String and identify number of Different characters ??
by thukralz
- 3 Replies
- Last post
by Mark Dawson
- I have a String which user enters, I need to determine how many types of different characters are there
For Example :
If User Enters :
Test
T or t - 2
E or e - 1
S or s - 1
This string can be really long what is the best way to get this done...
-
- overriding MaxLenght
by w0lfshad3
- 2 Replies
- Last post
by w0lfshad3
- I was going over an example of creating a custom control made up of a label and a textbox.
After going through it i am doing an exercise on it. The exercise sais i must create a new MaxLenght property that stores the maximum number of characters that can be entered into the textbox. I did that. The rest was adding an event for when MaxLenght is changed. The problem arose when i tried to overrid
-
- Restricting function throw types in C#
by aztec2_step
- 4 Replies
- Last post
by nobugz
- I'm trying to convert a C++ program to C#. One of the things we can do in C++ is restrict function throw types.
void myFunction ( int test ) throw ( int, char, double ) { if ( test== 0 ) throw test; // throw int if ( test== 1 ) throw 'a' ; // throw char if ( test== 2 ) throw 333.23 ; // throw double }
I'm curious if there i
-
- Monitor new processes?
by PaulLeBlanc
- 2 Replies
- Last post
by PaulLeBlanc
- I'm looking for a way to use System.Diagnostics to figure out when a new process starts. I don't want to poll the Process collection to see if something is added. I want to set up a handler to listen for some event that fires when the new process starts. But I'm talking about a process that is not a member of the current list, and it starts, and I want to get the notification. I know there must be
-
- Visual Studio 2005 exits when opening web application
by ggalbo
- 2 Replies
- Last post
by ggalbo
- When attempting to create a new web application: 1. All the appropriate files (as far as I can tell) are created, but the solution is empty. 2. Attempting to open the project through the .csproj file causes Visual Studio to exit immediately. Any ideas Thanks, Gio
-
- Which is better? 'string.Concat()' or '+'
by kid_kaneda
- 13 Replies
- Last post
by Matthew Watson
- I was wondering what the difference between
string .Concat( "a" , "b" , "c" )
and
"a" + "b" + "c"
Looking at the IL there is no difference in the IL code so I guess it's just a style thing, but which is the prefered way of coding it in C#
Thanks
Kaneda
-
- Unable to create a file right after deleting it
by heavenlycharmus
- 4 Replies
- Last post
by Figo Fei - MSFT
- Hi, I used File.Delete(filename) in my program to delete a file, but if I want to create the same file right after I delete it, I sometimes, but not always, get the following error message: The process cannot access the file 'C:\out.txt' because it is being used by another process. Is there any kind of stream I need to close after using File.Delete() to prevent this error Thanks!
-
- Custom Object, Typed DataSet or DataSet
by Jannet
- 1 Replies
- Last post
by Ashish Basran
- Hi All,
I have a big project , which designs as 3-tier. Most of work is database updateing.
Inserting, searching. Speed is not requested so much. Users are around 100.
New DataFiled may be added frequently.
Which is best regarding using Custom Object, Typed DataSet or DataSet
I saw so much discuss and confuesed. Is anybody with true experience will share
experience
If using t
-
- .NET Interview questions
by ronedin
- 10 Replies
- Last post
by InterviewCracker
- Hello,
I have interview on monday. I need some questions please.
Ron.
-
- Recursive Hierarchy of generic interfaces
by MuscleHead
- 2 Replies
- Last post
by MuscleHead
- I'm trying to implement a parent-child relationship between 3 objects, and I want to constrain what can be a parent of what. interface3's parent can only be interface2; interface2's parent can be either interface3 or interface2
interface3 -> interface2 -> interface3 -> interface2 -> ... -> interface2 -> interface1
As a first step, I tried to implement an interface hiearchy
-
- linux application
by Gallo_Teo
- 3 Replies
- Last post
by n0n4m3
- Hi to all, is it possible with visula studio to develop a compatible linux application and if i have to use DirectX sdk library wich is the best solution
thanks
Teo
-
- XML to XLS Template - Column Header Formatting
by BeauKu
- 11 Replies
- Last post
by BeauKu
- Hi...I'm looking to bold and center my column headers and can't seem to find the best way to do it. I'm pretty fluent with C#, but not xml. My code exports to xls just fine, but would really like the headers to look better.
My information is pulled from a datatable with
string [ ] sHeaders = new string [dtExport.Columns.Count];
string [ ] sFields = new string [dtExport.Column
-
- Capture Console Output to CLipboard
by AlexBB
- 11 Replies
- Last post
by AlexBB
- I just tried to run a small Console app demo which closes the Console as soon as the output is flushed out and you cannot read anything. The human eye is not that fast, you know. It is a problem I want to solve expertly not the way I did by putting in a statement that threw an exception. That allowed me to copy the Console to the Clip. This is my lame attempt. I want to know how the standard outpu
-
- Why C#
by Vikram Shetty
- 7 Replies
- Last post
by ahmhdy
- I know this is very basic question. But why one should select C# over VB.net
-
- Inheritance from an Abstract Class
by booberthecat
- 2 Replies
- Last post
by BinaryCoder
- Hello!
I am rather new to C# and .NET, but have developed in other OOP environments in Win32.
I am creating a small MDI application where I would like to create an abstract base child window class (frmChildBase) from which I could inherit to define a series of child window classes (e.g., frmCustMaster, frmVendMaster). I will never be instanciating the base class so making it abstract
-
- Does Microsoft Vista Supports Visual C++/MFC Application
by Kihat
- 1 Replies
- Last post
by Matthew Watson
- Hi! I have a query here regarding the Microsoft Vista. does Microsoft Vista able to support Visual C++/MFC application What I know is it is able to support .NET application. Does anyone knows about it
-
- I would like to ask about Face Detection
by ki_ki3939
- 5 Replies
- Last post
by Timo S
- How to use c#.net for face dection do you have an example code please let me know
thanks
-
- Problems with Setting.settings
by Vineed
- 14 Replies
- Last post
by Vineed
- Hi,
I have a Windows based Application written in VC#.Net 2.0. I have used settings.setting file for configuring several user based configurations. Now I have a form which can change and save the user based configuration of this file.
The problem now is that when I start to debug the application (by pressing F5 of course), the application does not load the updated settings file of t
-
- define a property which accepts a parameter
by papadi
- 14 Replies
- Last post
by boban.s
- Hello!
What's the C# syntax to define a property which accepts parameters. The VB syntax whould be:
Public ReadOnly Property Item(ByVal index As Integer) As Object Get Return CType(Me.List.Item(index), MemberDataValidationError) End Get End Property
-
- Property based on another class
by ptenter
- 14 Replies
- Last post
by Manju Sandhu
- Hi,
I'm not good in C#. I want to create a property based on another class. My approach is not working. It is compiling but giving error like "stack overflow". I tried various other options. Below is my implementation:
public class MyProp
{
private static string sStr1;
private static string sStr2;
public static string Prop1
{
get {return sStr1;}
s
-
- why is this statement not working?
by cheatcountry
- 14 Replies
- Last post
by Sharad Nair
- What I am trying to do in this code is if the user clicks the checkbox (default is to be unchecked), then it will stay checked when the user goes back to this window. My code is below: private void frmPreferences_Load(object sender, EventArgs e) { // Attempt to open the key RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\\Franklin's Stock Project\\Preferences&quo