Amr Ouf's Q&A profile
Windows Forms Problem creating a derived DataViewManager component: DataTable internal index corrupted
I have a component that serves as a read-only DataViewManager to which various controls are bound: public partial class PickListProvider : DataViewManager { public PickListProvider() : base(static_dataSet) { } As you can see, the DataSet containing the data is shared amongst all component instances. Here's the problem: From time to time it loads updated data in a seperate thread which seems to cause problems (one background thread updating the one static data set for all component instances). Im doing it like this: DataSet newData = remoting.Picklists.GetAll(); DataHelper.BeginChangeData(static_dataSet); static_dataSet.EnforceConstraints = false; static_dataSet.Clear(); static_dataSet.Merge(newData); ...Show All
.NET Development Strange problem with XmlReader/XmlWriter: "The process cannot access the file '...' because it is being used another process"
Hello, I have a strange problem when using XmlReader/Writer. After writing the xml file and restarting the app I like to read the contents from that file. Writing the doc XmlTextWriter writer = null; try { XmlDocument doc = new XmlDocument(); writer = new XmlTextWriter(filename, null); ... doc.Save(writer); } catch (Exception ex) { ... } finally { if (writer != null) writer.Close(); } ... and reading the same file (after restarting the app) StreamReader sr = null; try { XmlDocument doc = new XmlDocument(); // *** THIS LINE CAUSES THE EXCEPTION *** FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read); sr = new StreamReader(fs); doc.LoadXml(sr.ReadToEnd()); ... } catch (Exc ...Show All
Windows Forms radiobutton event set coordinates for image?????
ok, newer to developing (at least in C#), but I want to have an array of 81 radiobuttons at specified coordinates (done), when clicked they will go to my "placepiece" class (does what it says), BUT i want to input the coordinates of the clicked radiobutton into the placepiece class, in the event code [note, b5 is just ONE of the buttons]and also i do not know how to implement it into the playpeice code after that...where should it go in this code/how should it go there, i tried to set a variable for each button, but got an error...help!( b5.AutoSize = true ; b5.Location = new System.Drawing.Point(330, 90); b5.Name = "b5" ; b5.Size = new System.Drawing.Size(37, 17); b5.TabIndex = 61; b5.TabStop = true ; b5. ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Blitting?
I've checked through the XNA Documentation, but there doesn't seem to be any way to 'blit'. For those of you unfirmiliar with 'blit': Blit is a way to draw something. For example, say you create a "Texture2D" variable, set the size etc... But the texture is blank. The normal way to create a texture to this is to load up a bitmap image with it through the ContentManager, right But what if you want to use a whole sprite-sheet with many images Back to the blank, say, 65 x 65 bitmap image, you obviusly don't want this 2D image of the player to be a whole 1024x768 sprite-sheet. So this is where I used blitting in other programs, it basically asks for the x, y co-ordinates, and the length of the bitmap and takes a picture from that x,y and 'c ...Show All
Architecture .net binary web services.
Just wondering if anyone is using .net binary web services. I know there are few experts in this forum, just wondering if you could share some input about the scenarios when it is appropriate to use them and any example articles which show how to use them, the advantages and disadvantages of using them. Thanks. If you choose performance over interoperability, then why use web services in the first place Simply the fact that you mentioned .net directs me to the understanding that you have .net on both sides of the wire. So, do you really need interoperability ...Show All
Visual J# Undergrad J# Course
Anyone know of any colleges/ universities offering a VJ# course as opposed to a J2SE course in a comp sci or IS program TIA I know of several high schools that use J# for teaching computer science courses. Some of them have used J# to teach the AP CS course which is very much like a CS 1 course at most universities. ...Show All
.NET Development how to use WMI to get registry keys
Hi, I need to access the registry through WMI but i can't find any examples on the internet, can someone help me tkns P.S.: the language is C# why dont you use the Microsoft.Win32 namespace to access the registry Easier and faster than WMI Either way you may still have security issues. http://msdn2.microsoft.com/en-us/library/microsoft.win32.registry.aspx http://msdn2.microsoft.com/en-us/library/aa394600.aspx - even though this is in VBScript, easily convertable, hopefully, to C# ...Show All
Visual FoxPro MsComm Problem
My dear Professor, Thank you very for helping me on many forums. Now I am facing a serious problem about MsComm. I am using MsComm with following properties Commport :1 Setting :4800,n,8,1 Handshaking :0,ComNone InBufferSize :1024 OutBufferSize :512 RThreshold :0 SThreadhold :0 InPutLen :0 EoFEnalbe : UnMark PartiyReplace : NullDiscart :Unmark RTSEnable :Unmark DTREanable :Marked I do not use any event of MsComm. Following commands are under a command button Thisform.mscomm.portopen=.t. abc=thisform.mscomm.input Mscomm receives weight from Input Device called HB-8210. Everything work fine in VFP 6 on WIndows 98 platform. ***Now problem details When I run this form, with same settings, on Win ...Show All
Visual Studio Tools for Office auto_close addin unload
I have addin which unload on "auto_close". but i noticed that if user has modified the Excel sheet and try to quite excel, Excel is showing dialog to confirm to save changes. If user click "Cancel" for it ,still auto_close is invoking. So what is best way to verify user have clicked "Cancel" button and don't unload the add-in Hi Drew If this is an EXCEL VBA Add-in, then you need to ask your question in a group that's specific to Excel programming, here: http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.excel.programming&lang=en&cr=US This group targets a very specific, .NET Framework technology that has nothing to do with VB ...Show All
Game Technologies: DirectX, XNA, XACT, etc. 2D retro side scroller with tilemap and collision detection
having being a C# programmer for a number of years and a avid gamer I thought at trying to program a side scrolling shoot em up in C# with the XNA Game Studio beta. Some of the issues one encounters in 2D games are amonst other collision detection and a scrolling tilemap. 1. I'd like to know if someone have created a game library which features pixel perfect image-on-image collision detection of image of varying shapes, not only boxes or triangles 2. Is there any C#/dotnet tilemap library available of the great freeware Mappy ( http://www.tilemap.co.uk ) library If not, anything equivelant or similair I dont wanna reinvent the wheel concerning collision detection and tilemaps. Anyone who develops 2D games will run into collision ...Show All
Windows Forms Buffering Images HELP
Im not sure if this is the right place for this post, if not I apologize in advance this is my first time on the forum. My question is - I am trying to write an Image Viewer program that reads the file paths from the file system and stores them in a list. Then it loads the first 25 images into an Image list(the 25 can be set to whatever I want.). That all works fine. The problem is when you get to the end of the 25 and its time to add more images. It works but is EXTREMELY slow. I cant seem to figure this out and have been playing with it for a while now. Any insight would be appriciated. Heres my code for adding to the buffer - public void vScrollBar1_Scroll( object sender, ScrollEventArgs e) { Thread addThread; i ...Show All
Smart Device Development Beta of Microsoft Certification Exam 70-540
Microsoft Certification Exam 70-540 is available in Beta form right now! This is a Technology Specialist exam for application developers in the mobility space. The Preparation Guide is available for the Exam at: http://www.microsoft.com/learning/exams/70-540.mspx . To register visit one of our independent testing providers: * Thomson Prometric: http://www.prometric.com/ContactUs/T...rs/default.htm * Pearson VUE: http://www.vue.com/ms/ Please use the following promotional codes when registering: Exam 71-540: BTA540 Best of luck! Howard Dierking Product Planner Developer and Database Certifications Microsoft Corporation Hi Howard, Now that's a bummer. Guess I should stop checking my exam ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Controlling Aspect Ratio
So I was playing around with my XNA Control (1) for windows forms last night and got some sprites rendering based on some UI input (ie. press the "Add Sprite" button, file dialog comes up, and you pick a texture to add). I've got the control in a split container in the right pane. When I stretch the window, the sprites stretch right along with the window. The ideal behavior would be that stretching the window would simply give you more screen real estate. I'm imagining the way to figure this out will also apply to dealing with 4:3 vs 16:9 aspect ratios (2). Just need a few pointers on how to properly handle this :-) Thanks! (1)http://codecube.net/item.asp cc_itemid=314&searchstring=xna%20control (2)http://forums.microsoft ...Show All
Windows Forms WebBrowser control issues !
I have a list of webpages that I want to visit and get some data from each page in the same way so I decided to do the following: //the function that'll process the page when it's loaded browser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler (SetDownloadedCelebsInfo); //This function causes the browser to go the page I'd like to process private void StartDownloadingCelebsInfo() { if (celebIndex < celebNames.Count) { this .celebInfo = this .celebsInfo[celebNames[celebIndex]]; this .celebIndex++; this .browser.Navigate(settings.RootUrl + this .celebInfo.Homepage); } else { //Done With All CelebsInfo NotifyCelebsInfoDownloaded( this , new Cele ...Show All
SQL Server Dervied Column - Expression?
Hi: I have a Dervied Column Component, in which there is a column called RecStatusCode. The criteria to give a value to that column is below in SQL: (SELECT CASE CertParticipant WHEN 'Y' THEN 'C' WHEN NULL THEN 'A' END FROM [dbo].[SchoolCertRequest] WHERE SchoolID = (SELECT SchoolCode FROM [WebStrategy].[LAF].[LoanApplication] WHERE LoanApplicationID = @LoanApplicationID) and SchoolBranch = (SELECT BranchCode FROM [WebStrategy].[LAF].[LoanApplication] WHERE LoanApplicationID = @LoanApplicationID) AND LoanType=(SELECT LoanApplicationTypeCode FROM [WebStrategy].[LAF].[LoanApplication] WHERE LoanApplicationID = @LoanApplicationID)) My question is how can I use this SQL in that expression field, or is it possible to have a u ...Show All
