Corey C.'s Q&A profile
Visual Studio 2008 (Pre-release) New June CTP Error
Hello! Is this a known error Only Setter or EventSetter elements are valid direct children of Style element. 'System.Windows.Controls.Primitives.RepeatButton' is not valid. Error at object 'System.Windows.Style'. I have no idea! Many thanks! I got the same error when trying to convert code from Beta2 to June CTP. The old code was (works on Beta 2 - posted on Tim Sneath's blog): <Track Name="PART_Track"> <Track.Thumb> <Thumb Style="{DynamicResource Slider_Thumb}" /> </Track.Thumb> <Track.DecreaseRepeatButton> <RepeatButton> <RepeatButton.Resources> <Style BasedOn="{StaticResource Slider_RepeatButton}" TargetType="{x:Type RepeatButton}"> ...Show All
Visual Studio Express Editions Copying changing filenames
Hi all, Firstly sorry for being a noob I am trying to write a program that copies an empty spreadsheet to one location and one with data to another. The bit im stuck on is i want to organise these by dates they come in, so i thought perhaps there is code to break apart the file name (OW_OPOM 2006 09 19 180000) and send them to that folder eg. copy ow_opom20060919180000.csv to s:\ow_opom\ 2006\september\19 If there is any easier way than breaking apart the name like reading the file info date etc please let me know Heres an example of my code so far.. Case "19:29:10" TextBox3.Text = ( My .Computer.FileSystem.GetFileInfo( "C:\Documents and Settings\Salvatore\Desktop\test1\OW_OPOM_20060919180000.csv&q ...Show All
Visual Studio Team System How to test given objects?
I'd like to generate my tests using reflection, but I can't think of any way to test given objects. Generator generator = new Generator(typeof(TestedClass)); // apply additional information // ... object o = generator.generate(); Assuming that 'o' consists of several test methods ([TestMethod]), is there any way to test these methods Sorry - we don't really have a general purpose extensibility for unit tests yet. Perhaps if you could rephrase it less conceptually, I might be able to help. :) I'm still a bit confused as to what you are trying to do. If you don't need runtime injection of tests and want to create tests, why not just use the CodeDOM to create actual test classes that you insert ...Show All
Visual Basic usign windows service to copy file through network(LAN)
How could i do to copy a file to a shared folder ( that shared folder is on server ) by using Windows service when I ran code : File.Copy("c:\\tempFile.txt","\\\\192.168.0.1\\SharedFile\\tempFile.txt",True) in windows application, it worked well. But when i used windows service, that code didn't work. It seems that shared folder is not found when you use path:"\\\\192.168.0.1\\SharedFile\\tempFile.txt". It seems that Windows Service will run under another desktop which is different from the logoned interactive desktop. So how could i access shared folder by using windows service Please give me some advice. Any ideas will be welcomed ok, I thought you were using the .NET Fil ...Show All
SQL Server Variable Mapping and Resultset Questions
I'm just getting started with SSIS and have a couple basic questions. I have a Foreach Loop that iterates over a collection of database names. The collection must include only database names that match a substring. I haven't found a way to filter the SMO Enumerator collection so, instead, I feed the resultset of an Execute SQL Task into the Foreach Variable Enumerator. Of course this variable (oDBnames) is object type so in Foreach Variable Mapping a string variable (sDBname) is mapped to the only value in the collection (database name). Now sDBname should be available for an Execute SQL Task inside the container. But I keep getting the following errors: Error: 0xC001 ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Content Manager for DrawableGameComponent
I like the new DrawableGameComponent. When it comes to drawing it is easy to use, because the GraphicsDevice is supplied as a member of the class. However, for content loading it is not so clear. I can do devious things to get hold of the content manager for the parent game, but I'm wondering if this is the best thing to do, or whether you would reccommend that components have their own content manger. Thanks for the answers folks. I'm in a much happier place now. In the end I made the content member of my Game class public and then pulled it in within the components, which worked fine. I guess I'm one of the old school who doesn't like making more than one thing if I can possibly avoid it. ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Is it better to create a Cue object for each sound or to just Get the cue from the SoundBank each time?
For part one of my question, I've been working on improving how I'm handling sounds in my game projects and I was wondering which is the preferred method. Is it better to create a cue object for each sound like this Cue mJump = mSoundBank.GetCue("Jump"); and then playing them later by just saying mJump.Play(); Or is it a better practice that unless you need to Pause and Resume a sound that you just Get and play the cue from the Sound bank all the time like this mSoundBank.GetCue("Jump").Play(); For part two of my question, I've been playing with designing my sound management classes using the two different methods and I've been noticing a lot of issues when I try to re-play a sound in a store cue object over and o ...Show All
Game Technologies: DirectX, XNA, XACT, etc. How do I find the collision normal of two rectangles?
If anyone has any idea, please let me know. I'm not entirely sure how to begin on this one. I've got collision detection down, but have no idea how to find the normal. The normal of an object is usually derived from the dot product of the verticies you are checking for collision against. This is usually done more easily through the use of bounding boxes or bounding frustrums. Try looking on http://gpwiki.org and www.gamedev.net both are very useful for finding out about such things. Also have a look at the Farseer Physics engine on codeplex, which has a lot of collision code and should help. Hope this helps Darkside (P.S I'm going completely from memory here as I couldn't find the article I read this from by the way ...Show All
Visual Basic XML comments
My group is attempting to standardize on XML commenting for all of our classes and methods. We like the "Insert comments" option in VS 2005 but would like to add an additional tag <history> to the comments section. I know that we could probably do this manually each time we add a new class, but I would like to be able to have this new section come up automatically when we insert the comment. Is there a way to modify the XML comment block that is produced when you use the "Insert comment" function so that the new <history> tag will be included in the text You need to ensure this file is in the correct location. In my case as my user is ABOWLES this would be the folder I ...Show All
SQL Server SQL server agent job does not work.
Hi , I installed the SQL server 2005 standard edition with SP1 on winXP and Win2003 in slient mode using a vendor's CDs. The SQL server agent service was not started automatically. After I started the service, I created a job including a VB script step. When I started the job, I got an error " Error creating security descriptor for shared objects (reason: No mapping between account names and security IDs was done). The step failed. " If I change the log on user of the SQL server agent service from "Local System Account" to adminstrator. The job works. And if I install the SQL server 2005 not in slient mode, the job also works. Is there any problem in the slient mode installtion configuration Thanks Roger ...Show All
Visual Studio 2008 (Pre-release) Trouble loading Baml using LoadComponent
Hello, I'm trying to load some baml from resource assemblies using Application.LoadComponent. As a parameter I use Uri that contains full name of assembly with culture: "en". But LoadComponent gives me IOException, that same assembly, but with culture: "neutral", was not found. here is a sample that first loads PresentationFramework Luna baml, and then tries to load mainwindow.baml from Sparkle. Luna baml is loading as expected, but Sparkle baml throws exception: static readonly string PROGRAMFILES= Environment .GetFolderPath( Environment . SpecialFolder .ProgramFiles); static readonly string PRESENTATION = Path .Combine(PROGRAMFILES, "Reference Assemblies\\Microsoft\\WinFx\\v3.0\\Presentati ...Show All
Visual C# Debug Setting question - Stepping into DLL???
I'm sure this is just a setting that someone can point me to. For some reason, when I reference my dll in a new project that I had built inside an entirely new solution, and then step through the project, it steps into my dll!! I don't want any windows popping up showing my users my source code. How do I stop this from happening uh... yeah Are you asking/telling something to me I'm not sure I understand you... If you are suggesting that I am intending to deliver the source or pdb, then you are wrong. All I did was create a new solution, then created a new windows form project and then I made a reference to the dll of my system. I didn't register the DLL or anything. All I did was: The dll that I am referencing is a completely seperat ...Show All
Visual Studio Express Editions how to compare two images and return the result?
Hi, all, I want to compare two images. I read these two images into the bitmap class If I don't want to compare these two images by each pixel, how can I compare these two images thanks for your help! Tsai Dim imagefile1, imagefile2 As Bitmap Dim result as boolean imagefile1 = New Bitmap("D:\temp\IMG_0315.jpg") imagefile2 = New Bitmap("D:\temp\IMG_0313.jpg") result = equals(imagefile1, imagefile2) // If imagefile1 and imagefile2 are really the same, but the result of the equals(imagefile1, imagefile2) is false why That Equals calls the Object.Equals method which tests if the two variables reference the same object. It does not compare the images. If they are always coming fro ...Show All
Visual Studio Express Editions searching text (in a column) from a database
Hi everybody (programming in VB2005 pro, beginner) I made an adressbook with a database from a SQL server pro. Now i want to make a form with the possibilty to search text in a specific column(in a database ) (e.g. First Name). So i made the form with a grid (named: GRID1), a textbox (named: TxtSearch) and a button (named:BtnSeek). So i need the code to put into the button to search in the column database what I have entered in textbox. It have to search in the column(FirstName), (No primary key). And if it has found a record, highlight that record . Pls help, thx in advance (pls post anything you know about searching in SQL databases) regards, Marnik How can i make that method 'search' and what is Sql query ...Show All
.NET Development How to convert GMT date/time to local date/time
Hello, I need to convert a date/time in this format 2006-12-29T17:00:54Z to my local time. I found the adjust-dateTime-to-timezone function at http://www.w3.org/2005/xpath-functions/ but according to my research and testing it doesn't seem to be implemented in VS 2005 or I haven't figured out how to make it work. Can someone tell me how to deal with this problem I'm sorry. I should have been more verbose in my original question. What I'm working with is XSLT code not C# code. I'm using C# to transform the XML file that contains this GMT date/time stamp and wish to convert it to local time within the XSLT code. The following code does a very nice job of formatting the date and time fro ...Show All
