Gurpreet Singh Sawhney's Q&A profile
Visual Studio Express Editions Matrix implementation problem
Hi everyone, I am implementing a matrix program which create matrix according to the values on a file and write to or read from files the values of the matrix. However, since I am not able to compile my program, I would like to ask you that whether my class si logically correct and whether it gives a compile time error or not. If there is unexpeted situations in my code, would you please help e to fix them class SymmetricMatrix { public: int index1; int index2; int **matrices; /* * Constructor that initializes an empty matrix with a given size. */ SymmetricMatrix(const int matrixSize){ size = matrixSize; matrices = new int*[size]; for(int a = 0; a < size; a++) matrices = new int[size]; // assigni ...Show All
Smart Device Development COM port issues in a MFC Smart Device App (dialog based)
I am having some issues with using the serial port on the Pocket PC 2003 SE Emulator (built into visual studio 2005 professional edition). Serial port 2 (COM3) of the emulator is being mapped to my computer's internal COM4, but opening the port is causing some issues. handle = CreateFile(L"COM3:", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); dcb.DCBlength = sizeof (DCB); printf( "dcb.DCBlength=%i\n" ,dcb.DCBlength); GetCommState(handle, &dcb); printf( "dcb.DCBlength=%i, dcb.BaudRate=%i, dcb.ByteSize=%i, dcb.StopBits=%i\n" ,dcb.DCBlength,dcb.BaudRate,dcb.ByteSize,dcb.StopBits); //set dcb struct variables SetCommState (handle, &dcb); GetCommState(hand ...Show All
Commerce Server Connecting to the ProductCatalog Database from CatalogManager
Hi, I've extended the Catalog Manager with the Image Management System from Max Abkars Blogs. Now I'm sitting in front of a problem, then with the class DatabaseAccess I want to connect to the ProductCatalog Database of the Site which I have currently open. in Max's Blogs it establishes the connection like this: string siteName = imageSiteAgen.SiteName; CommerceResourceCollection cs = new CommerceResourceCollection(siteName); OleDbConnectionStringBuilder builder1 = new OleDbConnectionStringBuilder(cs["Product Catalog"]["connstr_db_Catalog"].ToString()); builder1.Remove("Provider"); db = new SqlDatabase(builder1.ConnectionString); The problem here is that i canno't connect tho ...Show All
SQL Server Mdx Function to get Descentants until a specific level is reached?
Hi, I have a parent-child dimension in wich i need to analyse data only to a specific level... Imagine that my dimension have 10 levels but i only want to get the hierarchy to reach the level number 3.. So it would be in the report like this: Level0 Level 1 Level 2 Level 1 Level 1 Level 2 Level 3 Best Regards, Luis Simoes True, you get the level names in a Parent Child dimension. However, if you just one the first 3 levels you could just use: descendants ([Dimension].[All Member Name],2, SELF_AND_BEFORE ) Santi ...Show All
Smart Device Development Blank Values
What is the best way to handle blank values in columns in database tables, that are not strings such as Date, Double, Single etc.. The dataset designer will only allow you to set throwException as a valid argument. I am copying records from Paradox tables that can have blank values in such fields. There are two places I am trying to fix this in my code. My limited knowledge of C# is not helping. DataSet1 . HorseJoinTableDataTable dt2 = new DataSet1 . HorseJoinTableDataTable (); //DataSet1TableAdapters.HORSETableAdapter ta2 = new FBWinMobileSync.DataSet1TableAdapters.HORSETableAdapter(); DataSet1TableAdapters. HorseJoinTableTableAdapter ta2 = new FBWinMobileSync.DataSet1TableAdapters. HorseJoinTableTableAdapter (); dat ...Show All
Visual C# Creating an Event and passing an object?
I don't really know C#, I work in Visual basic. However I am trying to add some code to a dll written in C#. I would like to raise an event and send an object with it... not sure if thats the right terminology or not. while ((msg = Server.ReadMessage()) != null) { event_raising_code(msg); //help } This way in Visual basic I can setup an event handler to run things when i get a message, and at the same time get the msg object over into visual basic to dissect. I've been trying to figure this out all day and still am unable to properly write the event, I just don't know enough about C#. Help You have to set up a delegate which is basically a declaration of the function prototype for your "event_raising ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Equivalent to OpenGL Displaylist
Is there an equivalent in Direct3D to OpenGL Displaylists Thanks, Alexander. You won't be able using Dx to save and execute back a whole set of commands that includes draw calls. But you can still use IDirect3DStateBlock9 interface to save and restore states, which is part of OpenGL display list behaviour. ...Show All
Windows Forms Component not remembering property input
I am building a component that controls multiple user Controls, to take care of a tedious tasks like moveing all of them at once, ect. It is working fine except for one thing: it does not remeber the controls that were included the next time you start up the project, any help is much appreciated, I will include the relevant code: //array used to store the EButton controls the component will act upon EButtons. EButton [] EBs = new EButtons. EButton [50]; //counter for which member of the array should be filled int Dcount; [ ListBindable ( true )] [ Browsable ( true )] // property used to set the controls to be acted upon public EButtons. EButton IncludeEButton { set { //Checks ...Show All
Windows Forms datagridview
hi, i have a datagridview(vid=sual basic 2005 and sql server 2000 thru dsn im working). i want to 1)display data from a table to datagridview 2) add new rows 3)delete 4)update. i added a datagridview and added 15 columns to that ans set name and columnheader for each. i also want some of the columns to be calender etc...(i added genericdatagrid user control.dll) i have the following code in the form load but no data is coming. can u please help con.ConnectionString = "dsn=alphasql" con.Open() da = New OdbcDataAdapter( "Select * from Company" , con) 'da.SelectCommand = New OdbcCommand("Select * from Company", con) da.Fill(ds, "Company" ) DataGridVi ...Show All
Software Development for Windows Vista Adding largeicon to imagelist gives error in Vista.
Hi, I have two imagelist with size 16 * 16 and 32 * 32 respectively. I add an icon to these two image list and it works fine on XP. Under 120 DPI setting, It gives an error in Vista when i try to add the icon to the second imagelist. In the normal DPI setting it works fine. The error is, WFCException : cannot add an image smaller than the imagesize property. The code is in vj++. sample code is: smallImageList = new ImageList (new Point (16, 16)); largeImageList = new ImageList (new SIZE (32,32)); Icon icon = (Icon)LImage.getImage.... smallImageList.addImage (icon); largeImageList.addImage (icon); //error occurs on this statement. I appreciate your help on this. Thanks, vaishalli ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Possible to play mp3/other formats? Also FFT?
Hello everyone, my first post here. From what I can tell it looks like XNA relies on XACT for audio, which only supports ADPCM at the moment. A preliminary googling reveals that it's not all that great of a format for music, and wouldn't allow users to load tracks from their own mp3 collections. Is there something better in the works for the final version of XNA (or is there another way of achieving this functionality) Also, I was wondering if there is any planned FFT functionality to help with things like synching animations to the music. I ask all this because I'm looking at using alternative, FMOD, which supports a bunch of different formats and features (including FFT), and is compatible with man ...Show All
Visual C# Index out of range exception
i have a control that when created it is indexed like 0,1,2,3,4, I also add the control to an arraylsit...my problem is if i remove something at the index at posiiton 3, i need 4 to become 3 and so on.....But i also need to keep it in sync with the arraylist.....ay help with this or do i need to be clearer... for ( int tempList = this .tempOrderManifest.Count - 1; tempList >= oldindex; tempList++) { if (((Tracking.BusinessObjects.OrderLegDetail) this .tempOrderManifest[tempList]).Index >= oldindex) { foreach (Control _tempcontrol in this .pnlDataContainer.Controls) { if (_tempcontrol.GetType().ToString() == "Tracking.UI.Controls.OrderLegData") { Tracking.UI.Controls.OrderLegData _ ...Show All
SQL Server Cannot connect to localhost using Windows Security Group as login
I have a test environment set up at home with a small windows server 2003 Active Directory domain. I created a windows security group on the dc and added myself and another user to the group. I then use this group as a login for SQL Server and add the login to the sysadmin server role. This works exactly as I would expect on the Windows Server computer (which is also the Domain Controller) regardless of which computer I use to connect to this Windows Server computer. However, when I set up the exact same login on the local sql server instance of my client laptop running windows xp pro, the I get an error message (Login failed for user MYDOMAIN\dgolds...) when I attempt to connect to the local instance of SQL server, even though I am able t ...Show All
Visual Studio Team System Load test - "Avg. Connection Wait Time" counter
Hi there, Do I need the "Avg. Connection Wait Time" counter on LoadTest:Request when executing a load test using one machine (Computer). This counter is added by default to the Load test, if yes how can I locate the Dependent Computer property, as this is blank I'm not sure why you're wanting to delete this counter, but I'm guessing that you're seeing a threshold violation regarding the "Avg. Connection Wait Time" counter. By default, a threshold rule is applied to the "Ave Connection Wait Time" to alert you that you may want to increase you connection pool size or change to connection per user. If you want to change the threshold rule, you can find the threshold rule u ...Show All
Visual C# tabpage disable
Hello everyone here is the deal: i have a tabcontrol which contains three tabpages,and i want to disable one of them,how can i do it,like i want to disable tabcontrol1.tabpage1,but it does not have this propertity,i just can disable the tabcontrol.how can i suceedd Public Class TabControlEx Inherits System.Windows.Forms.TabControl Private Const WM_LBUTTONDOWN As Integer = &H201 Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) If m.Msg = WM_LBUTTONDOWN Then Dim pt As New Point(m.LParam.ToInt32) Dim index As Integer For index = 0 To Me.TabPages.Count - 1 If GetTabRect(index).Contains(pt) Then If TabPages(index).Enabled Then ...Show All
