Gurpreet Singh Sawhney's Q&A profile
Visual Studio 2008 (Pre-release) Disabling binding based on visibility
I have an ItemsControl with a binding on ItemsSource and I was wondering what is the easiest way to enable/disable that binding based on visibility property of that control. I don't want the control to be updated when it is invisible. Well, IMHO, attached property is the best approach to your scenario. Sheva ...Show All
Windows Forms hoiw to make a ReadOnly combobox?
is there any way to do one of the following: Set the ReadOnly property for the combobox just like textbox Set the combox box Enabled to false but change the Font color to Black. var DefStyle: dWord; begin DefStyle := GetWindowLong(Combobox1.Handle, GWL_STYLE); SetWindowLong(Combobox1.Handle, GWL_STYLE, DefStyle or ES_READONLY); end; ...Show All
.NET Development Executing DOS command from vb.net webservices
Hi, I've created a web service to execute a simple DOS command. here is my web service code Dim strbatFilePath As String strbatFilePath = "e:\gems\Dev\Supplier\cmdr.bat" Dim fs2 As FileStream fs2 = New FileStream(strbatFilePath, FileMode.Append) Dim sw2 As New StreamWriter(fs2) sw2.WriteLine("copy e:\gems\Dev\Supplier\dir.log e:\gems\Dev\Supplier\reuters") sw2.Close() Dim objProcess As Process objProcess = New Process objProcess.StartInfo.FileName = strbatFilePath objProcess.StartInfo.CreateNoWindow = True objProcess.StartInfo.UseShellExecute = False objProcess.StartInfo.RedirectStandardOutput = True objProcess.Start() objProcess.WaitForExit() objProcess.Close() when ever I invoke this web service from my cl ...Show All
Visual Studio Express Editions emailer form
Im tring to make a form that a user can fill out and send all the data in the form to my email... so far i have 2 text boxes, 1 Text field and a button What would be a code for this Thanks i dont have a mail server i was hoping i could just make it send the information directly over the web and to my email... Is there anything else i can do ...Show All
Software Development for Windows Vista Workflow Extensions RC5 not working?
I have installed RC1 of the .NET 3.0 framework ok on my Windows XP x64 workstation, but the Workflow Extensions RC5 for Visual Studio 2005 don't seem to work. They install the SDK but no Workflow options appear in VS2005 The previous CTP (July) worked ok Hi there, I have recently failed into the same issue. So after I have installed the SDK, I went to <windows folder>\Microsoft.NET\Framework\v3.0\Windows Workflow Foundation\ and started the WF_3.0_x86.msi and it added the Extenstions to Visual Studio. Hope this helps! ...Show All
Visual C# how turn on OPENMP in VS2005?
Hi. please tell me where in VS2005 compile options i want turn on _openmp but i cant find where :( sory for stupid question The fact that there is no OpenMP support in C# does not imply that it does not have multihreading. You can create thread yourself by using the Thread class from the System.Threading namespace: http://msdn2.microsoft.com/en-US/library/system.threading.aspx A very simple example: using System; using System.Threading; class Program { static void Main(string[] args) { Thread thread = new Thread(new ThreadStart(MyThread)); thread.Start(); } static void MyThread() { // do something on the newly created thread } ...Show All
Visual C++ adding MFC controls to main window after start-up
Hello there, I am currently writing an MFC application, and want to add some controls. Most of the examples and tutorials show how to add controls to a dialog box, but I need to add them to the main window. The problem is, these controls will not be shown straight away, they are dependant on what file the user opens. Therefore, these buttons should (probably) be created in the appDoc class, in the ::OnFileOpen() function. In the create() function for buttons, one parameter is the parent window, and the appDoc does not have access to this - as far as I can tell. My question is, does anyone know the best way to either address or work around this problem I have been trying a couple of different ways and searched the forums, but have ...Show All
Visual Studio Team System Standard team project reports have empty parameter combos
Hi, I created a new team project last week, but noticed that when I went to (for example) the "Remaining Work" report, the Iteration combo was blank, and when dropped down didn't contain any entries. I tried forcing a process of the data warehouse, but that didn't help. Also, parameter in other reports displayed the same issue (eg, Work Item Type, Area, etc) Today I tried deleting the project and creating it again, but it's made no difference. All the other projects that already existed on the server behave without a problem. It may be relevant that this is almost certainly the first project created since we moved from the RC to the release version. This project is going live tomorrow, so I could really do wit ...Show All
Software Development for Windows Vista Upgrade from XP to Vista deletes registry key and breaks service application
Hi, We have a service working perfectly fine under XP. It also works perfectly fine with a fresh install on Vista. BUT, If the service is installed on XP and then XP is upgraded to Vista, the service stops working. We found out that during the Vista upgrade it deletes the registry key which is the GUID of our service: HKCR/AppID/{ OUR-GUID } if we set the GUID back then the service works again. Any reason why the upgrade process would delete this Key And what do we need to do so the Service keeps working Thanks. OK, I actually don't need this key to have the service working. Some automatically generated code by VS6 was returning if the key is not there. i just deleted this code an ...Show All
Visual C++ C2664
Hello, I have declared two structure in my code: ref class DirectInput { public : LPDIRECTINPUT8 g_pDI11; LPDIRECTINPUTDEVICE8 g_pJoystick11; .... } when i want to pass these structure to a function it generate c2664 : hr = g_pDI11->CreateDevice( pdidInstance->guidInstance, &g_pJoystick11, NULL); and the error: error C2664: 'IDirectInput8W::CreateDevice' : cannot convert parameter 2 from 'cli::interior_ptr<Type>' to 'LPDIRECTINPUTDEVICE8W *' 1> with 1> [ 1> Type=LPDIRECTINPUTDEVICE8 1> ] 1> Cannot convert a managed type to an unmanaged type Thanks, Hanif Try this: pin_ptr<LPDIRECTINPUTDEVICE8> p = & ...Show All
Visual C++ GDI+ crash (with SetDashPattern and DrawLine)
Why does the following code not work for certain lines It always crashes deep inside GDI+ (5.1.3102.2180). Regards, /Johan. #include <windows.h> #include <gdiplus.h> using namespace Gdiplus; #pragma comment( lib, "gdiplus" ) int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { ULONG_PTR gdiplusToken; GdiplusStartupInput gdiplusStartupInput; GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); { BITMAPINFO inf; memset(&inf.bmiHeader, 0, sizeof(BITMAPINFOHEADER)); inf.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); inf.bmiHeader.biBitCount = 32; inf.bmiHeader.biWidth = 1000; inf.bmiHeader.biHeight = -1000; inf.bmiHeader.biPlanes = 1; inf.bmiHeader.biCompression = BI_RGB; inf.bmiHeade ...Show All
Windows Forms Numeric Only Cell/Column in DataGridView
I need a numeric only cell/column for the DataGridView. I'm guessing that I'd need to create a custom column inheriting the DataGridViewTextBoxCell. Are there any examples of this or has someone already created it Thanks, Kyle The is a sample numeric updown control column here . ...Show All
Visual C# Build up a variable name with a string
Hi, I wonder if there's a way (in c#) to build up a variable name by the concatenation of two strings...For example int intTest = 1; string strTest = "strTest"; string strTest+intTest.toString() = "this is my new var"; Thanks in advance James Curran wrote: Modern programming languages have a thing called an Array. Perhaps you should look into it...... What does Array have to do with the subject ...Show All
Windows Search Technologies Sent Items search does not show Recipient
Hello, Searches of e-mails only show the "From" field. Is there a way to display Recipient in the list of Sent Items found Thanks Lex Lex, It sounds like you are using WDS 2.6.x. Unfortunately, there isn't a way to display the to field in the search results. If you upgrade to Office 2007 using WDS 3.0 you can perform this type of search from within Outlook. In this case you can see the To field. Paul Nystrom - MSFT ...Show All
Visual C# Exceptions and objects
Hi, How do I do to obtain the values of the objects when occur an exception public void CreatePerson(Person person) { try { ... } catch(Exception ex) { // Here obtain the information the values of object person but the generic form, therefore I don’t knwon the object } } This is to obtain the information of local objects, paramer objects and global to log when occur an exception. Thank you!!! Never say never :) ...firstly, never catch a generic exception - expensive. Catch the specific exception and handle it appropriately... What Exceptions filters is one the slowest things in .NET, as before raising it not only has ...Show All
