Weng_Smith's Q&A profile
Visual C# Creating a reference to a value type
I need to create a variable that holds a reference to a value type so that something like the following will work: int i = 0; int x = i; i = 2; // i need: i == 2 AND x == 2 This obviously works with reference types: DataSet ds = new DataSet(); DataSet ds2 = ds; ds.Tables.Add("Table1"); // now ds AND ds2 have 1 table (they reference the same object). I thought that boxing a value type would create a reference, but it doesn't: int i = 0; object o = i; o = 4; // But: i != 4 i = 8; // But: o != 8 So, how can I create a reference (NOT a pointer) to a value type EDIT: I'm not sure it ...Show All
Windows Forms How I can add a context menu to right mouse button click?
Can somebody help me Because I couldn't make it work. I add onMouseDown and try to catch rightclick, which it does but doesn't add context menu to control. Just add a ContextMenuStrip to your form, assign it to the ContextMenuStrip property of the control in question and voila, the rest is magically taken care of for you. ...Show All
.NET Development set Content-Type-Encoding in System.Net.Mail,MailMessage
How can I set the Content-Type-Encoding in a System.Net.Mail.MailMessage Silvia, Your (cosmetically modified) example did exactly what I wanted. Thanks! Randy ...Show All
SQL Server Minimizing Penalty (weighted sum of false positives plus false negatives)
I am using Naive Bayes, Decision Trees, and Neural Net (SSAS 2005) to predict which of two states each record belongs to. How can I enforce a different penalty for a false positive versus a false negative (I am assuming that in some sense the mining algorithms can then minimize the total penalty). Thanks, Jamie. Yeah, I have been using the correlation matrix a lot, and do thank you and the rest of the Microsoft BI team for including this useful tool. Thanks too for the pseudo code. If I understand correctly, however, the bottom line is that the algorithms seek to maximize the p ...Show All
Visual C# MCE Remote Control
Hi! I'm new the forums, so please excuse me if this has been brought up before. Anyway, my question is if anyone knows how to directly receive codes from a eHome Media Center remote that comes with many new Media Center PCs. The reason why I ask is that I'm attempting to write a WinLIRC server for the remote. While some commands on the remote already output as "normal" keystrokes, some however do not; for example the Play button. The only thing I've been able to find online is a link to MSDN ( http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnwmt/html/remote_control.asp ) that shows me what some of the Win32 messages a ...Show All
SQL Server Use chart like a matrix
Hi, for a project I am working on I need to put data into a chart the same way you would do it in a matrix. Additionally I have to display the difference between the two values instead of the values itself. Basically my data looks like this, with some example data: country, state, city, period, costs cntry1, state1, city1, 2005Q1, sales, 100 cntry1, state1, city1, 2005Q1, costs, 90 cntry1, state1, city2, 2005Q1, sales, 120 cntry1, state1, city2, 2005Q1, costs, 105 cntry1, state2, city1, 2005Q1, sales, 1400 cntry1, state2, city1, 2005Q1, costs, 1550 cntry1, state1, city1, 2005Q2, sales, 120 cntry1, state1, city1, 2005Q2, costs, 100 cntry1, ...Show All
Visual C# Accessing fingerprint scanners in C#
Hi, I'm working on a fingerprint recognition project in C#, How can we access a fingerprint scanner - USB port interface in C# and capture raw fingerprint images. please help (i'm thinking of buying microsoft fingerprint reader) I did download an SDK from Griaule Inc, but it provides only an encrypted image, Is there no way to do it without an SDK. Cant we use the Windows Image Acquisition library WIA 2.0 for C# ...Show All
Visual Basic AND ONCE AGAIN, ANOTHER NEW QUESTION
How do I create a grid of pictureboxes (25 x 25) on Visual Basic 2005 and auto-name them pbx(row)_(column) for the picture boxes It is to slow and hard to manually rename all 625 of them. Ok question answered, thanks. New question: OK, I ran into another problem. I want it be so that if I click the picture box with the person in it, you can move him by clicking on another tile. How do I do this (I tried (got from Dustin_H 's sample code) : Private Sub PicBox_On_Click( ByVal sender As Object , ByVal e As EventArgs) If PicBox(x, y).Image = Tiles.picPerson.Image Then &nb ...Show All
Windows Forms On a DataGridView control, is it possible to ...
Completely hide/disable the leftmost fixed column Disable cell/row/column selection mode – A mouse click on any cell/row/column does no selection If so, how Thanks, A) Set the RowHeadersVisible property of the DataGridView control to false. B) What is it that you want to accomplish If you don't like the colors of the selected cells, you can set the foreground/background color of the selected cells to be the same as for the unselected cells: Me .DataGridView1.DefaultCellStyle.SelectionBackColor = Me .DataGridView1 ...Show All
Visual Studio Team System Unrecognized default notification 'From' address:
I've installded tfs beta3 without "email enable",and some times i found some error event like: An unexpected condition has occurred in a Team Foundation component. The information contained here should be made available to your site administrative staff. Technical Information (for the administrative staff): Date (UTC): 2005-9-28 3:29:28 Machine: BDJ Application Domain: /LM/W3SVC/3/Root/services-1-127723517376965504 Assembly: Microsoft.TeamFoundation.Server, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a; v2.0.50727 Process Details: Process Name: w3wp Process Id: 2948 Thread Id: 3164 Account name: BDJ\tfsservice Detailed Me ...Show All
Visual Studio Team System Beta3 to B3R physical server migration
Wow. I'm so excited to see this stuff going "live". We've got TFS Beta3 running with 1 project. Now that the refresh is coming, we definately want to upgrade and I've seen the migration guide; doesn't look too bad. However, what would be involved if we wanted to migrate to new physical hardware at the same time When we first installed TFS it wasn't on the best of hardware, and now that we can't live without it, I'd like to give it some respectable equipment. Would I just migrate Sharepoint, then restore the SQL 2005 databases (and all the other steps mentioned) Michael, I haven't tried this, but one way I ...Show All
Visual Studio Creating Delegate Types from Interface Methods
Does the class designer offer any shortcuts for creating a delegate type based on an interface method Great! If i got your question right, microsoft gave us "Generics". I just love it. So, there is a generic event handler: EventHandler < EventArgs > eventHandler = new EventHandler < EventArgs >(DoSomething); I hope this helps you, Regards, ...Show All
Windows Forms Datagrid ColumnStyle MappingName To SubClass of A Collection?
Hello: I am binding a collection of strongly typed objects to a datagrid without a problem. However, when I attempt to set the mapping name of a column to an object property within the base class the mapping does not take. For instance: I have ClassA that has a property of the type ClassB with a property PropA that I want to map t ...Show All
Software Development for Windows Vista Missing Service Does Not Throw Exception
I am using InvokeMethod to call into a DataExchangeService . However, if the service was not added to the WorkflowRuntime before the activity is executed the workflow hangs and the process consumes 99% of the CPU. WorkflowRuntime. ExceptionNotHandled is not fired. Thanks for forwarding that to the dev team. Where should this exception be caught Through the standard exception flow I thought all exceptions went through the exception flow and then fell out to WorkflowRuntime.ExceptionNotHandled if not explicitly handled... ...Show All
Visual C# dynamic casting/creating
this isn't allowed : if (soort.Equals("Form1")) { Form1 formulier = (Form1)Sessie.cachedForms.Pop(); formulier.method_of_form1 formulier.show } else if (soort.Equals("Form2") Form2 ... Error 2 : Embedded statement cannot be a declaration or labeled statement Sessie.cachedForms.Pop() returns a reference to a form. What i want to do is making a new Form of the correct type. If I don't cast it to the right form, it is not possible to access a method. How to do this there are a few ways around this , depends on w ...Show All
