Dan Heidel's Q&A profile
Game Technologies: DirectX, XNA, XACT, etc. Finding frames per second?
I've modified the starting program you create in the XNA help file to create 2500 sprites in random areas and bounce them all around... What I'd like to find out is how many frames per second my PC is getting just to see how many sprites I can have on the screen at what framerate. How would I go about finding my framerate and displaying it onscreen Help is much appreciated. By default the XNA framework uses fixed time-stepping which means that Update() will be called at fixed intervals. Draw() should still be called in a tight loop, i.e. as frequently as possible, so try putting your code there. If, for example, the fixed rate for Update() is 30 Hz and the effective rate for Draw() is 300 Hz then by default Draw() will probably draw ...Show All
Windows Forms Tapping the Enter Key
How can I move the focus to a button when I press the enter key in the Text Box Thnx! Hi, At last I've got a way to move focus between the text boxes when the enter key is pressed - Private Sub KeyPressEvent( ByVal sender As Object , ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress, TextBox2.KeyPress Dim T As TextBox T = CType (sender, TextBox) If e.KeyChar = ControlChars.Cr Then Select Case T.Name Case "TextBox1" TextBox2.Focus() Case "TextBox2" TextBox1.Focus() End Select End If End Sub Thank you guys for your co-operation! Kapalic ...Show All
Visual C++ Accessing Data In An Already Loaded DLL
I asked a similar question a couple of days ago in the C# forum, but my question is revised now and concerns C++, since I'm pretty sure it can't be done in C#. Here is the scenario that I'm dealing with. I have ProgramA.exe on my computer that loads up LibraryA.dll when it starts. There are some classes and methods in LibraryA that ProgramA uses that I would like access to. For example, there's a class called ClassTest with a method called MethodTest() that returns a variable that pertains to some data in ProgramA. If I just load the DLL, I think it creates a separate data space for the program I'm using to access it, so I can't read ProgramA's data with the exported methods of LibraryA. I tried writing a DLL and injecting it into ProgramA ...Show All
Visual C++ c:\game\Play_Sound\dxaudio.cpp(38): error C2664: 'CSoundManager::Create' : cannot convert parameter 2 from 'char *' to 'LPTSTR'
I cannot find an answer to my problem in the forum. can anyone help me. I hope here is an answer: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=849851&SiteID=1 . ...Show All
Visual Studio Express Editions read/write reg_binary
Hi, I'm hoping somebody may be able to help me out. I'm trying to read/write numbers larger than 255 into registry in reg_binary format (pairs of hex). As an example: I'm trying to write 315 and what I would like to see in registry is 3b 01 (little-endian architecture) but what I end up with is 33 00 31 00 35 00 basically each digit is converted in to byte.... I'm trying to write a plugin, so if I don't write it in the correct format, prog won't understand it... Any samples would be greatly appreciated. Thanks art If you just want to write a 'number' as a binary value, try something like this: Registry.LocalMachine.DeleteSubKey( "Software\Test" , False ) Dim regKey As RegistryKey = Regist ...Show All
Smart Device Development How to Insert a Menu bar to a DialogBox()?
Hi, all, I am doing my app on smartphone devices with Visual Studio 2005, and I am using DialogBox() function to create a dialog box instead of initializing an object of DialogBox class. I am just wondering how I can insert a menu bar to a dialog box by calling the DialogBox() function Thanks in advance Hi, As per the msdn documentation http://msdn.microsoft.com/library/default.asp url=/library/en-us/winui/winui/windowsuserinterface/windowing/dialogboxes/dialogboxreference/dialogboxfunctions/dialogbox.asp we do get a WM_INITDIALOG message in the dialog procedure. You shall need to use ::SHCreateMenuBar with the appropriate resoureces to created the menubar while handling this message, just as you do it in the OnInitDialog handl ...Show All
.NET Development Unable to cast object of type 'System.Object[]' to type 'System.Data.SqlClient.SqlParameter[]'.
I have an asp.net 2.0 application in which I am receiving the following error: Unable to cast object of type 'System.Object[]' to type 'System.Data.SqlClient.SqlParameter[]'. I have a string array in which I have built my parameters for a call to a process which requires the following type: ByVal parameters () As System . Data . SqlClient . SqlParameter I do not know the proper syntax to change this string array (which is built correctly) to fit the above requirement. I have the C# code: ( SqlParameter []) parameters.ToArray( typeof ( SqlParameter )) but I can't find the vb equivalent. This is really bugging me and any help would be greatly appreciated. Hi, You can not convert a string to a S ...Show All
Smart Device Development Timers not working
Hello, I have setup a timer to simulate cursor blinking. My program has multiple threads. the thing is that my timer went off but it never calls the function delegate to the Tick events. Do you what is reason why the tick event nevers calls the function to do my blinking private System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer(); timer.Tick += new EventHandler(BlinkMode); timer.Interval = 150; timer.Enabled = true; //============================================================= // timer tick handler //============================================================= private void BlinkMode(Object obj, EventArgs ea) { if (!BlinkCursor) { if (curX < 19) // Don't show the cursor ...Show All
Windows Forms Remove ListItem from ListBox
Hi friends when i try to remove ListBox item(ListItem) its giving error error : List that this enumerator is bound to has been modified. An enumerator can only be used if the list does not change. i have only ListItem objects in my ListBox and my code as follows foreach ( ListItem removeitem in listBox1.SelectedItems) { listBox1.Items.Remove(removeitem); } and can anybody clear me the difference between ListBox and ListView and is ListItem only for ListView (or) can we add it to ListBox also any help pls, Regards Ranadheer. Dear nobugz thanks for your code. its working fine with my application. it will be great if you clear me why the index is 0 a ...Show All
Visual Studio Express Editions error LNK2001: unresolved external symbol "__declspec(dllimport) int const _afxDBCS" (__imp_?_afxDBCS@@3HB)
Hi, I have a MFC extension library developed in VC6 and want to rebuild it in VC 2005. The dubug version is build successfully but failed in release version build. The message is " error LNK2001: unresolved external symbol "__declspec(dllimport) int const _afxDBCS" ( __imp_ _afxDBCS@@3HB )" I dumpbin the mfc80.dll and found that the _afxDBCS is exported but it dose not exist in mfc80.lib. Is my mfc80.lib file is error in VC 2005 Samuel If you are using the express edition then MFC is not supported there. If you are using othe editions, please post at http://forums.microsoft.com/MSDN/ShowForum.aspx ForumID=29&SiteID=1 Thanks, Ayman Shoukry VC++ Team ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Need high precission zbuffer, but using non d16 fails in clear.. not in create
I have a large mesh which i need to show all at once. I can not sort the rendering and play arround with painters algorithm, since it is updated real-time, and i do not have the time to be fancy. Sometimes i need to look at the mesh very close, and still I can see parts of it far far away. For this I need a high precission z-buffer. Sadly D32 is not supported yet, but the odd thing is when i ude D24S8 or D24Single8. The device is created just fine, but when I try to clear the zbuffer, before rendering a new scene, d3d fails with "no zbuffer is associated with device. Clear failed." This seems a bit odd. I ask for a zbufer and device is created fine, but I didnt get one I create as this... presentParams = new ...Show All
.NET Development Getting HTTP status 404 when calling a web service from a dll
I have a simple asp.net web service (c#). Right now I have it simply passing back the string "Hello World". I also have a class in a c# dll which calls the web service (in the constructor) and a windows app that instantiates that class. All of this works fine if all 3 of the pieces are on the same PC but as soon as I move the windows app and the dll to another machine, I get the following when the dll class is instantiated: "The request failed with HTTP status 404: Not Found." If I change the windows app so that it calls the web service directly, it works fine even if the app and the web service are on different machines. (For both the windows app and the dll, I am storing the url of the web service in the .exe.c ...Show All
Software Development for Windows Vista AmCap Sample Source Code
Hello, Someone know where can I download "AmCap Sample" source code I need to download the whole SDK It has more than 500MB !! I just need to view camera image and capture frame when I press a button in the UI. Thanks in advance, Guilherme Guilherme Labigalini wrote: Try DirectX SDK And Windows Platform SDK. If you whish send me a e-mail and I can send to you the source of AmCap. But to compile, you will need SDK. (You can google for .h files and discovery SDKs) guilherme.labigalini at gmail dot com I beliave that SDK are http://www.microsoft.com/downloads/details.aspx FamilyID=c2b1e300-f358-4523-b479-f53d234cdccf& ...Show All
Windows Forms problem of update an item from a listView,urgent, need help!!
I have a list view problem,my list view contains the items (e.g. A, B, C, D and etc.) and quantity of the items (e.g. A-3, B-1, C-4, D-2 and etc.) and now i would like to delete the items by randomly selecting it, example when i double click on A-3 , it will automatically change from A-3 to A-2 , does anyone know how to write it Why are you using the loop. It has the point, but then you decrese all selected rows in listview. So if you need only one item to be posible at once the be decresed, set Multiselect to false and remove loop and use 0 index of SelectedItems collection. But Multiselect option sometimes can be usefull. Because you decrese the value, i thought items A-Z are some products, so when you click on the product you sel ...Show All
.NET Development Problem with C#/OleDb : FileNotFoundException
Hi! I'm using visual C# 2005 express, and I just added a new data connection through the "DataBase Explorer" and I can see the tables there, in DB explorer. But I tried to use the component "DataGridView". I configured it and I could see the table Categories from Nortwind there, but when I execute the application, there's an error: private void Form1_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'nwindDataSet.Categories' table. You can move, //or remove it, as needed. this.categoriesTableAdapter.Fill(this.nwindDataSet.Categories); //this line } The message: Could not load file or assembly 'System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f ...Show All
