duancg's Q&A profile
Visual Studio 2008 (Pre-release) Sorting a ListBox of strings
Hey, This really should be incredibly easy to do but all I can find is huge explanations of how to use CollectionViews, Observable whatnots, SortDescriptions etc. In code, I want to be able to add ["Cat", "Dog", "Ant", "Bat"] to a ListBox, then be able to sort them... I've looked at SortDescriptions but have no idea what the first argument needs to be. Exceptions are thrown when i try things like "Content", "Name", "Text"... what properties to simple strings have I really do want to avoid XAML for this bit as it isn't ideal, code, a couple of lines... Thanks, Adam Miles Hi ,Try like this. void Click( object sende ...Show All
Software Development for Windows Vista Burning A DVD In Vista
hello to all,....first, forget me if the post is not in the right place. Well, i have a problem in windows vista,....i have a dvd burner (pioneer dvd dvr 110D model) but the windows vista, i dont know why, do not rrecognizes the right speed to burn on my dvd (16x max velocity) some times, is 1x, other times is 4x :S...is in vista only because a week ago, in xp work’s just fine, and i do not have problem with nothing except in xp i have problem with the security, thats is the reason for what i move my sistems files to vista and the second problem is i dont know what program i must use to burn dvd/cd/iso, etc in vista, in xp i always use nero last version, but because the vista directx 10, i cant install nero 7.X because the program forced m ...Show All
.NET Development Impersonate Current Windows Users
I'm currently calling a Web Service method that uses the same login Credentials as current windows users. The Web Service using a resource on a network. I have enable impersonate and set authentication mode to Windows. < authentication mode = " Windows " /> < identity impersonate = " true " /> My front end is a web app that call a web service that returns a simply dataset. I've currently enabled Anonymous access with my login details on the remote PC. On my local PC I have Integrated Windows authentication enabled only. I can access the resouce on the local PC, but not remotely. Cause the credentials are not being forwarded to the webservice I’ve tried using DefaultCredentials and ...Show All
Visual Studio Sandcastle November CTP - Issues with some xml tags.
Hello All, I have just been testing the November Sandcastle CTP and I have noticed a few small issues regarding some of the xml tags. I have created a simple class which I have included which demonstrates these issues. When I compile this code and build a v2.0 .HXS help file using either the Prototype or VS2005 presentation type, these are the following issues I have noticed in the example ExampleMethod() method and are reproducible using the code example I an included: - 1) The caption of my <seealso> tag does not appear. - 2) In the <example> tag, the <see cref="Object"/> works, but the <see cref="ExampleMethod"/> does not. - 3) When using the <c> tag, the text within it ap ...Show All
Visual Studio Express Editions error C2653: 'std' : is not a class or namespace name Resolved. needs to be more public
took me little under an hour to figure this out, goggling did not work then i just goofed around and got it to work. The error is error C2653: 'std' : is not a class or namespace name and error C2065: 'cout' : undeclared identifier The Fix: When using VC++ express (in my case) and a basic starting template (win32 console), it creates a cupple default files stdafx.h and stdafx.cpp. Keep the header in mind. #include <iostream> #include <stdafx.h> void main() { int x = 3; if (x > 2) { std::cout << "Hello" << std::endl; } //else //{ // cout<< "statement is False" << endl; //} } the above code would refuse to work, kept giving me the errors list ...Show All
Visual C++ CDHtmlDialog
How do i disable Drag & Drop feature in my CDHtmlDialog derived dialog Regards Manoj Jangid ...Show All
Windows Forms FAQ for Winforms designer section
shouldn't there be an FAQ for this section i have participated in this section when it was under windowsforms.net and i noticed that the same questions has been asked (like how to notify the designer host for a particular component property change, etc.) i know that online resources for designer related articles are scarce and it will really be helpful for starters to know where these links are. joeycalisay wrote: The usual sir, filtering out unwanted inherited properties for components using designers, change notification of properties at designtime, design-time integration basics, etc. maybe even post the useful articles online about designers... Sounds like a good place to start. I'll see if I can whip something together ...Show All
Smart Device Development Win32 functions User32.dll
I am trying to use the Calculator in my win forms and i so i am trying to capture the Edit class from the Calculator ( The edit class is the textbox on the Calculator). I am not able to figure this out.. I need some direction... here is what i have so far... ---------------------------------------------- [DllImport("User32.dll")] public static extern Int32 EnumChildWindows(IntPtr hWndParent, Delegate lpEnumFunc, int lParam); ----------------------------------------------- public partial class Form1 : Form { delegate int CallBack(IntPtr hwnd, int iPram); public Form1() { InitializeComponent(); } private Process _Process = null; private void button1_Click(object sender, EventArgs e) { this._Process = Process.Start("calc") ...Show All
Visual Basic Login Class Problems!!!
I decided to make a simple to use stand alone dll that would expose one function - AllowAccess(Title, NoAttemps, etc) as boolean. This would be called at the main programs Load event, if it returned False the program would close, if true it would keep going. Basically the dll has a class full of controls that i have yet to add, and a form class (frmLoginGUI). This is already dimentioned, but not initialised when the function is called. I want the function to run a form, allow the user to exit, or have a set number of goes at the password. i also want the form to be a dialog form! Basically, i can't show the form and ask for x dialog results as the result is repeated and it just closes, but i don't want to call the show dialog method ...Show All
Visual C++ Errors with an ordinals function ... :(
I'm using an ordinals function for my current program, I found the code written in javascript so I decided to translate it into C++, but I have a whole lot of errors that are coming up now... System::String^ getOrdinal(int number) { System::String^ ord = 'th'; if((number % 10) = 1 && (number % 100) != 11) { ord = 'st'; } if((number % 10) = 2 && (number % 100) != 12) { ord = 'nd'; } if((number % 10) = 3 && (number % 100) != 13) { ord = 'rd'; } return ord; } The errors are: Everytime I have used the varaible 'ord' including the initialization I get an error saying that the computer can't convert string to int type. I think this is being caused by the int default return type rule. Bu ...Show All
SQL Server Switch / choose / IIf in expression
Can someone give some examples for Switch and choose Statements to use in Expression like IIf. thanks. also i need to know how to check for the null value. IsNothing and IS System.DBNull.Value doesn't seem to work. =IIf( Fields!mmActDate.Value IS System.DBNull.Value, MonthName( Fields!mmPlanDate.Value ),MonthName( Fields!mmActDate.Value )) I get a warning message for this, The value expression for the textbox ‘mmActDate’ contains an error: Argument 'Month' is not a valid value. thanks. The following worked for me ... = IIF(Fields!Desk.Value is NOTHING, 0, Fields!Desk.Value) The 0 (zero) is the true value, followed by the false value. ...Show All
SQL Server Transaction Log Help
Hi all, I am a beginner to T-SQL and have now come up against a problem... I was getting an error message saying that my queries couldn't be carried out as the tranction log file had reached its file limit. Following this i found out that the file was now 44GB in size and had completed filled my hard-disk. So i was wondering how do you go about resolving this problem. I have looking in various manuels and BOL etc and everything i see seems to tell me that if i back up the log file it will truncate and hense be sorted. The problem is though i can't back it up as i don't have anywhere to store another 44GB file. I've also read that you cannot simply delete it so, is there anyway to "empty" it Please help. Thanks in adv ...Show All
Windows Forms Trying to access another process from my Win Form
Hi, I am trying to access another process from my application. The problem is I am not able to activate this process and give tab sequences in it. This is the code I have written. What to do after this Please give suggestions. private void Form1_Load( object sender, System. EventArgs e) { Process myProc = Process .Start( "IExplore.exe" , "http://kshop/kshop/default.asp" ); int id = myProc.Id; Process .LeaveDebugMode(); Process p = Process .GetProcessById(id); // After this, how do I activate this process //SendKeys.SendWait("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}"); //this command is not working } I saw the similar solution in a different forums bu ...Show All
Visual C++ Regarding the exe registration in XP machine builded in VS 2005
HI, I have ported the visual studio 6.0 code to VS 2005. The project gets builded sucessfully. The application runs sucessfully in my system. I have put the builded dlls and exe in windows 2000 pc and windows xp machine. I am able to register the exe in 2000 pc without any problem except it requires mfc80.dll. Whereas i am not able to register the exe in XP machine it throws the error "The system cannot execute this program". I have used the command "test.exe -RegServer". Pls let me know if anyone know the solution. Thanks, Ganesh Hello Sounds like something is missing from one machine that is need to install it. Have you checked that you have all your ...Show All
Smart Device Development textbox.Focus() after end of character
I am developing a smart device application. Just added a button called "Loose". This button will display "Loose" character on the textbox, however the cursor is not on the textbox. So I added .Focus() function. But the cursor appear at the start of the textbox (before "Loose") instead at the end of the character "Loose". Is there anyway that I can make the cursor to blink at the end of "Loose" character From the documentation: You can programmatically move the caret within the text box by setting the SelectionStart to the position within the text box where you want the caret to move to and set the SelectionLength property to a value of zero (0). The text box must have focus i ...Show All
