hatem elshenawy's Q&A profile
Visual C++ How to change owner of a process or thread?
Hi, I have a Windows Service that run with SYSTEM user. When i create a new process in this process (using ShellExecute function) the new process got SYSTEM privilege too. I want it'll run as current user privilege. How can i done Any help Hieu I'm searching for a way to use same as CreateProcessAsUser function but for ShellExecute function. Because i want to be able to open a document instead of create a process. Hieu ...Show All
Windows Forms Doubleclick interrupted by MessageBox
Hi, in my app I use a TreeView control. Single click means selection of an item and filling some information about it to some different window. Doubleclick does the same plus the item is moved to the root of the tree. So far so good. Problem is that during the process of "filling information" about an item, some exception may be thrown. I use MessageBox to present the exception to the user. But the MessageBox "eats" the second click of doubleclick if some exception occurs. Is there some simple way to use doubleclick reliably or do I have to write my own form for MessageBox, handle its Click event, test if it means a Doubleclick and manipulat ...Show All
Windows Forms Help! - DataBinding Object
I have a CountryCollection that contains a collection of Country objects. The Country object has two properties - CountryCode (String) and ShortName (String). I also have a Customer object that has a property called Country which returns a Country object. How can I databind the Country property of the Customer object to a Combobox whos datasource is the CountryCollection so that when a user selects a Country object in the drop down list the Country property on the Customer object is updated with the selected object This might seem quite obvious, but I've tried just about everything and am currently in the process of pulling my hair out ...Show All
Visual J# Return a class in a get-method
How do I return a userdefined classtype (other than Object) in a get-method It is easy in java, but in V J# public class WhatEver { private MyClass myClass; public WhatEver() { myClass = new MyClass(); } public MyClass getMyClass() { return myClass; } } The above code works perfectly fine in VJ# 2005. Did you see any problem with above code If so please provide the exact error message and full code. Thanks, ...Show All
Windows Forms Deployment problems
I am distributing a free medical billing application using ClickOnce. When it deploys it is a thing of beauty, but currently about 75% of attempted deployments fail. I do have the WinFX runtime in the deployment string but people still run into problems (usually their OS not having all necessary updates). Can I include (and would you recommend) MS updates in the deployment string One workaround someone has done is to put text on the web page to alert people that if they get the install failure (after the bootstrapper), to just relaunch the publish.htm page in a new window and then run the ClickOnce install... All you need to do ...Show All
Visual C++ Migrate a project from Visual C++ 6.0 to VC++.Net
Please Give some guideline to migrate a project developed using C++, ATL/COM, WTL in Visual studio 6.0 environment to VC++ .Net in Visual Studio 2005 environment. It's not a complicated task at all. Open the project in VC++ 2005, follow the upgrade wizard instructions, and do a rebuild-all. Since the newer compiler is more standards compliant, you need to expect a bunch of warnings and errors, that you'd then need to fix. Also remember that the CRT functions like strcpy are now deprecated in favor of the secure CRT functions. ...Show All
Visual Studio Express Editions Reading a files properties.
How do you read the properties of files on your computer. For example, an mp3's title, genre, or a video's compression or dimensions. Thanks. For basic file properties, like creation date, file size etc. you can use information from : System.IO to get some info. (remember to include Imports System.IO at the top of your class) Add a OpenFileDialog and a button to your form and put this in the Click_Event: Private Sub Button1_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim fData As String Dim infoReader As System.IO.FileInfo OpenFileDialog1. ...Show All
Visual Studio MSBuild file for .Net 1.0, 1.1, 2.0, Compact Framework 1.0 & 2.0 and Mono
Greetings, Intro: I'm currently working in a library that has to target both .Net 2.0 and .Net Compact Framework 2.0. My initial approach was to have two projects for each assembly. The source code would be all the same, with #if's testing for the compact or the full framework. One of the projects would have all the files, and the other all the files from the first linked. As the number of source files and assemblies growed, this turned into problematic. At some time, I also wanted to test if my code worked in mono, even if it wasn't required. So I thought of using msbuild to customize my build. I started googling, and found msbuild files fr ...Show All
Visual FoxPro Word in Visual FoxPro?
Hello, new to the forums, and I have a quick question. I am currently working on a program for a Community Health Clinic, and I am working on a form for diagnosises. What I want is a dropdown box for which diagnosis to pick (which is fine), a text box for the date this diagnosis was diagnosed (done with ease), and one other thing that is giving me trouble. I would like to have a Microsoft Word style text area where a doctor can put his/her information to be stored in a table. I need to know, is this possible If so, how Thanks much, Josh I would like to have a Microsoft Word style text area where a doctor can put his/her information t ...Show All
Visual C++ Where is the VC6's memory view dialog in VS 2005?
In VC6, we can view memory content at any given address by a memory dialog. But now in VS 2005, how can I view a specific address's memory content ...Show All
Visual C++ C++/CLI language design questions
I'm doing another C++/CLI project that involves porting some of my native C++ classes so that I can mix both native and managed code. And I'm hitting the same issues often enough to wonder about a few things about the C++/CLI language design. One of the major changes from the old C++/CLI syntax to the new one is that you cannot have an unmanaged class member of a ref class. e.g. class U { ... }; ref class M { U u; // causes C4368: mixed types are not supported }; This is because memory locations for instances of M can change, and there is a risk of using the address of u somewhere in unm ...Show All
Visual Studio Express Editions Exports
Hi. All of my exports are being exported as _<functionname>@24, how can I export them as <functionname> I'd appreciate a step by step explanation :) A def file is simply a text file with the contents: LIBRARY BTREE EXPORTS x (assumes your DLL will be called BTREE.dll). Once you have created this file, drag into your project. To tell the linker to use this file, go to Project Properties -> Linker -> Input -> Module Definition File, and type the name of the def file. Then rebuild ...Show All
Windows Forms Override the return key's default selection in datagridview
By default, the datagridview moves down when the return key is pressed. I want it to move right. Currently, I'm just compensating for the return key after it has been pressed by moving right and then up. There has got to be a smarter way to do it that I'm not seeing. Thanks for any insight! ...Show All
.NET Development System.IO Q's
Hi there. I am doing some mobile dev in C#. I know that the .NET Framework is stripped down, becoming .NET CF for mobile devices. Is there a way to retrieve the startup path of the application thanks! That is correct I do get that error message. however I was able to sort it out! I had to import System.Reflection and use: Assembly.GetExecutingAssembly().GetName().CodeBase.Substring(0, Assembly.GetExecutingAssembly().GetName().CodeBase.LastIndexOf("\\")) That gave me the startup path and works great! Bad thing about it is that if your run the mobile app on the PC.. it throws a JIT error... but thats fine I guess beca ...Show All
Visual Studio Team System Sln and proj files should be in different folder - Urgent
Hi, Thanks in Advance. This is what I want to do: let's say you have a web project web1.csproj within a solution file web.sln . If this project has an ASPX page page1.aspx with code behind page1.aspx.cs . I want to have web.sln , web1.csproj and page1.aspx.cs within one folder and page1.aspx within a seperate folder. That way when we deploy to production, we can just copy all the aspx files without copy code behind files, etc. Your deliverable should be a sample solution with the solution, project and code behind files in a 'Code' folder and the ASPX pages in a 'Web' folder. You should be able to work with the solution f ...Show All
