Michael Ressler's Q&A profile
Visual Basic Problem With WriteLine and Integer Variables
I am trying to write a program that writes some information to a text file. The problem is that some of these are integers, and it dies with an unhandled exception whenever I try to make it run. The problem code block is: line.WriteLine(Count + " " + RockScore + " " + PaperScore + " " + ScissorScore) All variables are Integer Type. The gist of the error is that it can't convert the spaces to Double ... but I am not asking it to (the full error message is below). Any ideas on how to fix the code The error that I get is: Exception System.InvalidCastException was thrown in debuggee: Conversion from string " " to type 'Double' is not valid. ToDouble() ToDouble() RpsGenerator() ...Show All
SQL Server sys.Conversation_Endpoints
I know that if a conversation is normally ended the handle will wind up in the sys.Conversation_endpoints table in a Closed State. I realize they are supposed to stay there for 30 minutes to prevent a reply attack, however the number of rows I have in this table continues to grow with the bulk of the states set to 'Closed'. I am trying to use this table to determine if I have any conversation handle leaks. I see some rows in there with a Disconnected Outbound state while some are conversing. What should I be looking for in this table and how can I know I have a problem (ie. leak). I realize that Disconnected Outbound is probably something i need to look into. Are there any other states I should be concerned with Gary ...Show All
Microsoft ISV Community Center Forums Office 97 / Windows 2000 Compatability
Im having trouble referencing Office 97 objects in Windows 2000. I'm in Word 97 and trying to set my object appWord to equal a new word application. My code is: Dim appWord As Word.Application Dim docCP As Word.Document Set appWord = New Word.Application Set docCP = appWord.Documents.Open(OutputDirectory & FileName, False, False, False) However on running I get a prompt telling me the document can not be found. This code errors on the line Set appWord = New Word.Application not where the application sets the filepath and name. I get a similar problem when using he same method for Excel only the message I get is around a missing DLL but its doesn't tell me which one. If anyone could shed any light on this id ...Show All
SQL Server Cursor issues
I can get it to create the proc, but it dosen't replace the variable or loop through the select list from ziptrendindex. Any ideas on what I'm missing declare @countyname varchar ( 200 ) declare @sql varchar ( 8000 ) declare county_name cursor for select distinct county from ZipTrendIndex open county_name fetch next from county_name into @countyname WHILE @@FETCH_STATUS = 0 BEGIN IF NOT EXISTS ( SELECT * FROM sys.objects WHERE object_id = OBJECT_ID ( N '[dbo].[county' + @countyname + ']' ) AND type in ( N 'U' )) BEGIN set @sql = 'CREATE PROCEDURE dbo.getUpdRecords AS SET NOCOUNT ON Declare @Pro ...Show All
Visual Studio VSS 2005 Crashes When Creating History Report
My VSS 2005 is crashing when I - Open VSS 2005 Explorer - Navigate to subfolder - Right Click - Select View History - Check "Recursive" - Enter a recent date - Click OK - Click Report - Both Include Details and Differences are checked - Clicking either OK or Preview for any of the choices (printer, file, clipboard) causes a "MS VSS Explorer has encoutnered a problem and needs to close". Button choices are Debug, Send Error Report, Dont' Send. If I click debug, VS opens with a green arrow at the bottom of this method. Unforntuantely I dont know C++, so I dont know any other context to provide BOOL CStatusBar::SetPaneText( int nIndex, LPCTSTR lpszNewText, BOOL bUpdate) { ASSERT_ ...Show All
Windows Forms Form paint while OnLoad processing ...?
I have a form with various controls on it. I have some code that runs on the form's OnLoad event, but while that code is running, the form doesn't fully paint itself. There's got to be something I'm missing to tell the form to go ahead an draw itself regardless of running code. Any pointers appreciated. Thanks in advance! How about assigning your processing part to an asynchronous "background worker" (.NET 2.0) ...Show All
Visual Studio Team System Data-driven Unit Test
I'm using SQL 2005, Visual Studio Team Suite with CTP7 and would like to make a Data-driven Database Unit Test which tests a stored procedure. Anyone got any sample code I've managed to link the Database Unit Test to a Data Source and Data Table, so it now runs my SQL 100 times (there are 100 rows in the Data Table), but don't know how to link the data from the table to the SQL script. Or am I getting the wrong end of the stick here, ie can you only make normal Unit Tests data-driven, so they have to be written in C# / VB.net I know a bit of C# if that's required.. Thanks wBob Did you define the connection and the data table through the Unit Test properties or did you do all of your work ...Show All
Visual Studio Tools for Office IndexOf method in vsto word doc
Hi, I need to search text in a Word document from a vsto customization. At present, I'm using a range object to find and process text however I also need to do something like what Eric Lippert does in his VSTO C# book: while ((index = text.IndexOf(textToFind, startIndex)) >= 0) but I can't access the indexof method from a range object and I don't have a reference to the text of the document as a type string. It doesn't appear that the range object has something like range.text.indexOf(). Eric uses a custom recognizer class along with a recognize method which gives him access to the text variable (which I assume is the entire document) passed in as a param. Does anyone know how I can access the full text of a Word docu ...Show All
Visual Studio ModelingPowerToys can not be loaded when VS startup.
I got an error like: external program 'Class Designer Enhancements' can not be loaded and maybe cause some exception. Error ID:8000ffff My OS and VS are Chinese edition. What can I do to make ModelingPowerToys work Thanks for your best job! But I still have a little bug to report: When I open Tools | Options dialog from main menu, the scroll bar is disappeared. ...Show All
Visual Basic Messagebox
Hi, I know messagebox, msgbox functions are able to post messages, but they need user to send a result to messagebox. Now what i want is I need a messagebox to post information when a function or procedure is running on the background, and when this function or procedure finishs, this information box will disappear. For example, when my application is doing some save tasks, a information box is posted with text "saving now....", after saving is finished, information box is disappeared. Anybody knows how to it Thank you very much! what you can do is show the form to the user, whilst everything is running on the other main form where the processing is happening, then once completed, close the message info form. This wo ...Show All
Software Development for Windows Vista DirectX.AudioVideoPlayback problem
Hi! I have a problem. I created a Microsoft.DirectX.AudioVideoPlayback.Video object and I added for it an Ending event handler. If I set its Audio.Volume property, after playing the video it does not arrive the handler procedure. If I don't set that property, everything is gone. Why _video = new Video (path); _video.Audio.Volume = -1000; _video.Ending += new EventHandler (_video_Ending); _video.Play(); Sorry for the late reply. You need to set the _video.Audio.Ending to the same eventhandler as the _video.Ending But be carefull because every call to Video.Audio leaks memory ...Show All
Visual Basic Best way to stream binary
Hi All I want to write data from my VBA application to a binary file. I want it to be ib single byte format (ie not unicode). I have played with ADODB.Stream.Write and the only way i could get to work was using Stream.Writeline then coping that the the binary stream. (Thanks to Amr Omf). The problem is that inserts a null value, ie if i write 'ABCD' i get '41 00 42 00 43 00 44 00'. I want '41 42 43 44'. Anyone know how i can do this Not the best solution but it works without a call to windows API. Sub Main Dim b() As Byte Dim bFinal() As Byte Dim n As Long Dim gByteCnt As Long b = StrConv("ABCD", vbProperCase, 1033): gByteCnt = -1For n = 0 To UBound(b) If (b(n) <> 0) Then gByteCnt ...Show All
Windows Forms "System.FormatException was unhandled"
Here's a quick question. I'm trying to save the contents of a TextBox back to a typed dataset. The problem I am encountering is that the application throws a "System.FormatException was unhandled" error when I try to do this. Here's the low down. The TextBox is setup to be bound to a BindingSource from the moment the form is realized. Keep in mind that this has been done through the designer. Anyhow, I have preassigned the number zero to automatically populate in this text box in the event that the user wishes to not enter anything. So when I decide to add a new row, the following line of code is fired. txtPeopleInFamily.Text = "00" ; Then the following happens... DataRow newRow = this .clientData ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Xbox 360 Guides in XNA
Hi there, I've been playing around with the framework and I have a little question for any MSFTies who can answer. On the Windows side of things, if we want to call up any useful built in functions of Windows like say the common dialog box colour picker (for say, a player's car paint job) or a MessageBox (you've reached the end of the demo!), we can still do so by calling in to the Windows.Forms namespace. On the Xbox 360 side though, any such UI we would have to recoded manually. However, as we all know, there are certain built in elements of UI on the 360 too in the form of the various Xbox Guide slide out panels. Currently, access to one of these does exist in XNA (The save Location guide for letting the user choose a Memor ...Show All
Visual Basic IsDBNull problem
I am probably doing this wrong If IsDBNull(EDFRow.EStart) Then Me .EStartDateTimePicker.Checked = False Else Me .EStartDateTimePicker.Checked = True End If I get the error that the filed is dbnull Can someone please explain this. Davids Learning This is the exact error The value for column 'EStart' in table 'EDF' is DBNull. <System.Diagnostics.DebuggerNonUserCodeAttribute()> _ Public Property EStart() As Date Get Try Return CType ( Me ( Me .tableEDF.EStartColumn), Date ) Catch e As System.InvalidCastException Throw New System.Data.StrongTypingException( "The value for column 'EStart' in table 'EDF' is DBNull.&q ...Show All
