suncream's Q&A profile
Visual C++ sort a 'std::vector' containing classes/structures?
Hi, I want to sort a vector contain some data using std::sort. Here are the sample codes. #include <vector> #include <string> #include <iostream> #include <algorithm> using namespace std; class MyData { public : int m_iData; string m_strSomeOtherData; }; bool MyDataSortPredicate( const MyData& lhs, const MyData& rhs) { return lhs.m_iData < rhs.m_iData; } int main () { // Create list vector myvector; // Add data to the vector MyData data; data.m_iData = 3; myvector.push_back(data); data.m_iData = 1; myvector.push_back(data); // Sort the vector using predicate and std::sort std::sort(myvector.begin(), myvector.end(), MyDataSortPredicate); // Dump the vector to check the result for (vector: ...Show All
Visual Studio 2008 (Pre-release) DataBinding vs Static classes
Working on May CTP... I'm trying to bind to a static class : public static class MyCommands { public static RoutedCommand ClearAll; static MyCommands () { InputGestureCollection ic = new InputGestureCollection(); ic.Add(new KeyGesture(Key.P,ModifierKeys.Control)); ClearAll = new RoutedUICommand("ClearAll", "clear", typeof(Window1),ic); } public static string Name { get { return "ok"; } } } And trying to use it on a Menuitem <MenuItem Name="mi1" Command="c:MyCommands.ClearAll"" Header="x:Static c:MyCommands.Name}" /> Everything works fine if i remove static operator on classe definition, any idea why I don't know what happened to you, but this followin ...Show All
.NET Development error: "the given key was not present in the dictionary"??
I'm trying to execute a stored procedure, then plug the results into an object. When I run the code I get the error above on each of the MessageBox lines below. At least, I believe that's where I'm getting the errors at. I get two duplicate errors after the first MessageBox shows correctly (number of results: 1). Any idea what I may be doing wrong here I'm not entirely sure what dictionary object the error is referring to either BTW, I am using some internal data access libraries, so it's not strict ADO.NET to execute the Stored Procedure... Thanks for any help you can provide!! Eddie Code: public dataPkg GetDataPkg(string prefix, string activityNum) { DbStoredProc cmd = null; DbRecordList results = nu ...Show All
Visual Basic in my project i need to format a multi line text box how to do
in my project i need to format 5 lines of text in a multiline text box which contain 129 lines and i need to format its font,size,color,alingment ect how can i do this can any one help me in dooing this ...Show All
Windows Forms Plotting CLR console values on Windows Form
This question has probably been answered before but I could not get exactly what I wanted. Suppose I have CLR console program generating a 2-d array of values. These values are coordinate points. I now want to display them. What is the best way to do that I did a basic layout panel with Windows Forms but I don't know (1) how to link the values being generated from the console program to the form, and (2) how to paint the coordinates on the panel. Any help pointing to sources where I could understand this process would be greatly appreciated. ...Show All
Windows Forms Dual Window App and Events.
Hello Im new to this forum so if this question does not belong here please let me know. It sure looks like a good place to start. I have 2 forms in a C# Windows App project. I have a button on form1 and one button on form2 In form one I create an instance of from2, so now I have two windows up. How do I handle the form2 button click in form1 What's the best way to do this What should I be looking in to I can set form2 as the start up form, then create form1 there. and in form2' s button_click event pass the click to form one (I made the button_click in form1 public. //Form 2 Form1 frm1 = new Form1 (); private void button2_Click( object sender, EventArgs e) { frm1.button_click(sender, e); } The ...Show All
Visual FoxPro How to selectonentry an edit box in a grid.
Hi; I have a grid with 2 columns: a txtbox and an edtbox. For some reason the edtbox won't SelectOnEntry no matter what I do. I've tried to set selectonentry for the column and the control itself. I've set the format to "K" I've set DynamicInputMask to "K" highlight is .T. Nothing works. Any ideas Answering my own question: I've put this in the gotfocus method of the edtbox: keyboard "{shift+dnarrow}" keyboard "{shift+dnarrow}" keyboard "{shift+dnarrow}" In this case I know that there won't be more than 3 lines in the memo field. But one can get more sofisticated and count the lines and put as many keyboar ...Show All
Windows Forms Deploying with a Setup package and using ClickOnce for Updates?
I have created a setup packed for a windows application in VB.NET I have written and I will install the application on a user location. How can I, if able to at all, use ClickOnce to keep this application up to date I want the application to check for updates at the start and if a new manifest/program/msi/etc is available, then I want it to download and install. Is this do-able I've been reading through this forum and other resources and haven't found anything say that it is definitly not possible but also nothing saying it was. I have been playing with it trying to see what I can figure out still but any input would be great :) or if I missed a link or article, please let me know. Thanks EDIT: After the pos ...Show All
SQL Server Can't Connect to Multiple SQL Instances over the Internet with SQL Browser Service
I recently setup mutliple instances of SQL Server Express at my office. I have 1 default instance, and two named instances. I can connect to the named instance of the default port of 1433 with Microsoft SQL Management Studio Express, however the other instances on dynamic TCP ports can not be accessed by the instance name over the internet. I have to specify the dynamic TCP port in this form: xxx.uconn.edu/SQLTEST, Port number. My current thinking is that the SQL Browser service should tell Management Studio Express what dynamic port number each SQL instance is listening to. Any ideas hi, CTJohn23 wrote: I recently setup mutliple instances of SQL Server Express at my office. I have 1 default instance, and two named instances ...Show All
SQL Server Cache size lookup transformation
Hi, I have to perform a lookup in a table based on a query like: "... where = [RefTable].fieldID and between [RefTable].AnotherFieldValue and [RefTable].AThirdFieldValue" So, SSIS has put the CacheType to none. As I really need to speed up the job I want to set the CacheType to partial (full isn't an option due to the custom query I use here). But here it comes: when using partial CacheType, one has to set the cache size manually - and I really don't know what value I should assign to it - is there a guideline on this topic I work on a Win2003 server platform with sql server 2005 - 2 processors - 2Gb Ram - enough disc space Thanks in advance, Tom Tom De Cort wrote: Hi, I have to perform a loo ...Show All
SharePoint Products and Technologies MySite masterpage
Hi All, On MOSS2007: I'm trying to change the default masterpage for mySites. I tried to edit the default.aspx in the 12/templates/sitetemplates/spspers folder, but I can't seem to let it point to another master ... as soon as I change the masterfile path, the page breaks. Any ideas on what's the best approach to link up my mySites with a custom masterpage Fred Did you publish a major version of the master after customizing it on my portal the master is ok, i just edited the defualt master and published a major version. it is not that a nice way but the only one that works for me. if microsoft delivers updates on sharepoint i have to keep attention, and maybe manually have to change the master after upgra ...Show All
Windows Forms Windows Forms Datagrid 1.1 "Parent & Child" Column headers
I'm 100% sure I posted this already, but anyways... As the title says I'm looking to create parent & child columns. Basically I have 6 columns, in which these can be grouped into 2 groups of 3. So rather than have: X1 X2 X3 Y1 Y2 Y3 I'm looking for X Y 1 2 31 2 3 ANyone seen/implemented anything like this on version 1.1 Cheers. Like this but with a windows grid rather than a web grid. http://www.eggheadcafe.com/community/aspnet/8/85456/double-header-in-datagrid.aspx Anyone ...Show All
Visual Studio 2008 (Pre-release) Can I add scrollbar on canvas control
Can I add scrollbar on canvas control... Cheers, Kahn ...Show All
Visual Studio Express Editions databinding trouble (Relational Databases)
I have a large database that I exported via ODBC to Access format. I have loaded this into VB with no problem and I can view the data using the standard tools, but I'm having trouble getting everything to talk together. Let me explain. I have one table called Doors and another one called DoorTypes. The table with Doors just has IDs (numbers), which DoorTypes has the actual name/type of doors in text format. I need to know how I can make these two tables talk together. Note: I have them linked correctly as far as PK and FK goes(since I exported them with ODBC they already had the relationships established). There are other tables that will connect with Doors as well, but I'm just using these two to try to get an understand of how to work wi ...Show All
Windows Forms Can you force a brush to paint over existing controls
Hello all, I have defined a rectange and am using a brush to fill it. The problem is that is appears "under" any controls already existing on the form. Is it possible to make it paint "over" the controls instead Thanks in advance for any ideas and/or suggestions. ...Show All
