pshaw's Q&A profile
Game Technologies: DirectX, XNA, XACT, etc. C# modulus operator % sucks?
So in C# when I do -1%something I get -1, which means I can't really use it as an array index without a bunch of stupid error checking. Is there some way to force the modulo operator to actually give me numbers from my field (e.g 0-5 for modulo 6) Edit: Well, I made this post at 2:00 am and it shows, here is what I have issue with: i = (i+1) % 6 will result in numbers from 0 to 5, which I could use for an array index i = (i-1) % 6 will result in numbers from 0 to -5, which can't be used in an array index Obviously, the absolute value of those results would not conform to any logical value, either (for instance, array[-1] and array[1] would be the same value, even though they should be 2 values apart if I decremented twice ...Show All
Smart Device Development how to send sms through GSM network sim to bulk mobile no.
Iam new to mobile developement, mytaskis to send sms to my customers in periodic basis, can any help me in this issue. regards, Keshav Send SMS from what Server Device ...Show All
Game Technologies: DirectX, XNA, XACT, etc. No typedef and no Include. . .
Are these VBA programmers writing the .Net framework and languages Many of you probably already know this, as I'm arriving late to the party. I wanted to use the typedef equivalent but apparently not in C#. Then of course I thought I'd try the #include -- maybe so, if I wanted comments (I gather). The end result: Common.cs using System; namespace <yoursHere> { using ID = System.Int32; public class objID { private ID itsID; public objID( ID theID ) { itsID = theID; } public ID ID { get { return itsID; } set { itsID = value; } } } } Did I miss something LOL I appreciate the comments, they were fun to read. ...Show All
Windows Forms MultiLine in DatagridviewTextBox
I want to display my data in multiple lines with in a DataGridViewTextColumn. Sample 1st Row 1st Cell IP:10.0.0.20 HostName:sarika 2nd Row 1st Cell IP:10.0.0.21 HostName:pooja How can I format my cell to have newline character in a cell Hi I tried this option but that depends on the size of IP and hostname that when the line break occurs the output was something like this. IP: 10.0.0.25 HostName: sarika Status : Logged In. IP:192.168.0.255 Ho stname:Pooja St atus : Logged Out. where in i need some otpion thru which i can have newline character after each field IP,Hostname and Status. Regards ...Show All
.NET Development AxMediaPlayer cannot be instantiated because the current thread is not in a single-threaded apartment.
A real difficult problem I believe. 1. My program is already running in Single Threaded Apartment [STAThread] public static int Main(string[] args) { ... } 2. One of the computers, when running my program, pops this error. System.Threading.ThreadStateException: ActiveX control '22d6f312-b0f6-11d0-94ab-0080c74c7e95' cannot be instantiated because the current thread is not in a single-threaded apartment. at System.Windows.Forms.AxHost..ctor(String clsid, Int32 flags) at System.Windows.Forms.AxHost..ctor(String clsid) at AxMediaPlayer.AxMediaPlayer..ctor() 3. I searched many articles on the web but none of them can really useful to my case. 4. The computer with problem is running .NET 2.0. A simplified Chinese Win ...Show All
Windows Forms Login Form
hi, i have created a login form and drag te login tools from the tool box. But then i need to do some authentication. So i click on the login button and enter some code in. But somehow i get some error which my UserName.Text and tbxUserPw.Text does not exist in the current contact. anyone have idea why is it so protected void LoginButton_Click( object sender, EventArgs e) { if (UserName.Text == "" && tbxUserPw.Text == "" ) { lblOutput.Text = "Please enter login information." ; } else { DBManager DBAgent = ( DBManager )Session[ "DBAgent" ]; if (DBAgent.validateLogin(tbxUserId.Text, tbxUserPw.Text)) { if (Session[ "LoginId&q ...Show All
Internet Explorer Development Difference in IE6 and IE7 on displaying downloaded html file as attachment
Hi, I am trying to download html file and view it. The problem is, in IE6 opens it in new window(expeccted behaviour) but in IE7 it opens in the same window. At the server side the headers are given like response.setContentType("text/html"); response.setHeader("Content-Disposition","attachment; filename=Listing.html"); How can i open another brower window or tab in IE7, to display the html page which is downloaded as attachment. Please suggest me a workaround.... Thanks in advance, Sony M This may just be a flag setting. Go to your internet options...Advanced tab. Look for a flag "resuse windows for launcing shortcuts". If its checked, uncheck it and then give it a tr ...Show All
SQL Server Why it is rounded off the decimal number??
I am using the following code but it rounded off the decimal number and save the number in rounded form in the database(SQL). Plz tell me what is problem with this code. using System; using System.Data.SqlClient; using System.Collections; using System.Windows.Forms; using System.Data; namespace ConsoleApplication1 { class Program { static void Main( string [] args) { string connString = "server=(local);database=WH;Integrated Security=SSPI" ; SqlConnection conn = new SqlConnection (connString); try { conn.Open(); DataSet oDS = new DataSet (); // Create the DataTable "Orders" in the Dataset and the OrdersDataAdapter SqlDataAdapter oOrdersDataAda ...Show All
Visual Studio Clash between Studio 6, Studio 2003, and Studio 2005?
I just recently got a new machine here at work. When I was installing software, I was careful to put Studio 6 (VB6 and C++6) on, THEN Visual Studio 2003 (.NET framework 1.1) and then finally Visual Studio 2005 (.NET framework 2.0). I need to use them all for my job, often in the same day. My current project is with C# 2.0, so I got that working right away. But I just got interrupted to go back to help with a previous project, which is ASP.NET & VB.NET (Framework 1.1). Visual Studio 2003 development environment comes up fine. I select existing project, find the .sln file, and load it. Shorly thereafter (within 2 seconds or so) the status bar says "Initializing offline cache..." and then Studio 2003 freezes. And when I say &q ...Show All
Game Technologies: DirectX, XNA, XACT, etc. XNA and isometric
Hello all, what is the best way (if it is possible) to use XNA and build an 2d isometric view draw a sprite and rotate it or are there better solutions thanks in advance.. g.. There is nothing stopping you from writing a game with an isometric view with XNA. You will either accomplish that by setting a particular camera position or by creating sprites that use an isometric view. Both methods are entirely possible with XNA but XNA does not do anything in particular to help you accomplish an isometric view. How you achieve the view is entirely up to you. Yo ...Show All
Visual Studio Express Editions How would I randomize from a number set?
Hi, I am fairly new to programming with visual basic. I have been looking around a while and I am still not sure how I could do this. I am trying to randomize, but not for example 1-20 like the normal function does, but I want to randomize a set of numbers, which eventually I want the user to choose. For example... I am making a schedule generator (My actual project), and the staff all have assigned a number. I want the scheduler to be able to input the current workers, when they can work, what they do, and then Voila! The problem I am having is the part of the actual generator where the proram takes a set and then chooses one integer. Ie. User Input: 1,3,6,7,8,10,12,13,16,17,19,20,32 Generate Code: Choose 8 (For Example) If some ...Show All
Visual Studio Express Editions problems with stl
When i'm trying to include the STL library another, than contained in stdlib, i have the compiler error. The simple project, like: #include "stdafx.h" #include <vector> int _tmain( int argc, _TCHAR* argv[]) { return 0; } generates the errors: c:\rsengine\others\stdlib\include\stdlib.h(395) : error C2061: syntax error : identifier '_CountofType' c:\rsengine\others\stdlib\include\stdlib.h(396) : fatal error C1903: unable to recover from previous error(s); stopping compilation Ok, i changed the path to stdlib to $(VCInstallDir)include and after setting /showIncludes compiled the project and got: Note: including file: c:\...\projects\123\ ...Show All
Audio and Video Development Need Help Getting Started
hi. i have a project that requires that we take a video, break it apart into images/per each frame, allow the user to edit the video by rearranging the images, and then resequence the video according to the new image arrangement. i know that SGI's dMedia tools does exactly this but this is a VB.NET application and we are trying to find a Microsoft product that allows us to do this. Can somebody kindly point me in the right direction i thank you. ok, cool. i had a hunch that was the correct direction after some searching. thanks for responding. regards, peter ...Show All
Visual Studio 2008 (Pre-release) ComboBox problem/bug. Drop Down does not work
Combo box problem. Drop Down does not work if I use transparent window. this .WindowStyle = WindowStyle .None; this .AllowsTransparency = true ; Is it bug or feature I didn't find site for bug report Try this one: < Window x:Class = " WindowsApplication4.Window1 " xmlns = " http://schemas.microsoft.com/winfx/2006/xaml/presentation " xmlns:x = " http://schemas.microsoft.com/winfx/2006/xaml " Title = " WindowsApplication4 " Height = " 300 " Width = " 300 " > < Grid > < ComboBox HorizontalAlignment = " Center " VerticalAlignment = " Center " Width = " ...Show All
Visual Basic Form show unrequested
To get some experience using VBE, I converted a simple program I once made for myself(VB5). It's a birthday calendar, using a VB5 commandbutton for each day of the year, i found that VBE has great problems handling this many controls, it is slow, very slow and realy unworkable. Some where else in this forum I found that others with a lot of controls experience the same problems and there is no neat solution for it. In the mid 80's the basicinterpreter was quicker than this VBE with a machine that is 2000 times faster. Another problem I have is that the main(start) form of the program shows up unrequested. In the load section of the (start)form I show another form from which I normally select whether I show the (start)form or not. The se ...Show All
