Answer Questions
Bill Reiss automagically adding "" {} () [] etc...
I was at an MSDN event yesterday and the presenter enabled a setting in VS2005 that would automatically add a pair of quotes "" whenever the context was expecting it. I have looked in my options of VS2005 standard and I can't find an options which does this. I have found options which purports to automagically add braces {} when a new line is typed I.E. class MyClass { <these added when new line (enter key) typed. } However my system doesn't do this. Is there a master setting somewhere that enables these enhancements Thanks Edwin EdwinSmith wrote: I was at an MSDN event yesterday Ironically I learned about an intellisense feature at a MS event too. It was the property templ ...Show All
Ska Software Approach for creating class method
I am in the middle of a big dilemma. In my app, we have tons of methods for selecting information based on different filters, an in many cases bringing different fields/attributes as well. I thought of naming the methods based on the filter names (e.g. SelectEmployeeOnName (name) would bring all employees that have that name), other option would be to overload a lot of methods, but then this might not work in the cases where I had n methods with the same filter structure, differing only in the returned structure (the object). Any idea on this boban.s wrote: But i will change that name a litle and by that code rules document every method that return someting will begin with Get and then with what type is returning an ...Show All
Ryan F I keep getting a hiding error. I'm confused.
Warning 2 'WindowsApplication3.generalEnemy.onEnterFrame()' hides inherited member 'WindowsApplication3.SceneObjects.onEnterFrame()'. Use the new keyword if hiding was intended. C:\Documents and Settings\Owner\My Documents\Visual Studio 2005\Projects\WindowsApplication3\WindowsApplication3\generalEnemy.cs 24 21 WindowsApplication3 is a warning I'm getting. Basically I have an abstract superclass SceneObjects, and an abstract subclass Characters, which has an abstract subclass generalEnemy. There is a method called onEnterFrame which is defined as public void in all of those classes. I can't define it as abstract in these classes because some of the subclasses are abstract, and therefore I DON'T want them to implement it. I ...Show All
Brandon Hawkins IDE changes the .csproj file <SubType> between UserControl and Component
When any file in my project is changed, I have one UserControl that the IDE changes the .csproj file <SubType> between UserControl and Component. This happens even if the UserControl is not changed. Is there any way to stop the IDE from changing this "Bump" - we have the problem here too, and it is annoying, and SP1 did not help us either. OK, so here it is: we seemed to get past that by just installing the SP1 :-) Hello all, I think another user has hit on the "answer" to this issue here: http://www.pcreview.co.uk/forums/showpost.php p=3645831&postcount=5 The IDE seems to get confuse ...Show All
BrentHecht Error Root?
Hello, I have a C# class library with some functions in it. When I test this function from an C# application everything works fine however when I test them from a MFC application I get following error when I close the application. An unhandled exception of type 'System.ApplicationException' occurred in mscorlib.dll Additional information: Error in the application. Any Idea where and what needs to be fixed Thanks Have you marked your assembly as CLS Compliant If not, you might want to get it to be compliant and restest. That may bare out the problem. Place this in one of the files, it will enforce it for all of the assembly. [ assembly: CLSCompliant( true ) ] I added tha ...Show All
krick Download file and save as Image?
I have a WebClient that downloads a file (.card) from xbox.com. However, in order to display it as an image, how can I download it and display it in a picture box. If this is not possible, are there any other ways of doing this Thanks, I am not sure what the .card file contains. If it is just a simple text file you can manage to convert it to an image by using Graphics and Graphics.DrawString() then Graphics.Save(). On the other hand if the .card file is not a simple text format, you should have .card reader to display it on the screen so you automatically capture this portion of the screen and save it as image, however this is not a straight forward task and involves lot's of coding ...Show All
Mallyx Visual Studio 2005 Tab font colors match backgrounds
Visual studio 2005 is shown on the left and 2003 is on the right: LINK to Image As you can see with my setup the text is now invisible in 2005. How can I change this There does not appear to be any setting in the options menu under tools in VS 2005 to change this font setting. Based on the image you provided, it looks like you've got a third-party theme for Windows installed. Could you try turning off/uninstalling the theme and seeing if that helps If it is a theme causing this issue, it's unlikely we'll be able to do anything about this. -Tom Meschter Software Dev, Visual C# IDE Yes it is indeed specific to the "Panther" theme I am running; but so far this is the only application ...Show All
AlexHardenburg simple decimal format
Hi, decimal.Parse(dr["Value"].ToString()).ToString("N") The line above gives the following error: Type of conditional expression cannot be determined because there is no implicit conversion between 'string' and 'decimal' where dr is a hashtable and dr["Value"] contains 242.4478 any idead how i can do FormatNumber in C# thanks Hi, when you do: decimal.Parse(dr["Value"].ToString()).ToString("N") it returns a string so I assume your error has something to do with trying to assign that string to a decimal: decimal d = decimal.Parse(dr["Value"].ToString()).ToString("N"); This would result in the error you mentioned. You can do: String d ...Show All
Dhivya.S Changing default application
Hello, Can anyone give me some information on how to make a program created in C# the default application for a certain file type e.g. jpeg. And how to detect if the program is being opened by double clicking a file. Thanks, Rob OK been following this and this is my code I have in Program.cs When I double click a wav file it launches the application, but it only executes the messagebox when closing the application, how can I get this code to execute on startup using System; using System.Collections.Generic; using System.Windows.Forms; using Microsoft.Win32; namespace WindowsApplication1 { static class Program { /// <summary> /// The main ...Show All
Shilpa_nad Backgroundworker (part 2)
Hi, A few weeks back i was trying to implement backgroundworker. I got a good code sample but i still didn't managed to get it to work. I messed up my whole code. Nothing was working anymore. So i had to work on my backupped project. Now i got it back as how it was again. I was kinda hoping if someone could help me again with it. Some comments would be really appreciated (in plain English). This is my whole class: public partial class FrmWordDisplayer : Form { public FrmWordDisplayer() { InitializeComponent(); this.FormClosing += new FormClosingEventHandler(FrmWordDisplayer_FormClosing); } private void FrmWordDisplayer_FormClosing(object sender, FormClosingEventArgs e) { DialogResult result = MessageBox.Sh ...Show All
Piotyr overloading == operator in c# fails checking for null values
Hi, I have developed one class called CProductInfo providing == and != operator features. I have one problem. When I use this class in my program, say CProductInfo product = null; and later, when i check for emptiness, if (product==null) it returns false as if the product instance is not empty. I tried various ways to eliminate this run-time error, but it just does not happen. Also I don't think there is use full tips on net for this. Can someone help Thanks in advance - Constantine <<<< THE BRIEF SOURCE CODE FOR CProductInfo IS BELOW >>>>> using System; using System.Data; using System.Data.SqlClient; using MyDataLibrary; namespace ProductManager2006 { public ...Show All
Henrik Dahl Can anyone convert a code from VB6 to C# and VB.NET?
Hi guys! i'm flash.tato a young developer. I have a problem to convert this code from VB6 to C# and VB.NET. Can anyone convert this code from VB6 to C# and VB.NET rivate Sub cmdBIN2GIF_Click() Dim sInput As String Dim iIndex As Integer Dim lPos As Long Dim lLen As Long Dim Fine As Boolean Dim sDestinazione As String On Local Error Resume Next If cdlBrowse.FileName <> "" Then Label2.Caption = "Estrazione GIF in corso..." Open cdlBrows ...Show All
Lakshmi N Server.mapPath
hi, everyone. I using server.mapPath to set as my dir but it could work. Anyone have idea why is it so string myDir = server.mapPath( "" ); especial this part of code.i wan to get any xml file from my folder rather than using absolute path like this @"H:\WSAT\WSAD Assignment"; becuase when i move my file i can just view it without changing my address. public static string [] getXMLFile() { string myDir = server.mapPath( "" ); string fileType = "*.xml" ; string [] files = Directory .GetFiles(myDir, fileType); return files; } hi, ya i had tried but still have this error. Error 1 The name 'server' does not ex ...Show All
Joe Simmonds Trying to stop a service - but getting exception.
Hi everybody, I'm trying to stop a service using the ServiceController object in System.ServiceProcess. I call the stop() method (after ensuring the service is actually RUNNING), but I get an exception returned. The inner exception is a Win32Exception - error code 109 - something about a broken pipe (or the pipe being ended). Can somebody push me in the right direction as to why this is happening NOTE: When I attempt to stop the process manually from the Windows service control panel - the progress bar will move, but never return. If I click "cancel", the progress bar closes and the service says it is stopped (and it is in actuality closed). Thanks in advance, Adrian Configuring/modifying a s ...Show All
Niksta How to add a setting which is an ArrayList
Hi! In the visual settings editor (where you have a list and can enter different settings like strings, integers, bools etc...) how can I create a setting which is an ArrayList. It doesnt work when I choose ArayList. An ArrayList is not serializable so you'll have a hard time doing it. Try using a strongly typed collection of serializable objects instead. Michael Taylor - 11/17/06 ...Show All
