Derek Smyth's Q&A profile
Software Development for Windows Vista CreateFile returning Access Denied for Physical Drives
I'm writing a program to enum all the physical drives in the system (to examine unmounted drives), however my CreateFile call isn't returning a valid handle: SafeFileHandle driveHandle = CreateFile( string .Format( @"\\.\PHYSICALDRIVE{0}" , drive_index), GENERIC_READ, 1, IntPtr .Zero, OPEN_EXISTING, uint .MinValue, IntPtr .Zero); After checking the LastError I find that the error is "Access Denied", how can I get my program access to do this Update: After running the Application Verifier I find I'm hitting this problem: Object opened/created in a restricted namespace I have a feeling I need to change the runLevel in the manifest, but I can't find any pages with examples of how to do this, just pages talking about making ...Show All
Internet Explorer Development Internet Explorer VS Firefox
I'm a new ASP.NET developer. I've developed a web site an tested it with Explorer and all works fine. After I'll try it with Firefox and nothing run correctly, the graphics and the javascript. Many javascript function works only in IE and not in Firefox for example: selection.move('character', 1); selection.expand('character'); doesn't exist in Firefox. There are some documentation where I can see the difference between the 2 or anyone can put some links, example etc. How can I develop a web site indipendent from the browser Thanks Hi Michele, Here's an article from IBM that explains many of the issues, definitely worth a read... http://www-128.ibm.com/developerworks/web/library/wa-ie2mozgd/ Quite a good respons ...Show All
Visual Studio Team System How to add my custom rules into Visual Studio 2005
Visual Studio 2005 has integrated the FxCop. you can see the rules in vs2005 following the steps. Using Visual Studio, create a new C# ClassLibrary project. In Solution Explorer , right-click the project and choose Properties In the Project Properties window, choose the Code Analysis tab . and then you can see the rules that the vs2005 provides. Now I want to add some custom rues into . please tell me what should I do If possible, Please give the step by step tips. Thanks. I have added my customed rule's dll into the folder:"C:\Program Files\Microsoft Visual Studio 8\Team Tools\Static Analysis Tools\FxCop\Rules". and then I restart my vs2005,but I can' t to see my custom rules on the Code Analysis tab . ...Show All
Visual C++ Any memory issues using VS2003 dll's in VS2005 applications ?
Are there any issues with compiling VS2005 applications using dll's built with VS2003 The application appears to run fine in release build, however when run in debug we see a breakpoint hit in _malloc_base() with a popup warning that there may be a corruption of the heap. I answered a similar question in this thread: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=716799&SiteID=1 see if it helps. ...Show All
Visual Studio having trouble installing Visual Studio.NET 2003
hi, im having trouble installing Visual Studio.NET 2003 the first CD goes fine i.e. the windows components update but during the installation of Visual Studio.NET Architecture 2003 it prompts over and over again that some of the files are missing in the SDK folder and also in some other folders like Common7 i think........i really don't know what to do.........can anyone suggest me a solution plz. well I believe that the license does state that you cannot install it on one computer then another if the owners of the product are different however don't quote me...going back to the original issue.... if you previously had VS.NET installed, it shouldnt really matter since the files are being copied from the CD/DVD. But to illiminat ...Show All
Visual Studio 2008 (Pre-release) Long loading window
Hello all, I'm a beginner in this field and I hope that somebody can help me. I have a window which take a while to be displayed and I wonder which is the best way to solve this issue. The window contain some controls which get data from an SQL server (maybe this help to understand way is taking so long). I've tried many solutions but I end up only with exceptions... What I like to have is anohter window which is displayed until the "longLoadingWindow" gets initialized. A C# code sample or any idea is appreciated. Thanks in advice. Ovidiu Howdy, What you can do is create a seperate thread that goes off and deals with your SQL connections to leave your UI thread processing wh ...Show All
.NET Development File Access and reading into a data structure
Hi, I am trying to read text files into a data structure. I have a directory to get the files from, and I want to basically read all files from the directory and parse them based on a data structure that I set up. I have the code already to search the directory, and to open and read the files, but I am wanting to know if there is an easy way to read the files into a data structure. Here's the code that I have already. [code] StreamReader _sr = _dirInfoObj.GetFiles(); do { lineData = _sr.ReadLine(); } while (lineData != null); [/code] What I want is to pass LineData to another function and have it parsed or just readline directly into a data structure. The first line is a header line then the other lines are detail ...Show All
Windows Forms populate the datagrid on background thread.
The below link to MS article - they have code snippet for populate the datagrid on background thread. http://support.microsoft.com/kb/318607/ This code works fine...when I have my application.run on the same form. But If i try to run the code from the child form it gives the below error msg: "Cannot call Invoke or OvodeAsync on a control until the window handle has been created" I want to do this by clicking on the button on parent form. Any help will be highly appreciated. MS Code: using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Threading; using System.Data.SqlClient; namespace DataGridThread ...Show All
Visual Studio Self-contained Embedding
Is it possible to make a self-contained embedding as AClass->BClass->AClass At present there are quite severe restrictions on the domain models that we support. Every class can only be embedded once; and every class that can have a shape on the toolbox must be embedded in the root class. The consequence of this is that the shape you propose is not supported. These restrictions will be relaxed in our V1 release. Steve Cook [MSFT] ...Show All
Visual Studio Express Editions Problem with w95_s7.dll
Hi I have w95_s7.dll with function unload_tool(). I try call this function in Visual c++ 2005 express edition. I don't have installed SDK. I add w95_s7.lib to resource in me project Prodave. I add w95_s7.h and call function: #include "w95_s7.h" ... ... ... private : System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { int res; res=unload_tool(); } When I try build project linker send 3 errors: ------ Build started: Project: Prodave, Configuration: Debug Win32 ------ Compiling... Prodave.cpp Linking... Prodave.obj : error LNK2028: unresolved token (0A00000A) "extern "C" int __cdecl unload_tool(void)" ( unload_tool@@$$J0YAHXZ) referen ...Show All
SQL Server Dual Core cpu performance improvment SQL Server 2005
Hi, I'm trying to find an approximate percentage of what would be the performance gain of using a dual core CPU instead of a single core for a SQL Server 2005 dedicated server. I've been trying to find this information for may hours but could not get anything. Could someone give me a rough estimate please Thank you! Maxim You are using some abbreviations I'm not familiar with (sorry I mostly speak french...). Could you tell me what MAXDOP and DSS are (DW = Data Warehouse I presume). We intent on using this SQL Server for a Sharepoint portal. In what category would this be ...Show All
Internet Explorer Development IShellWindows behaviour changed under Windows Vista?
Hi After a bit of experimenting, it seems to me like IShellWindows only enumerates "true" Shell Windows under Vista. Internet Explorer Windows are ignored, unlike in previous Windows versions. Is there another way to enumerate all open Internet Explorer windows in Vista and accessing their IWebBrowser interface Thanks in advance, Robert I am not aware of any difference. I ran this sample jscript which enumerates the windows and it was able to retrieve information regarding IE windows too. This code is modified from the sample on MSDN ( http://msdn.microsoft.com/library/default.asp url=/library/en-us/shellcc/platform/shell/reference/objects/shellwindows/shellwindows.asp ) var objShell = new A ...Show All
Smart Device Development how to create file
hi how to create a file at sd or mmc card The develop platform is c# .net cf 2.0. the sample code is better. thank you Does this help StreamWriter theWriter = new StreamWriter(" \\Storage Card\\someFolder\\SomeFile.txt "); theWriter.Write("hi"); theWriter.Close(); be sure to use the System.IO namespace to access the Stream(writer) classes ...Show All
Visual Studio Express Editions Printing from Rich Text Box
How Can I setup rich text box to print using the printdialog... Also, how do i make the printpreview work... tried looking at this http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=805077&SiteID=1 http://msdn2.microsoft.com/en-us/library/system.windows.forms.printpreviewdialog.aspx examples are included :-) ...Show All
.NET Development how to Enum Rows and Columns
Hi, I'm sure this should be simple but,(theres always a but) I can't seem to get it I want to enum every cell in a datatable ie For each datarow for each datacolumn, nested loops Heres what I've been trying Public Function StripNullsFromTable(ByVal dt As DataTable) As DataTable Dim rRow As DataRow Dim cCol As DataColumn Dim version As DataRowVersion = DataRowVersion.Current For Each cCol In dt.Columns For Each rRow In dt.Rows If rRow.IsNull(cCol, version) Then rRow.Item(cCol) = NotNull(rRow.Item(cCol)) End If Next Next Return dt End Function Unfortunately rRow.Item(cCol) seems to not have the actual value I would be looking for. Any ideas anyone ...Show All
