Jehan Badshah's Q&A profile
Windows Forms Form doesn't have focus when its DialogForm closes.
Hi all, I have a Form (Form1) that opens another Form (Dialog) when a button is pressed, but when this Dialog Form is closed, the Form (Form1) that opened this doesn't have focus and I have to tap the screen (Using PocketPC) twice inorder for any Control on the Form to get the focus and react to my actions. I have the following code in a method... if (frm != null) { if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK) return true; else return false; } ... that opens the forms, but this code is contained in a class and is called from the event on Form1. Is this the cause (the form open call being in another class ) As I don't get this problem anywhere else in my application. Even if I put in a statement that sets a control on ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Drawing colored meshes using own effect
I want this easy thing to work -- but apparantly it's not that easy for me. I simply want to load a colored mesh from a file, and draw it on my screen using a custom effect. The mesh(es) load just fine in DXViewer, and also no problem when I'm using the BasicEffect to draw the mesh. The mesh is drawn at the correct position/scale, but the colors are wrong. They seem to be random, and sometimes they change during runtime. I've posted the relevant XNA code below. Of course it's incredibly rediculous to put all this code in the Draw method, but it's just to show you all the relevant code together. So here we go: protected override void Draw( GameTime gameTime) { CompiledEffect compiledEffect = Effect .CompileEffectFr ...Show All
Internet Explorer Development IE 7 ActiveX Events and Javascript
Hello, I am working on an ActiveX control that is hosted on a page using an OBJECT tag, like: <OBJECT ID="objectID" WIDTH=0 HEIGHT=0 CLASSID="CLSID:XXXXXXXXXXXXXXXXXXXXX" VIEWASTEXT> <PARAM NAME="_Version" VALUE="65535"> <PARAM NAME="_ExtentX" VALUE="0"> <PARAM NAME="_ExtentY" VALUE="0"> <PARAM NAME="_StockProps" VALUE="0"> </OBJECT> And then have a script tag with the format: <SCRIPT LANGUAGE="JavaScript" FOR="objectID" EVENT="someEvent(random, data)"> alert("Got Event"); </SCRIPT> This works perfectly and as expected in IE6, yet no ...Show All
.NET Development Difference between BindingList<T> and List<T>
I wrote a small application that binds my datagrid to a List<T>. It works fine. Then reading some blogs, I found BindingList<T> so I converted my List to a BindindList. It works fine. What is the difference between the two since they both do the same thing. I looked at the methods and yes, there are differences but I guess I am looking for a senario that List<T> can't handle, therefore one must use BindingList<T>. Thanks Ralph Hello All. Ralph: The BindingList<T> implements the IBindingList interface, which gives you several helpful abilities, like notifications when list items are changed, the ability to rollback transactions to the list, and things like that ...Show All
SQL Server Creating a list of SQL Server Agent Job Status in RealTime
Essentially I want to replicate the functionality of the SQL Agent Job Monitor. I am trying to find the correct system view or stored procedure to get a list of SQL Agent Jobs that are executing. Similar to what you would see when you use the SQL Agent Job Monitor to oversee SQL Agent Job execution. (I have verified that I have sysadmin permissions.) There is a stored procedure called msdb.dbo. sp_help_jobactivity however it still does not return information on currently running jobs. There is a system table called 'sysjobactivity' that contains job information but not the runtime status of jobs. In the BOL there is a detailed list of all of the tables that SQL Server Agent uses...but none of them seem to give runtime information. ...Show All
Visual Studio Express Editions Help in capturing CMD output
Hello again. I have been working on quite a few programs lately. One thing I’ve been working on is a program to help me with my Game Design, Halo CE. One of the tools that are used is in the creation process is tool.exe. It’s a command-based program but I’m trying to make a GUI for it. I know of the “variable = New ProcessStartInfo” but it just doesn’t seem to work with this. Xdfgsdfga Appreciate This is my code to read the output of the tool.exe program: If Trim(txt_ToolCMD.Text) = "" Then MsgBox("Please Enter A Tool Command.", MsgBoxStyle.Exclamation, "Tool UI Error") : Exit Sub If chk_Append.Checked = False Then txt_ToolOut.Text = "" Dim exe As ProcessStartInfo Dim sLine As String ...Show All
Gadgets Gadget permissions?
I've been trying to find any information on the <permissions> element for gadget development and I can't seem to find anything. What are the other options aside from "full". What I'm looking for is a way to: lock down a gadget to the desktop and force it to the background (much like the old ActiveDesktop) change permissions or settings so that a standard lab user cannot modify, close, move, etc. the gadget make the gadget center screen regardless of resolution standard lab resolution is 1024x768 but there are a few machines out there with 1280x1024. so if I make a standard gadget at 1024x768 I want it to be centered so that it appears full screen on the same resolution but centered on a larger resolution. Anyone have any ...Show All
Visual Studio 2008 (Pre-release) Providing alternate styles for a control
involved_Mike_Brown wrote (at http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=490249&SiteID=1 ): "What you want to do is create two named styles within your control's generic.xaml. After your control is initialized, set its template to one of the styles. If you want to change the style, load it from the resource dictionary and set the control's template to the new style." Hi Mike, Could you explain this step a little more fully Practically all of the examples I have seen relate to themes rather than skins. The only skin example I have seen is the format outlined in the Programming Windows Presentation Foundation book, but it seems like having default visuals and multiple skins for a custom control ...Show All
.NET Development VB.Net 2.0 File download
I am trying to get some information from a website, which I can access either via http or ftp type connections. This information is contained in a text file, which I have to do the proverbial "open file, read a line, process a line, do until file end" type of thing. The first question I have is... Would it be better to store it on the ftp side or the http side Just curious, as far as access and security issues go. As far as "the best way" to get this information, I was thinking I could use the my.computer.network.downloadfile side as outlined in http://msdn2.microsoft.com/en-us/library/1say4ws7(VS.80).aspx . Or I could use the background worker object as outlined in http://msdn2.microsoft.com/en-us/library/ms2 ...Show All
Visual C# How to check 2 reference objects for equality?
For examples sakes i got 2 Table instances, that are created by the same routine thus i know for a fact they are exactly the same. However when using equality checks they always return false indicating the table instances are not the same. I am using the following static methods 'object.equals' and 'object.referenceequals', i also tried the table instance's 'equals' method. How can i implement a conditional check to see if 2 instances of the same type are the same If the class you're using hasn't properly implemented the Equals override, there's not much you can do. You could try the operator == to see if, for some reason, that's been implemented differently than Equals. ...Show All
Visual C++ cout as an undeclared identifier?
I am new to C++ as well as programming in general. As an end goal, I am working on reading from a text file. I am currently using Visual C++ in 12 Easy Steps by Perry & Spencer. While following Listing 24.1, I put in the following code (designed as "a program that reads itself onto the screen"): //Filename: ProgRead.cpp // A simple text reading program // #include <fstream> using namespace std; void main() { //Attempting to open an text file. char buffer[225]; char inputFile[]= "ProgRead.cpp" ; ifstream input(inputFile); if (!input) cout << "Error in file name" ; else { cout << "File: " << inputFil ...Show All
Software Development for Windows Vista Spurious 'device in use' error from waveInOpen and IAudioClient::Initialize
I have discovered what appears to be a Windows Vista bug. If I change the default recording device in the Sound applet (mmsys.cpl) while an application is recording, all future calls to waveInOpen (WAVE_MAPPER, ...) or IAudioClient::Initialize for the default audio endpoint fail with error code MMSYSERR_ALLOCATED or AUDCLNT_E_DEVICE_IN_USE respectively. To demonstrate the problem, proceed as follows: Start SoundRecorder Start recording While recording, go to the Sound applet and change the default recording device Stop recording (and save the file) Try to start recording again SoundRecorder then reports 'An audio device cannot be found' Restarting SoundRecorder does not help The situation can be resolved by ...Show All
.NET Development OLEDB and SQL passwords
Hi, I am trying to produce a quick and dirty app to test database connectivity through filewalls. My plan was to write an app that connects to the sql 2000 server and runs a simple select command. My first question is when using OLEDB do I have to use integrated authentication or can I use local SQL authentication, via the sa account. And secondly If so how I can't find a property field to set the usename. Thanks in advance. Andy What Paul has said is correct, however I would strongly recommend against using the 'sa' account. The 'sa' account is the God account for SQL Server and should NOT be used in connection strings for any product whatsoever. Why Because if your code falls into the ...Show All
SQL Server Datasource and Catalog
Hi all, I accidentally deleted the datasource including the root data source and catalog from reporting services running in SQL server 2005. As a result, my reports didn't work. What should I do Thanks! lk_spec Create a new datasource and link the report to the new datasources. What do you mean by catalog HTH, jens Suessmeyer. --- http://www.sqlserver2005.de --- ...Show All
Visual C# open/close oledb connection
I connect and query my access database and populate my datagridview using the code below. My question is if I have to explicitly open or close the connection, please can you show me how & where... DataSet ds = new DataSet(); OleDbDataAdapter da = new OleDbDataAdapter(); OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + @"\MyDb.mdb;User Id=admin;Password=;"); string strSQL = "SELECT * FROM Log"; OleDbCommand cmd = new OleDbCommand(strSQL, con); da.SelectCommand = cmd; da.Fill(ds); this.dataGridView1.DataSource = ds.Tables[0]; Thanks Thanks. That worked great. I am trying to put this in a backgroundworker theDa ...Show All
