Mathew1972's Q&A profile
Visual C++ Suggestions needed whether ON_WM_TIMER should be added to CView class or not
I want to upate my application's (an SDI app. using VC++ 2005, MFC) view at a regular interval, say at 1sec. using timer event handler. Here five event IDs are set ( using SetTimer(...) ) with five different intervals (one of which is 1sec.). The view needs to be updated after processing some data recived from a device. I am facing some problems while updating view. Regarding this, I want to know the answers of the following questions: 1. What should I use; ON_WM_TIMER of CMyAppView class or of CMyAppMainFrame class of my app. Which one is better 2. I added ON_WM_TIMER to CMyAppView class for testing purpose, but sometimes flicker takes place while updating the view (used InvalidateRect(&MyRect, FALSE) to do this). How can I r ...Show All
Visual C++ Disabling message processing on a CAXWindow
Hello, In my 3d environment im rendering a Flash activex object to a texture. I'm also injecting custom mouse coordinates through caxwindow->sendmessagetodescendants. All works ok except that something is still injecting mousecoordinates as well and throwing off Flash on some situations. I tried different window messages like WM_CANCELMODE. Also tried enablewindow(0). All after my custom injection. But to no avail. I'm very much a rookie with MFC/ATL so please bear with me. Any help would be greatly appreciated! I'm afraid the question is outside the scope of this forum. The C++ General forum deals with the VC++ 2005 IDE, libraries, setup, debugger, samples and documentation -- but not the use of all l ...Show All
Visual Studio Team System CTP5 - Names names names
Hi What about this scenario: CREATE TABLE [Schema1].[TheTable] ... CREATE TABLE [Schema2].[TheTable] ... Perfectly legal and probably quite common. But the naming scheme for the files added to a DB-project wont permit this am i right Right now I'm looking at an error in my DB-project that I assume is triggered by this. And what about this: CREATE SCHEMA Person CREATE TABLE [Person].[Person] ... This fails too on import. Brumlemann Solution Architect A correction to earlier posts. Both scenarios you mention are NOT working in CTP5. I know the first one (Table with same name but different Schemas) has been fixed and will work in future drops. I'll give the CREATE ...Show All
Visual Basic Convert Days Into Months
I have used a timespan into my program so that i can calculate someone's age based on the date he chooses as a birth date from a datetimepicker. Now i want to show his age in years and months. Timespan however can calculate the time in days and not months. How can i convert the days to months correctly considering that some years have 366 days (leap years) and not every month has 30 days http://blogs.msdn.com/oldnewthing/archive/2005/04/14/408106.aspx Best regards, Johan Stenberg ...Show All
Game Technologies: DirectX, XNA, XACT, etc. how to set xbox 360 resolution?
Hello guys! I'm deploying my game to xbox 360. The deploy is perfect, but my game aways presented on 800x600 screen. Graphics.PreferredBackBufferWidth value is 800 Graphics.PreferredBackBufferHeight is 600 Graphics.GraphicsDevice.DisplayMode.Width is 1360 Graphics.GraphicsDevice.DisplayMode.Height is 768 how can I to set the resolution My monitor is an AOC 19" widescreen... Thanks! I had the same problem last night. After much head scratching adding the code below to the main game class (before Initialize() is called) fixed it for me. graphics = new GraphicsDeviceManager(this); this.graphics.PreferredBackBufferWidth = 1280; this.graphics.PreferredBackBufferHeight = 720; R. Stlr ...Show All
.NET Development How to save data from database as xml file?
Hi I have database with one table and 70 columns. Also I have xml schema . I have managed to save the dataset as XML file. But the output xml file contains all 70 columns under one NODE. My question is as follows: 1. Am I able to use xml schema to get well formed xml 2.Please tell if any other best way to implement this Advance thanks. Changing the struture like this will require some sort of transform, either written in C# or VB or you could potentially use XSLT. ...Show All
Visual Basic Application Settings and ArrayList
I want to save some settings as an array in the application settings so I've created an application settings has a name Test and a type system.collections.arraylist I've used this code to save the settings to the application settings arraylist If Trim(TextBox1.Text) <> String .Empty Then My .Settings.Test.Add(TextBox1.Text) My .Settings.Save() End If but I've got an error Object reference not set to an instance of an object. when I execute the code ofcorse at the first run of the program the arraylist has no items in it can any one help me thank you all String and Integer are known as "value types" and they don't require initialization ...Show All
.NET Development Deleting file from fileserver
I would like to be able to delete a file from a file server. I have code to do it for an ftp server, but u nfor tunately applying this code to files on a file server does not work since the following does not exist: FileWebRequest request = ( FileWebRequest ) WebRequest .Create(serverUri); request.Method = WebRequestMethods . File .DeleteFile; I also have a way to make a temporary z drive and work with code that basically inputs into a command window. The problem here is I am not sure what the command line is to delete a file. Also, the file server will be protected by a username and password, so I need to take that into account. Does anyone know the best way to go about deleting a file from a file server If you leave ...Show All
.NET Development Adding Roles 'manually'
Please can someone help. I have an application that uses a DB table to controll access rights. This table assignes roles to each user. I have handles the Login Control's Authenticate event to authenticate against this table, which works fine. I also extract the user's role from the DB, which I would like to also attach so that I can make use of User.IsInRole later in my website. I have not managed to do this - please can anyone help (I have tried lots of combinations of: HttpContext.Current.User = New System.Security.Principal.GenericPrincipal(id, MyRoles) and Thread.CurrentPrincipal = New GenericPrincipal(MyIdentity, MyStringArray) but am a bit lost.) ...Show All
Visual Studio Express Editions Is it me or has intellisense been dumbed down for C++ Express?
I just downloaded the Visual C++ Express Edition for one of my classes after using the Visual C# Express for a quite a while, I went into the program thinking it would be an extension to my already existing program with an added language. To my dismay I found out that it is actually an entirely seperate program, if there is any way to unify the two though, could someone please tell me how, thanks. Anyways, I started using it expecting the intellisense to pop up automatically as soon as I started typing anything, and sadly, It did not. After looking around through settings I was able to find that I can make it pop up by hitting alt-right Arrow, but that is alot of extra keystrokes, that I would rather not have to hit and have it be like the ...Show All
Windows Forms component inside controls
i'm having a problem with components that i place inside control. i get a object reference not .... when i try access the properties of the component. so i have a custom dgv placed on a custom usercontrol that i place on a form. when i set columns it says object ref. . . why ...Show All
.NET Development process.StartInfo.Arguments
I am trying ot run this programm from a windows form application but at command line it stops with message: "Reading passphrase from file descriptor 0 ..." and nothing happens. Same program run fine on command line with follwoing line: C:\Program Files\GNU\GnuPG>gpg --passphrase-fd 0 < c:\gnupg\passphrase.txt -o c:\HIF\Clock.swf -d c:\gnupg\Clock.gpg This is a command to decrypt the file using GnuPG encryption and decryption program. Any help is most welcome. Thank you. Bharat Gadhia. ================================= public void Decrypt() { string strArg = @" --passphrase-fd 0 < c:\gnupg\passphrase.txt -o c:\HIF\Clock.swf -d c:\gnupg\\Clock.gpg"; process.Start ...Show All
Game Technologies: DirectX, XNA, XACT, etc. DirectX 10-Vista
I owe a computer with W. XP.I'm going to upgrade it to Vista.My question is if directX 10 needs only Vista to run.My system is fueled by ATI radeon x1600 pro.Do I have to change it or just have Vista Beside of Vista Direct3D 10 will require a Direct3D 10 compatible graphic adapter. None of the adapters that are currently sold are compatible. It’s suspected that there are adapters in the market when Vista is finally launched for the customers but until them the only way to do something with Direct3D 10 is a slow software emulation of a real Direct3D 10 hardware device. ...Show All
SQL Server A problem about ADO!
i visit db with ado interface, but now i hava a sql like below: select * into #t1 from measureInfo; select * from #t1; drop table #t1; it can't execute with ado. Does Ado not support sql operation like this thks Yes.. You can do this...execute the below query it will work.. Set NOCOUNT ON; select * into #t1 from measureInfo; select * from #t1; drop table #t1; ...Show All
SQL Server control flow of execution of statement
is there a way to check to see if the previous sql statement has completely executed before executing the next statement I have a stored procedure that basically has several insert statements. At the end of the insert statements I call bcp to write the table to a text file. The first insert will write a header record into the table. Then it will insert a bunch of records that are selected from other tables and then lastly will write the footer record. My dilemna is that for some reason the first insert of the header record isn't actually happening until the middle of the second set of inserts where it inserts several records from another table. so basically my file ends up looking like this payment record payment record payment r ...Show All
