Yahya's Q&A profile
Visual C# How to handle control + click event?
Hey all, I'm trying to add some functionality to my app where a user presses the key combination CONTROL + Left click. I am handling the KeyDown event of the control and the handler code is as follows: if (e.Control && e.KeyCode == Keys.LButton) Console.WriteLine("CONTROL + Click clicked"); If I change the Keys.LButton to say, Keys.A, the handler works fine. Am i missing something here, that is not letting me handle the Control + click event. Thanks for any help! Yes Mark is Right you can not use the keypress event to capture mouse clicks you have to use either Mouse clcik, Mouse Down or Mouse Up events here is a Sample code private vo ...Show All
Visual Studio Team System [Urgent Help needed] VSTS unable to log into ADFS!
Hi All, First of all, here is what the performance rig is like 1) Two webservers in clustered environment on a subnet. 2) One ADFS server in the same subnet as the webservers for authentication. 3) One DB server on the same subnet. When user navigates to the http://webserver/ they are redirected to the http://ADFS/ machine which would display the user a page where he/she would choose their federation server, once they choose their federation server this page would place a cookie and would not be displayed next time user is redirected for authentication. After choosing the fedration server user is presented with a login page which is hosted on the ADFS box, user would put their CORRECT user name and password ...Show All
Visual C++ Memory leaks created by the compiler/ run-time system
I have spent nearly two weeks trying to find some memory leaks in a program I am developing. Initially I thought it had something to do with PlaySound (see previous post, 30 Jan 2007) but that was not so. I have now discovered some hidden memory leaks in C++ which I am happy to share with others. (Please note I am using Version 6.0. It’s possible these problems have been fixed in later versions.) The following code: CSize test = pDC->GetTextExtent(“ABCDEFG”); creates a memory leak. I thought that all memory allocated within a function (when not using ‘new’) would be deallocated at the exit, but this is not so. My best guess is this. GetTextExtent has two forms and the form used above needs a CString par ...Show All
Smart Device Development Serial Port problems
Hi. Running Imate SP5m with .NET CF 2.0 SP1 I have contacted Imate (on the side: poor support) who confirm that Raw/Serial IR access is possible and is on COM3. In the registry it says COM4. Anyway... If I use the serial Port class to open COM4 and write to it, I have the issue where when we do a serialport.write("hi");, the application does nothing. it just hangs, no exceptions are thrown. It does not even get to serialPort.Close(); If I use the serial Port class to open COM3 and then write to it, I get an exception @ serialPort.Write("hi");: at System.IO.Ports.SerialStream.WinIOError() at System.IO.Ports.SerialStream.Write() at System.IO.Ports.SerialPort.Write() at SerialIrTests.Form1.mnuStart_Click() at System.Windows.F ...Show All
Architecture .Net Remoting load balancer needed
Hi I am looking for the best way to design or purchase a loadbalancer component using .Net remoting. I have an architecture where several servers using .net remoting are used to sevice client apps. The loadbalancer should conduct the call of any client app to the least loaded server. What I have done so far is implementing a small loadbalancer component that keeps track of the available servers and their load. When a new client app wants to login and use the services offered by the servers, it should ask (transparently) the loadbalancer for the least loaded server. The loadbalancer will then return an ObjRef object which the client app will use to authenticate itself to the least loaded server and start using its services. If an ...Show All
SQL Server Import Legacy DTS Packages into SQL Server 2005 using SMO
I was hoping someone can point me to a resource for SMO and importing legacy DTS packages from SQL Server 2000. We are getting ready to upgrade our SQL Servers from 2000 to 2005. We have a lot of DTS packages that we plan on continuing to use in 2005. I found a script I used to export all of the old DTS packages out of our 2000 servers; DECLARE @TARGETDIR varchar ( 1000 ) SET @TARGETDIR = 'C:\DTSTest\' SELECT distinct 'DTSRUN.EXE /S ' + CONVERT ( varchar ( 200 ), SERVERPROPERTY ( 'servername' )) + ' /E ' + ' /N ' + '"' + name + '"' + ' /F ' + '"' + @TARGE ...Show All
Internet Explorer Development ie-layout
hi, does anybody know of it’s possible to change the entire ie-layout by jscript and css with entire ie-layout i mean stuff like the menu-bar, toolbar, url-bar, status-bar. i’m wondering if it was possible to change all of that in an other color or to give it a background. and if all of this is possible, is it also possible to give the window an other figure, instead of a rectangle into a triangle, polygon, etc. thx for helping me out with this. ciao, s2tgrave. ...Show All
Visual Studio Debugger opens wrong files
I am running a relatively large unmanaged VC++ solution (~110 projects) in Visual Studio 2005 which builds a handful of dependant libraries, unit tests, and a couple sample executables. As one might imagine, this solution contains a number of files in different projects which share the same name ("test.cpp", for instance). When stepping though code, the debugger has the tendancy to bring up the wrong file. I can set a break point in a given file which is respected by the debugger, but it then proceeds to follow the execution path, correctly following line numbers but in the wrong source file. This behavior suggests to me that maybe the system is using some kind of hash based on file name which has some-how fallen out of sync with the files ...Show All
Visual C# Generics Problem in Operators
Hi , I am trying to design a Generic Method which can add any type of data. while i am compiling it is giving following error: 2 Operator '+' cannot be applied to operands of type 'T' and 'T' Following is the code: Please help using System; using System.Collections.Generic; using System.Text; namespace GenericsConsoleApplication { class Program { static void Main( string [] args) { } } class GenericClass1 <T> { public T result; public T Add<T>(T vara, T varb) { return result = vara + varb; } } } The problem you are having is because the compiler needs to know at compile time that any type you create the generic class w ...Show All
Visual Studio Team System Bugs and related work item resolution...
Hi, Sorry if this question has been raised before but I am little confused as to the intended process for using Bugs and Task work items. It seems that tasks have several specific fields such as Remaining Work, Start Date, etc that leads me to believe they are the natural choice for ongoing development task tracking. The impression I get is that Bugs (Work items that do not have these aforementioned fields) would be reviewed and one or more tasks subsequently created for them and assigned to a developer. If this is the case, what is the most efficient way to associate items such as changesets and builds to these tasks and the parent Bug work item. For example, lets say I have a scenario where I have a bug and create a related work it ...Show All
Software Development for Windows Vista ExceptionHandling with Retry
Hello, what is the best practice for the following scenario Building a custom activity derived from Sequence Activity. If one of the child activities throws an exception this exception should be catched and logged (optional). Then the complete sequence of activites should be restarted (meaning we perform a retry on the complete sequence). If MaxNumberOfRetries (a property on the custom activity) is reached the exception will be thrown to the parent activity/workflow. I tried many scenarios including overriding the HandleFault method, invoking inner contexts building custom FaultHandlers but none of them seems to work properly... Thank You! Dirk Hello, ha s anybody created a custom activ ...Show All
.NET Development Reading Binary Format (QBasic) with C#
I have a binary file with data stored in an old format [Microsoft Binary Format (QBasic)] The file is configured like this ----------------------------------------------------- Start Byte | End Byte | Lenght | Description | ----------------------------------------------------- 0 | 3 | 4 | date format YYMMDD | ----------------------------------------------------- 4 | 7 | 4 | Float | ----------------------------------------------------- 8 | 11 | 4 | Float | ----------------------------------------------------- \ \ \ ----------------------------------------------------- 24 | 27 | 4 | Float | ----------------------------------------------------- The first 4 bytes contain the date ...Show All
SQL Server user running trigger
Is it possible fire an insert trigger in the context of a different user than the user that does the insert. We are using SQL2000. I did not see this syntax in the help. User insert table in one database T1 and trigger insert the record into another database T2. In this scenario could you please be more clear if I could use any user in T2 to be able to do this insertion. Users in T1 should not be able to insert anything into T2. ...Show All
Windows Forms Getting current row values from my BindingSource in C# VS 2005!!!
Hello, How can i get a current row values from my BindingSource. I have a DropDown List that points to a view, and I set a column of my view to be displayed in my DropDown list and another column as it's value. I need to display another column of my view in a ReadOnly TextBox right near my DropDown list. Thanks so much in advance, Mathew Thanks Bonnie, It's not a Master/Detail. Sorry, I explained it in wrong words. I use filter for my Master/Details by the way. Actually it's one table but I have some Foreign Keys to other tables. For example, in EmployeeAddress table I have their addresses and a Foreign key to City table. Now, in my Combo Box I show the city name, but I save the PrimaryKey ...Show All
Visual Studio Express Editions Web Browser validate URL
ok...i have another question about a simple C# browser... I found out that if i type something like www.google.com into the browser, it has an error, but if i have the "http://" it will work. So my question is, how do i detect if the person has typed "http://" or not, and then have the appropiate responses to those situations...i dont think that was clear :)...let me rephrase, suppose the person types http://www.google.com , i want that to go directly to the browser, but if the person types www.google.com , i want the browser to add "http://" Thanks, paoloTheCool :) im not trying to sense if the user has typed anything in the URL box or not, im trying to sense if the user typed ww ...Show All
