Matt Lund's Q&A profile
Visual Studio 2008 (Pre-release) Text Areas
hi is there a component in wpf, that can accept several lines of code such as the text area in HTML thx thx anyways i managed to find out private string GetText(RichTextBox richTextBox) { // use a TextRange to fish out the Text from the Document TextRange textRange = new TextRange(richTextBox.Document.ContentStart, richTextBox.Document.ContentEnd); return textRange.Text; } = new TextRange(richTextBox.Document.ContentStart, richTextBox.Document.ContentEnd); return textRange.Text; } http://blogs.msdn.com/jfoscoding/archive/2006/01/14/512825.aspx incase it is of help to you ...Show All
.NET Development Refrerenced memory at 0x0000000c could not be "read"?
Hello all you nice people out there in 'Sanity' land, First - a message from my sponsor: 'For the record, I'm no computer wiz. And, I also do not know all-a-da proper terminologies either. This is stated before someone ups and decides to send any defamatory e-mail my way. Thank you.' You may now return to your regularly non-scheduled e-mails. Ah, hello again. Now, sledge-in-hand, let's have it. I had installed the VisualBasic Express, oh, about 2wks ago. A very short time thereafter I got an error message. It read, reads, as follows: aspnet_state.exe. Application Error. The instruction at 0x6a2a2fec referenced memory at 0x0000000c could not be "read". ...Show All
Visual Studio Visual Studio 2005 SP1 is now available!
Visual Studio 2005 SP1 has now shipped and is available for download here: http://msdn.microsoft.com/vstudio/support/vs2005sp1/default.aspx I'd like to take a moment to thank everyone for using the ReportViewer controls, for helping to answer questions in this forum, and for bringing issues to our attention. I have enjoyed answering questions in this forum over the last year and look forward to continuing. While we haven't been able to respond to every question posted on this forum, I can assure you that we do read all of them and use the feedback to help plan and prioritize future releases. Below is a partial list of fixes that are included in the ReportViewer controls in Visual Studio 2005 SP1. Fixed several issues around A4 ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Joypad problems
Hi have just set up C# EE and XNA game studio, no problems there. Compiled and run ok, but I get absolutely nothing from my Joypad, no buttons, no direction, nada..So am forced to use keys which respond fine The joypad works fine in other games, so is XNA only compatible with Xbox 360 joypads TIA Brian If you don't have the latest DirectX SDK you might want to download it and take a look at the DirectInput samples. They'll show you exactly what you need to do to get it running in your game. There's also a ton of resources available on the various game dev sites (you might start at GameDev.net). ...Show All
Windows Forms Is it possible to set a user control to be owner drawn?
I have this user control that is acting like a form. It contains buttons inside of it, and you move it around a window. But I don't want to use a form because I add this control to a panel that is my background for my main window. Basically I want complete control for drawing this user control because I'm trying to get around the whole 'transparency is set to the parent's background color' thing/hack and implement true transparency in my own draw code. Any help would be much appreciated. Eh, I tried a bunch of things. At one point I was creating a bitmap, so I could do per pixel alpha, then trying to use "DrawFromBitmap" but that function was causing weird issues like making programs outside of m ...Show All
Visual Studio Express Editions Application.StartupPath in DLL
I often use Application.StartupPath in my applications. Now I want to use something similiar from within a dll but I can't find any code to do it. All I get is "Application" is undefined. I want to get the StartupPath of the application that calls the dll. Is it possible A code snippet would help. Roger The Application class is defined within the System.Windows.Forms.dll assembly and if you add a reference to it you will have access to it. Don't forget to add a 'using System.Windows.Forms' to the top of the file you are using Application.StartupPath in so that you do not have to type it's full name (unless you want to ). ...Show All
Visual C++ is this the correct/best way to set file size?
Hello everyone, I have verified that the following approach works to set the size of a file (newly created file) to be 100 bytes, but I am not sure whether it is the correct/best way to have a maximum portability (I need to write code on both Windows and Linux). Could anyone give me any comments [CODE] #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> #include <io.h> #include <stdio.h> int main() { FILE* file = fopen ("foo123", "w+"); fseek (file, 99, SEEK_SET); fprintf (file, "x"); fclose (file); return 0; } [/CODE] thanks in advance, George Thank you Sam, Sam Hobbs wrote: UNIX and Linux are ...Show All
SQL Server Indexing Question
I am somewhat new to SQL and have an indexing question I have a table that consists of 60 columns of mostly numeric data. Included in the table are fields called Customerid, CustDate and CustTime. Every hour data is posted to the table with the current time and date as well as customerID. The table is about 6 million rows. I have a query that reads: SELECT CustomerID, custdate + custtime as date FROM Mytable WHERE CustID = 905 and (date between ‘1/1/7’ and ‘1/17/7). The query works but it takes longer than I would like so I am wondering if it’s an indexing issue. Currently my table is indexed as CustomerID + CustDate + CustTime. None of the fields are unique, but the combination of the 3 i ...Show All
Internet Explorer Development CSS background repeat not working in IE 7
Hello, I am currently developing a ASP.NET 2.0 application and everything was fine until I upgraded my browser to IE 7 from IE 6. I realised that my div background is not working anymore. The background is not repeating itself anymore. I googled but could not find an answer. Below is my code. Perhaps some experts can shed some light on how I can solve the problem Thanks! .rightblock { border : 1px solid #fea632 ; padding : 15px ; margin-bottom : 10px ; background : url(images/background_columnright.gif) repeat ; position : relative ; width : 446px ; } What is the path to the image relative to in your case Is the image not showing up at all or is it no ...Show All
Windows Forms problem with bindingnavigator and multiple tables
Hello, this is what I have got on my form: datagridview1, bindingsource1, bindingnavigator1 and dataset1. bindingnavigator1.bindingsource is set to bindingsource1 ,datagriedview1.datasource is set to bindingsource1 and bindingsource1.datasource is set to dataset1. Then I write this: SqlDataAdapter dataad = new SqlDataAdapter("Select * From OrganizaciisTanamshromeli; Select * From ProgramuliSistema; Select * From OrganizaciisKlienti;", sqlconn); dataad.FillSchema(dataSet1, SchemaType.Source); dataad.Fill(dataSet1); dataSet1.Tables[0].TableName = "OrganizaciisTanamshromeli"; dataSet1.Tables[1].TableName = "ProgramuliSistema"; dataSet1.Tables[2].TableName = "Organizaci ...Show All
Visual Studio Express Editions updating textbox text in a "for" loop
if i have say 100 textboxes called txb0 through txb99, how can i set the textbox name in a loop i need to append the "i" value onto the end of the textbox name but not sure how to do this like: for (int i = 0; i < 99; i++) { textBoxName = "txb" + i; textBoxName.Text = "whatever..."; } what's the correct way to do this thanks mark The following code loops through all controls, put directly on the form, and sets textboxes' Text to display their names: foreach ( Control control in this .Controls) { if (control is TextBox ) { ...Show All
Smart Device Development NMD_UI sample not working
Hi all, After installing the NMD packet with all updates/rollups I've tried to build a NMD platform as described in the eHowTo from Mike Hall's weblog. Unfortunatelly there is no NMD entry in the Platform Builder wizard after the NMD install. Even after installing all the tools again (WinCE/PB) with all updates the entry is not visible. Does anyone know how to procees in order to activate this item Then I've tried to compile the NMD_UI sample by hand. After hours of searching for dependencies I've succeeded to start it. Again, bad lack: the app is not running cause is not finding some registry entries/strings etc. I need some help in order to be able to build/run this sample. Thanks, Cosmin Hi Mike, I have now successfully built ...Show All
Software Development for Windows Vista Changes to WMI on Vista that would prevent custom WMI Provider DLL from loading?
I have a WMI Provider DLL that I devloped a couple of years ago that is used to gather some extra system info and put it in the CIMV2 namespace. It has worked fine on 2000 and XP, but when I try and use it on Vista it doesn't appear to even be loading. MOFCOMP on my MOF file runs OK, as well as regsvr32 with the DLL. I can see the class in the WMI Browser, but no istances of my WMI object. The DLL is based on the C++ framework code generated by the "Microsoft WMI Code Generation Engine" from the WMI SDK released a few years ago. I have tried turning off UAC in Vista but that doesn't seem to make any difference. I haven't been able to find any specific info about why the WMI Provider DLL woudn't work on Vista. Are there any specif ...Show All
Visual C# Turn phone on or off
Dear All, I am working on C# using the ComPort control in C# to collect data from PBX system and it works fine. But I want now to turn on and off phone extension from my application via PBX. For instance, I can click on Turn On extension 1001 then users can call out but if I click on Turn Off extension 1001 then the phone is locked. Could anyone advise if there's any way of achieving this or any component that I can use to deal with this Regards, LG Hi Peter, Thanks for your reply. Could you please let me know if you have any command line or sample command lines to send to PBX. Regards, Leng ...Show All
Visual Studio Express Editions Label Text
I wonder if it is all possible to retrieve the header text from a file (string[0]) and use that in a label.text or other method If I understand you right, you want to Read the first line from a text file and then use it for a label. Some code: using System.IO; StreamReader sr = new StreamReader("TestFile.txt"); label.text = sr.ReadLine(); You might want to read this http://msdn2.microsoft.com/en-us/library/db5x7c0d.aspx ...Show All
