Redmanmc's Q&A profile
Visual C++ VS2005 float bug?
I am trying to subtract 3.0 from 3.55 in VS2005 C++ and get the result 0.54999995 The result is correct 0.55, using the same code in Visual Studio 6. HELP !! #include "stdafx.h" int main(int argc, char* argv[]) { float a = 3.55; float b = 3.0; float c = a-b; return 0; } Thanks, yes I have researched and understand the accuracy issue. However, the sum is 3.55 subtract 3.0, so we are well within any significant digit boundaries Visual Studio version 6.0 delivers the correct answer of 0.55 But, Visual Studio 2005 does not calculate the sum correctly It's the same code ...Show All
Software Development for Windows Vista Enabling Theme Support via Manifest
My application (using the WIN32 API) enables XP Visual Styles under XP with a manifest. But when the app is run under Vista, Visual Styles / Theme Support does not get enabled. (Buttons have square corners, no highlighting, etc.) What can I change in the manifest (or in the C code) to enable Vista Themes Manifest: < xml version="1.0" encoding="UTF-8" standalone="yes" > <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="SabioNet.AshWin.ashw32" type="win32" /> <description>AshWin</description> <dependency> <depen ...Show All
Visual Basic Auto Primary Key with fill in
I want to setup a int primary key that auto increases but will fill in any missing numbers EG 1 2 4 5 7 The next primary key should be 3 (NOT 8) SQL Server 2005 VB.NET 2.0 How do I make the sql server do this, so that the data is safe from corruption / data loss. Hi David That's more of a SQL Server question and probably better suited to that forum, but I'll try to offer some help. First off can I ask why you want to do this The solution is likely to be less than desirable and my first (strong) instinct is to talk you out of it Richard ...Show All
Software Development for Windows Vista State Machine Workflow needs to time out if several state transitions do not happen within specified period
Dear all, I know how to set a timeout on a specific event not happening within a period of time, within a single state. This is done by putting two EventDriven activities in the same state, with one awaiting the event and another waiting for a Delay to expire. However, I have a requirement for a state machine workflow to move through several states, any one of which has no specific time limit, but the complete set of state transitions needs to take place within a specific period of time. Could anyone explain how to deal with this I seem to have hit a mental block, where I can't see how to do it. Any help would be much appreciated. Dear Shelly, That works really well. Thanks for letting me know about it. I had not reali ...Show All
Visual C++ Compile Errors
Hi all, I am trying to build a Win32 project under Windows Vista using VC++ Express. I am getting the following compile errors. The same project compiles fine on VC 7.1 on Win XP. I get Error in winnt.h. 1>c:\program files\microsoft platform sdk\include\winnt.h(894) : error C2988: unrecognizable template declaration/definition 1>c:\program files\microsoft platform sdk\include\winnt.h(894) : error C2059: syntax error : '(' 1>c:\program files\microsoft platform sdk\include\winnt.h(894) : error C2090: function returns array 1>c:\program files\microsoft platform sdk\include\winnt.h(894) : error C2988: unrecognizable template declaration/definition 1>c:\program files\microsoft platform sdk\include\winnt.h(894) : error C205 ...Show All
Visual Studio Express Editions Using Sounds from My Resources
Hi. I wonder if someone can help me. I'm having a problem getting the music coding working for my program. You see, I'm trying to make my program so that instead of referencing external locations on my hard drive in order to load .wav files, the program imports them into the "My Resources" folder, so that when I go to publish the program, the music files are published along with the rest of the required files. However, it's not working. I can successfully add the .wav sound files into the "My Resources" part of VB, but then when I input the coding into Form 1, when I run it, I hear nothing at all. This is the type of coding I'm using, but the music doesn't play when the form loads, and VB won't let me put th ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Blitting?
I've checked through the XNA Documentation, but there doesn't seem to be any way to 'blit'. For those of you unfirmiliar with 'blit': Blit is a way to draw something. For example, say you create a "Texture2D" variable, set the size etc... But the texture is blank. The normal way to create a texture to this is to load up a bitmap image with it through the ContentManager, right But what if you want to use a whole sprite-sheet with many images Back to the blank, say, 65 x 65 bitmap image, you obviusly don't want this 2D image of the player to be a whole 1024x768 sprite-sheet. So this is where I used blitting in other programs, it basically asks for the x, y co-ordinates, and the length of the bitmap and takes a picture from that x,y and 'c ...Show All
SQL Server BIT-Wise Aggregation
Hi, I have the following three tables : Account (Id int, AccountName nvarchar(25)) Role (id int, Rights int) AccountRole (AccountID, RoleID) In Role table - Rights Column is a bit map where in each bit would refer to access to a method. One account can be associated with multiple roles - AccountRole table is used for representing the N:N relation. I want to develop a store procedure - which would return all AccountName and their Consolidated Rights. Basically I want to do a BitWise OR operation for all the Rights in the Aggregation instead of the SUM as shown in the following statement. SELECT Account . Name , SUM ( Role . Rights ) FROM Account WITH ( NOLOCK ) JOIN RoleAccount ON RoleAccount . AccountID = Account ...Show All
Visual Studio 2008 (Pre-release) Access sub-properties in <Setter/>
Hi, Suppose I have: public class CustomPanel : StackPanel { public Image Image { get { return _image }; } } And I have this style: <Style TargetType="{x:Type CustomPanel}"> <Setter Property="Image.Width" Value="100"/> </Style> That seems to set the width of the panel rather than the width of the image. How can I specifically target the image width and set the panel width separately I tried this but it gives a compile error: <Style TargetType="{x:Type CustomPanel}"> <Setter Property="(Image).Width" Value="100"/> </Style> Thanks, Kent Boogaart Unfortunately you can't access sub- ...Show All
Visual Studio Team System Load Test
how can i confgure the laod test, with Test Mix : unit Test , to run on WAN. I have created the unit test which test the webservice in a lan environment. Currently I am using two machines one Client " Unit Test project" and the server hosting the WebService". I have created the Load test where in In Network Mix - by default it takes the LAN distribution. I need to simulate a scenario wherein have the client and server machines are distirbuted over a WAN. Help on this is appreciated. Thanks ...Show All
SQL Server TRyign to extract Top 3 records using Partitioning
Hello, I have a table containing 3 columns Department Name, RiskScenario and Cost. I am trying to create a data extract that contains the top 3 Risk Scenarios (sorted by Cost) per Department. I tried using this sql statement in MSQuery but it doesn't work. Any ideas where I'm going wrong or if there is a simpler way to do this Select * from ( Select DepartmentName, `Risk Scenario`, Cost, row_number() OVER (PARTITION BY DepartmentName order by Cost) rn FROM 'Departmental Risks`) where rn <=3 Please help. Just can't figure this out! Meera Select * from ( Select DepartmentName, `Risk Scenario`, Cost, rank() OVER (PARTITION BY ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Day 1 - Where you at?
So day 1 of the XNA madness has come to a close, with many more to follow. How far has everyone gotten on their first game projects I haven't spent nearly as much time as I wanted to on this, but I managed to get my head to bounce around the screen. I think the next step would be to add another head (i.e. angelina jolie) to bounce around. Maybe I'll even add collision detection so that if the heads hit, she says something like "I want you so much!" and I go "Yeah, whatever" and bounce. ...not sure if I should have mentioned the idea for this game...now everyone's going to steal it and make millions. But enough about my awesome game in the works. If anyone has anything worth checking out, upload it somewhere and post the link in this th ...Show All
SQL Server Another Uninstalling problem!
When I am trying to uninstall SQL Server 2005 Express on XP Home I get the following error message: The SQL Server System Configuration Checker cannot be executed due to WMI configuration on the machine MARTINS Error:2147749896 (0x80041008). I have tried restarting the WMI service but that doesn't help. Any ideas This looks like a problem with WMI on your computer. Check out the following: WMI Isn't Working WMI Diagnosis Utility This should help you determine what is wrong with WMI and help you fix it. Regards, Mike Wachal SQL Express team ---- Mark the best posts as Answers! ...Show All
Visual Studio Express Editions Fonts residing in the app's folder
Is there a way to use fonts that aren't installed but that resides in the application folder If you want to use a 'freeware' TTF and embed it in a program, try my private font test program at http://users.adelphia.net/~gcumbia/FontPrivate.zip I can not get the private font to print! (Using the regular 'drawstring') It is replaced with a regular font. ...Show All
Visual Basic Printout is not what I expected
I need some help with the following problem. I have made a simple pos system that will let the user push buttons that represent the menu items and those items show up on the reciept. I am using formatting zones to line up the items. This part of the program works fine and the display on the screen keeps everything lined up. My data is contained inside of a sorted list and my objects come from a menuitem class the properties are : name - holds the name of the menuitem price- holds the price cost - holds price * Quantity Quantity - how many key - so each entry into the sorted list is unique The name of my sorted list is itemcoll And my theory is that i can loop through the sorted list and print each element until r ...Show All
