Compact's Q&A profile
Windows Forms "Thought for too long"?
My creatures are being destroyed and the output says because my creature "thought for too long". Does anyone know what it means that my creature "thought for too long" Thanks Justin for taking time to explain. I'll look into "level of detail". D- ...Show All
Microsoft ISV Community Center Forums Excel ShapesText
Hi, How can I get ( and change ) the text of a grouped shape in excel Thank's for replies Hi Denis, Here's some info from our support engineer: As I know, we can not directly get the Text property from a set of grouped Shapes. The workaround is to ungroup them temporarily in code, and re-group after getting the value of Text property. Here’s the sample code: ========================== Sub x() 'get text from a grouped shape Dim sr As ShapeRange For Each myShape In Worksheets("Sheet1").Shapes If InStr(mySha ...Show All
Visual C# To choose between C# and VB
I wish to start learning either C# or VB Express Editions. The aim is to write applications to communicate with 'homebrew' hardware on the serial port,or better still, USB. The communication requirements are modest - several different trigger signals to the hardware, read pushbuttons on the hardware, or collect slow speed data. I would appreciate advice on the trade-off between the learning curves for C# and VB versus their communication capability. My programming background is intermediate level on embedded controllers using a form of Basic. Thanks in anticipation. My answer to this question was alw ...Show All
Visual FoxPro Using VTable interface of Excel Component from FoxPro 8.0
I am writing a FoxPro program that uses the Microsoft Excel component in order to generate a XLS file. However, FoxPro is evidently using the IDispatch form of the Excel interfaces instead of the VTable interface. How do I write the program so that FoxPro will use the VTable interface instead Sorry it took so long to acknowledge your reply. The component is working fine using CREATEOBJECTEX(). We were importing and programatically formatting in excess of 70,000 rows of data in Excel and were having performance problems. Our IT dept suggested using VTABLE instead of IDispatch. Thank you for your expertise. ...Show All
SQL Server rounding datetime nnn to whole seconds
First of all my apologies if this has been covered elsewhere, I have been unable to find it despite a good few hours searching, okay here we go: I have an mssql database with a table storing a datetime as > 2005-10-06 16:04:04.933 I have data in an access table that stores the same time as> 2005-10-06 16:04:05 i.e. it has rounded up the time. (under .500 gets rounded down) I need to perform the same rounding on the mssql table (using an update) I can't use cast as smalldatetime is too small, timestamp isn't right either. I've tried convert: but this doesn't achieve rounding correctly (it only rounds ...Show All
Visual Studio How to Sort a Group Dynamically
Hi All, I want to sort the Group option dynamically depends up on the parameter value Eg : I am grouped a report by Customer Id. And at run time depends on the Parameter value i need to sort the Customer Id Ascending or Descending. Thanks in Advance Right click the group header and choose "Change Group". Check the box “use formula as group sort order”. Click the little pencil x+2 icon to open the formula workshop. Your formula should be something like this: If { ParameterField} = "condition" then crDescendingOrder else crAscendingOrder Hope this helps! ...Show All
Visual Basic Letters and signs
Below is part of the code that I use to produce random letters of the alphabet (Thanks to the Forum) For lett = 0 To 8 ascii = CInt( ((90 - 65) * Rnd() + 65)) arrLet(lett) = Chr(ascii) Next Select Case CboOne.SelectedIndex Case 0 LblOne.Text = arrLet(0).ToString() I decided to play with the code so that it would produce random signs instead of letters. so I changed the code to the following For lett = 0 To 8 ascii = CInt( ((43 - 33) * Rnd() + 33)) arrLet(lett) = Chr(ascii) Next Select Case CboOne.SelectedIndex Case 0 LblOne.Text = arrLet(0).ToString() This works but it ke ...Show All
.NET Development How is performance affected by calling a 1.1 assembly from 2.0 service?
When / how frequently does the 1.1 runtime have to load Surely not with each call to the service Hi Brad, I'm going to move this post to the Common Language Runtime web forum where I think they will be able to better answer your question. Daniel Roth ...Show All
SQL Server Report Builder - is this a bug or is it by design?
After playing with report builder for some time I have stumbled upon a most annoying restriction in Report Builder: it does not allow including data from entities which are related to each other via a third entity in the following way: [table_A] many-to-one [table_B] one-to-many [table_C]. So if I want to show fields from both [table_A] and [table_C] Report Builder does not allow me to do so (unless I use an aggregate function on the fields in [table_C]). Here is an example of the actual schema: [Claims] many-to-one [Firm] many-to-one [Policy] or in other words a firm can have many policies associated with it as well as many claims. S ...Show All
SQL Server Storing Null values
I am creating a UDT which is not a Native but UserDefined Format. I use the IBinarySerialize and should implement Read en Write methods. When i have a null value should i always write some null flag to the database storage Or is there another way to deal with null values like writing nothing Hope somebody can give me some more details about this. I don't really understand how reading/writing is working. Because when i store a UDT with a null value in the database i cannot do a normal select on it. I get an error like: Error message is: Data is Null. This method or property cannot be called on Null values. When i use the .ToString() after t ...Show All
Visual Basic Use string value as variable name
How do I use a value of a string as a public variable name/object that I can then change.... dim var1 as integer dim var2 as integer dim var3 as integer...ect... Dim vroot as string = "var" Dim i as integer = 1 Do var + i.tostring 'this returns "var1" 'now how do i use this var1 returned value to act like a variable i=i+1 loop until i = 15 Also how would i do this with objects....say i had a series of labels named label1, labe2, label3...ect... to call these through a "label + i.tostring + .text" script also...... Catch my drift....is this possible Thanks! For the issue with variable names, here is ...Show All
Windows Forms use a variable to cycle through textboxes
I have about 15 textboxes, all of which I want to save in a string array. Right now I just code: array[0] = txtbx1.text array[1] = txtbx2.text.... and so on. Is there a way that I can use a for loop and use x instead of 1 and 2. so it would look like this: For( x=0;x<=15;x++) { array[x]=txtbx + x.text; } instead of writing it 15 times Thanks. Yes, you can recursively call down through each panel testing each control to see if it is a panel and then dropping into that Panel's controls array. Thereby processing all of the controls on the form. ...Show All
Visual Studio 2008 (Pre-release) support for hierarchical tables?
Hello! Is there an example of a table supporting "hierarchical" rows somewhere. I think of a situation where there's a ROWGUID column as primary key and a ParentROWGUID being a foreign reference to the same table Do you know if it's correct that there are problems with such structures at the current level of development of LINQ Best regards, Henrik Dahl Batched CRUD would work (I suspect this isn't what you meant by "set-based..."). I recall this being one of the roll-your-own hacks in the 1.x days, and I haven't checked it out in 2.0. Still haven't had the time to try it out, but if you know the ser ...Show All
Visual C# Subclassing controls
I want to modify the bahavior of a standard control by changing some of the methods. I know I can do this by subclassing the control. However, it seems like I need to create a new control as a seperate project and reference the created dll in my main project. This seems like a lot of work for a simple task; what I'd really like to do is have everything in the same project (although not the same file). What I'm used to in Visual C++ is to use the base control as usual (eg. drag an edit control onto a dialog), and then use DDX_Control in my DoDataExchange to subclass the control. Is there a similar way in C# ...Show All
Visual C++ Dynamically allocated ostringstreams? Getting C strings from ostringstream instance
I'm getting different results comparing a dynamically allocated ostringtream and a local instance. Here is the code that gives the "funny result" (dynamically allocate ostringstream) #include "stdafx.h" #include <sstream> #include <string> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { std::ostringstream *sbuf = new ostringstream(); if (sbuf != NULL) { sbuf->operator<<("This is a string"); string s = sbuf->str(); const char* str1 = s.c_str(); const char* str2 = s.data(); printf ("Echo the string: (%s)\n", s.c_str()); } if (sbuf) { delete sb ...Show All
