OmegaMan's Q&A profile
Visual Studio How can i delete everything from a destination directory?
Hi folks, i've got a pretty simple MSBuild proj file working. It was a Web Deployment project which i've tweaked slightly to zip up the web site code and then copy the web site code to our development web server. all works fine. What i'm trying to figure out is how can i delete EVERYTHING from the development web site folder before i do a copy over eg. \\DevWebSiteComputer\WebSiteShare That share folder has some files in it and some folders with files in it (eg. \images, \bin, etc). How can all that be deleted, please Hi, The RootDir appears to be a constant. In my case, I need to set the value of a variable that would replace RootDir. Could you tell me how this could be done. Thanks, Mark ...Show All
Software Development for Windows Vista Bug: Autoplay cancellation fails in Vista
Our application needs to cancel the Autoplay for USB flash devices in order to update the device firmware and format the media. In XP, the cancellation works fine, but in Vista you have to be logged in as Administrator to be able to reject the Autoplay for MSC devices. Even being a user in the Administrator group doesn't do it; the Autoplay handler is never called. It only works if logged in to the Administrator account. The same issue is present in x64 Vista as well. Our customers do not want their users to have to close the Explorer window or anything else, and are complaining about this. If they don't close it, the app will fail by not being able to lock the drive. Logging in as Administrator is not a good solution to this p ...Show All
Visual C# Perl to C#
hi, I have a little piece of code in perl and i need to convert it into C# application. I tried searching for a converter online but no luck. I was wondering if someone could help me do this. I'm pasting my code below: ************************************************** sub GetFiles { my ( $ftp, $Path, $UNC ) = @_ ; my $RetVal = 0 ; if ( $ftp->cwd( $Path ) ) { foreach my $Dir ( $ftp->dir( ) ) { #print "Dir: ", $Dir, "\n" ; my @Parts = split( /\s+/, $Dir ) ; my $Type = $Parts[ 2 ] ; my $UDir = $Parts[ 3 ] ; if ( "<dir>" eq lc( $Type ) ) { my $NewPath = $Path . '/' . $UDir ; my $NewUNC = $UNC . $UDir . '/' ; #print "New path: ", $NewPath, "\n" ; if ...Show All
Visual Basic How to put headers in a listbox
Hi, I am pretty new to Visual Studio, but know enough about SQL. I am working on creating some applications with VB to access my SQL database. I created a listbox that is extracting some data from a table. I am trying to Save that data to a .CSV file, but I am having major issues. I would really appretiate it if someone could help me and explain why my code is not working. I used examples to get to this code, but lack of experience is helping me to get stuck at this point. Thanks!!! Code: Try With sdlgTextFile .AddExtension = True .CheckPathExists = True .CreatePrompt = False .OverwritePrompt = True .ValidateNames = True .ShowHelp = True .DefaultExt = "txt" .FileName = filename .Filter = _ "CSV Fil ...Show All
Software Development for Windows Vista How to access a network shared folder with admin privilege when UAC enabled?
Hello, When 1)UAC is off and 2)a folder is network shared with Administrators read only privilege and 3)share mode is classic - local users authenticate as themselves, it can be accessed from other computer after inputing admin ID/password. But when UAC is on, this access is denied despite correct ID/password input. The error message is " \\mypcname\sharename is not accessible. You might not have permission to use this network resource. Contact the administrator of this server to find out if you have access permissions. Access is denied ." Even when I try to access the shared folder locally, the access is denied. I suppose UAC may change authenticated admin privilege to least privileged account and so this least privileg ...Show All
Visual Studio 2008 (Pre-release) Custom Skins/Themes
I want my users to be able to customize my program through xaml-files. I've seen that this is possible in WPF in some Login-example(found here[1]). I've tried to copy that code into a new project but nothing happens when i start the program. (The buttons size will remain 30x30 pixels) [1] http://wpf.netfx3.com/files/folders/applications/entry3927.aspx This is my code: Main-window (XAML): < Window x:Class = " TestSkin.Window1 " xmlns = " http://schemas.microsoft.com/winfx/2006/xaml/presentation " xmlns:x = " http://schemas.microsoft.com/winfx/2006/xaml " Title = " TestSkin " Height = " 600 " Width = " 800 " > < Canvas Width = " 800 " Height = " 600 " > < ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Set the texture of a RenderTarget2D?
Hi, Im having problems with my render targets. First what i think is going on: ----------------- CODE BEGINS ------------------- Texture2D myTexture = new Texture2D(device, 32, 32, 1, ResourceUsage.None, SurfaceFormat.Vector4, ResourceManagementMode.Automatic); public void draw() { device.SetRenderTarget(0, myRenderTarget); // do some rendering here USING myTexture device.ResolveRenderTarget(0); myTexture = myRenderTarget.GetTexture(); } ----------------- CODE ENDS------------------- Correct me if im wrong, but doesnt myRenderTarget.GetTexture() return a pointer to the render target texture in video memory and therefore when i try to use myTexture it is actully pointing to a texture in video memory So my question is can i ...Show All
Visual C++ WMI + Windows Services?
Dear everyone, So. I'm quite new to programming and even more so to C++/Visual C++/Windows programming in general. I come from an *nix background, so bear with me. Because I'm really bored, I started playing around with Visual Studio 2005. What I'm trying to do is create a Windows Service that will monitor the CPU and memory usage and send a structrure back to a client when requested. It should be running perpetually, unless the user stops it or the computer shuts down, naturally. Now, I've already created the server as an usual application, and it works perfectly. I'm trying to convert it into a service, as it would be better for my project as a whole. I used the template to create a service (using C++), which is fine. I tweaked the prope ...Show All
SQL Server Multilingual report ?
Hi ! Is it possible to create multilingual report. What i mean is when i create an ASP.NET page i can add as many resource file as i have different language on my website. This will change all the texte on my pages to be in the language that the user have select. So i have just one page for 4 diffrentes languages. So i would like to know if it's possible to do something like that. I mean i don't want to do 4 reports if i have 4 differents users languages. Currently we need over 300 reports. So i don't want to have to do 1200 reports. It seems a little bit crazy lol Thanks ! Sorry about my bad English ^_^ What i have done is that i've created a Class and compiled it into a dll. When you have your dll you ...Show All
Visual Basic writing to a text file
I just want to write one row of text to a text file either using a button or on close. thanks for the help thanks for your speedy response. i am sorta new at this macro thing. i just found out that i need to append the data to a text file rather than export because i am going to have multiple excel files writing to this one text file.. again, thanks for the help ...Show All
Visual Studio Forcing order of swimlanes
I have the following situation: A neural network consists of multiple layers (modelled using swimlanes.) There are three types of layers: Input, Hidden and Output layers. I'm basically done with the modelling, but want to restrict the order of these layers in the diagram: The order should always be fixed: Input, 0..n Hidden, Output. E.g. if the user adds more hidden layers, these should be inserted between the last hidden and the output layer. I've managed to arrange NestedChildShapes this way and have looked at the Anchoring, which are both the way I'd like the diagram to appear. However: On screen the newly added hidden layers always appear after the output layer. Any hints what I need to do to change this ordering scheme Thank ...Show All
Visual C++ TCP/IP Socket stops receiving
My VC++ program has 3 threads, each establishes a stream socket to a legacy system. The one socket (derived from CAsyncSocket) stops being notified of received data every so often. This sockets receives the most data of any of the 3 but still not a HUGE amount. It works fine on our NT system but the OnReceive notification stops every so often. I do a peek at it and there is data there. My clug now is to peek every second, and if there is data there, process it all. It usually resumes working after that for awhile. Any time the OnReceive callback is notified of data, I Receive & process the data until there is no more data there. Here is my ReceiveMsg code: CMsg* CClntSocket::ReceiveMsg() { #define MAX_TRYS 20 #define BUF_SIZE 819 ...Show All
SQL Server synonmys
hi, I know that in sql server there is not SYNONYMS I mean in the same way as Oracle. I can not have for example table name 'abc' and synonyms 'abc' in the same schema. How can I work around this thanks, Hi, SQL Server 2005 introduced the synonyms as a feature. If you are on SQL Server 2000, there is no way to get the feature implemented beside using views to Select other views / tables. Stored procedure to execute other stored procedures, etc. HTH, Jens K. Suessmeyer. --- http://www.sqlserver2005.de --- ...Show All
Visual Basic Looping
How do I setup a for next loop array to open files if I don`t know how many files are in the folder You could get an out of memory exception if the file you're trying to load is not a valid image file. Please check what kind of file you're loading before setting picturebox's Image property. Also, setting the pattern to limit the search to a certain extension could help: Dim folder As String = "d:\MyImageFiles" Dim pattern As String = "*.jpg" ... Andrej ...Show All
Architecture Objects with many child object relations - Need design help!
Hello, First let me start by saying that I am just getting started with OOP and Domain driven design so please take it easy on me. I am designing a domain model that consists of PROJECT objects that can contain ISSUE objects that can contain other objects like NOTES and ATTACHMENTS. There will be times in which my application will need to populate each PROJECT object along with all related child objects. However, sometimes I just need to get a list of PROJECTS to fill a dropdown or list UI control. In this case I just need some basic PROJECT properties like name and ID. I think it would be too much overhead if I populated all child objects just to fill a list (especially if there are many PROJECTs). Shoud I create 2 separate PROJ ...Show All
