Rob Tiffany's Q&A profile
Visual Studio 2008 (Pre-release) Changing ListViewItem to ListViewItemEx in a ListView
Hi, I have done an extension on the ListViewItem that I called ListViewItemEx and now I want any listview to use ListViewItemEx instead of ListViewItem. When I set the ItemsSource in a ListView, I no longer want to have ListViewItem but ListViewItemEx. Is it complicated I should I proceed /// <summary> /// List View Item extension /// </summary> public class ListViewItemEx : ListViewItem { ... } Thanks in advance. Hi Freedon, I apologize for not adequately answering your question. In order to begin, I would recommend that you create a user control that extends the ListView control. Here is some documentation regarding how to develop a custom ...Show All
Visual Studio Express Editions Problem with RSS reader project
Hi, I downloaded the beginners videos from http://msdn.microsoft.com/vstudio/express/visualcsharp/learning/#beginners and all was going well, I'm on lesson 15 and have read the additional writing for this project and have done everything shown in the video and I've looked extensively at the snapshot included in the download, my code is identicle and up until now always compiled and executed, after adding the code from this lesson however my application crashes. The problem seems to be here: // Begin the WebRequest to the desired RSS Feed System.Net.WebRequest myRequest = System.Net.WebRequest.Create(rssURL); System.Net.WebResponse myResponse = myRequest.GetResponse(); // Convert the RSS Feed into an XML document ...Show All
SQL Server info about sql server 2005 everywere
Hi , I must to realize a database application for an Automation system consisting of a Industrial PC with Operative System microsoft windows embedded. 1° question : Is Microsoft sql server 2005 everywere compatible for Microsoft windows embedded (I ask this because in specific of its is not clear) 2° question : In the case that it's compatible, if I instal it in a industrial Pc can it to act by database server or necessity of a remote server Tanks Yes, SQL Everywhere can run on Windows XP Embedded (I think that is what you are asking). It can be used as a local database for your embedded application without ever synchronizing with a server, and it can also use two data synchronization technologies call ...Show All
Visual Studio Express Editions AutoIncrementing UniqueIdentifier column in SQL databse table giving NoNullAllowedException!
Visual Basic 2005 Express: In my SQL database table, I have a CustomerNbr column. In Database Explorer's table definition it has "UniqueIdentifier" as it's data type, and is set as the PrimaryKey. In the XSD Designer, this field is set as the primary key, AutoIncrement=True. DefaultValue is <DbNull>, but, it won't let me remove this! When I add a record to the DataGridView, it correctly puts a "1" in the CustomerNbr column, but, when I update the record, I get a System.Data.NoNullAllowedException! there are many reasons for it existing. one of our SQL Guru's here did say @@Identity is bad practice and not recommended but rather scope_identity() to be used for the ID ...Show All
.NET Development WriteXML
Hello. I have a dataset that I filled with data and I want to write it to an xml file. I know how to use the dataset.writexml() command and it does not output the data exactly like I need. The xml output contains the xml declaration information and the dataset name as the root node. I do not need these. I found out how to remove the xml declaration with the following code: Dim xws As Xml.XmlWriterSettings = New Xml.XmlWriterSettings() xws.ConformanceLevel = Xml.ConformanceLevel.Fragment xws.Encoding = System.Text.Encoding.Default xws.Indent = True xws.IndentChars = " " xws.OmitXmlDeclaration = True Dim xw As Xml.XmlWriter = Xml.XmlWriter.Create( "c:\aa.xml" , xws) ds.WriteXml(xw) ...Show All
Software Development for Windows Vista Displaying Media from an IStream - is Directshow what I should use
Warning - I'm a complete beginner at DirectShow. I need to come up with a solution to play audio and video in our application. However there are several gotchas in the requirements, that are making it difficult for me to know where to begin - I think Direct~Show is the answer, but am not sure how to proceed. The first gotcha is that the media does not exist as files on the users machine - they are downloaded from remote machines and need to be played as they are downloaded. I can provide an IStream interface to the data. The second gotcha is that I do not know what format the data is in ahead of time. I do receive the filename of the data on the remote machine and I can seek to any position in the file and read a block of data. ...Show All
.NET Development Setting up trust
How do i go into the framework and setup trust for new users to run apllications Check out the SecurityManager class in the System.Security namespace. This is explained in one of shawns blog posts http://blogs.msdn.com/shawnfa/archive/2004/09/09/227534.aspx hope this helps tribal ...Show All
Windows Forms Which innermost child control has focus ?
I have form which in turn has various child controls. The child controls in turn have child control and so on. Is there a direct way to find which of the iinermost child control has focus Try this: public static Control FindControlWithFocus(Control parent) { if (parent.Focused) return parent; foreach (Control ctl in parent.Controls) { if (ctl.Focused) return ctl; Control child = FindControlWithFocus(ctl); if (child != null) return child; } return null; } private void toolStripButton1_Click(object sender, EventArgs e) { Console.WriteLine(FindControlWithFocus(this.ActiveControl).Name); } ...Show All
Visual C++ How do I make a modal window
I've made a number of windows and I'd like a few of them to be modal (they will appear when different events are triggered and remain open until the user closes them). I am using Win32 and I thought there was a flag like WS_BORDER that I could use. Any suggestions A modal window is essentially one that disables its parent window, and enables it when it is closed. If you are not using a dialog box, then you just need to do this yourself and achieve modality. ...Show All
Visual C++ how to link undefined data types of VC# dll in VC++
Hi, I have created a VC# dll using Visual Studio 2005, and I am using it in VC++ project(again created in Visual Studio 2005). For using this dll I simply add #using <mscorlib.dll> to the stdafx.h file and then I enabled the /clr option in the project properties. Now when I add my dll to the VC++ project as ... using "mcMath.dll" I get the following errors at the specified location of dll declaration... Error 1 error C2059: syntax error : 'string' d And these errors where my main function starts... Error 2 error C2143: syntax error : missing ';' before '{' Error 3 error C2447: '{' : missing function header (old-style formal list ) .... I do not have any function or exported values as strin ...Show All
Visual Studio 2008 (Pre-release) NetTcpBinding -> UsernameAuthentication
Hi, I have a server with NetTcpBinding enpoint and I want to use custom username authentication on a session level. So, credentials are only transmitted once when the session is established and not with every message sent. Can someone help me out here Thanks, Tom Hi Pedro, thanks for your reply. Am I understanding this correct that by using security mode = message, no additional data will be attached to each message, so message sizes remain the same Thanks, Tom ...Show All
Smart Device Development how to load dll file in smartphone?
Hi all, I'm using C# to write the windows mobile 2003 application and deployed on the smartphone. I used the method [DllImport ("vam.dll")] public extern void detect(string xmlFile, string imgName); to import the dll into the application "Debug" folder. i call the dll funcion using detect("xmlFile", myImage); My application is to detect the region on the image file automatically on the desktop and it runs successfully on the desktop version. Now, i have to migrate my existing automatic detecion of region on desktop to the smartphone. I using the same method mentioned above, there is no compile error found. But, when i run on the smartphone, I get the error while running. The error is "NotSuppo ...Show All
Visual Studio 2008 (Pre-release) Application.LoadComponent() problems June CTP -> RC1
The Application.LoadComponent(component, uri) is no longer working if the component and the resource pointed by the uri live in different assemblies. Unfortunately this change makes it impossible to have components from one assembly to inherit from components from another assembly. Say you have a custom MyWindow control that lives in a Common.dll assembly. Its generated InitializeComponent() code contains a call to Application.LoadComponent(this, new Uri("/Common;component/mywindow.xaml"). So far so good. Now in the Application.dll assembly you have another class AppWindow that extends MyWindow. When it loads it calls MyWindow constructor which in turn calls MyWindow InitializeComponent. The result is a System.Exception : T ...Show All
Visual Studio Adding (and editing) .suo files to source control
Hi, I hope I've asked the question at the right place. Our project uses a different than default working directory, so this has to be set in Debugging > Working Directory for the clients. The problem is the working directory is saved in the hidden .suo file which one cannot edit by hand so easily. Is there a way of creating a new .suo file with only the binary data for the working directory in it, add that to source control I presume on checkout VS will then reconstruct all other paths and stuff in there for the users. Solutions either for VS2003 or VS2005 would be great. Donnu why that file has to be binary though, if it were like the .sln or .vcproj files it would've worked. Hi, I don't know ...Show All
Windows Forms datagrid keypress handler
This works well but seems to work for all columns, Can anyone correct or advise me - thanks. void Numeric_KeyPress(object sender, KeyPressEventArgs e) { string str = "\b0123456789"; e.Handled = !(str.Contains(e.KeyChar.ToString())); } private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { if ((dataGridView1.CurrentCell.ColumnIndex) == 0) { e.Control.KeyPress += new KeyPressEventHandler(this.Numeric_KeyPress); } } Yes, it affected every column, as soon as you change column 1 or column 4 then all columns will only accept numerics. Do I need to remove the handler for columns other than 1 or ...Show All
