Joe Horton's Q&A profile
Windows Forms Bitmap Resources file error...
Hi… In my MDI application I am using 3 threads…& in my resources folder I have added an bitmap image ( Green.bmp )…. From all three threads on certain conditions I am changing the image on form. The image, which I want to change, is Green.bmp … But now when I am changing that image by loading it from resources using Stream it is giving me error as – {"Parameter is not valid."} Why I am getting this error… I had put some code for more understanding… Can anyone tell me where I am going wrong… public Stream theResourceGreen; theResourceGreen = System.Reflection. Assembly .GetExecutingAssembly().GetManifestResourceStream( "myProject.Resources.Gr ...Show All
SQL Server how do i use if inside sql task editor
hi, lets say i have an input param calld x. i want to use it inside sql task: i try to put if( = 0) begin do somthing end but i get an error. the variable is configured correctly in the mapping input as i have succeeded to do the same with insert: insert into y values( ) why it does not work with if statment how can i use it thx, Tomer I recommend you use an expression to build the SQL statement as this is not susceptible to the vagaries of using parametes. This may help: Using dynamic SQL in an OLE DB Source component ( http://blogs.conchango.com/jamiethomson/archive/2005/12/09/2480.aspx ) -Jamie ...Show All
Windows Forms change the font style of the tab page
Hello All Is it possible to change the font style of the tab page when the tab controls _SelectedIndexChanged event occurs. My requirement is to change the font style of the selected tab page so it can be distingued among the other tab page fonts. I am using TabControl control /Thanks in Advance Prash You'll need owner draw to do this. Here's an example: public partial class Form1 : Form { public Form1() { InitializeComponent(); tabControl1.DrawMode = TabDrawMode.OwnerDrawFixed; tabControl1.DrawItem += tabControl1_DrawItem; tabControl1.SelectedIndexChanged += tabControl1_SelectedIndexChanged; } private void tabControl1_DrawItem(object sender, DrawItemEven ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Trouble with color with 3D lines
I just learned how to plot 3D lines - I mean actual 3D lines. The problem I hit is with their colors. I cannot quite control it - need advice what to read or in case I am missing an "obvious" declaration or something. I declare the line like: Verts = new CustomVertex . PositionColored [2]; Verts[0] = new CustomVertex . PositionColored (0, 0, -100, Color .Red.ToArgb()); Verts[1] = new CustomVertex . PositionColored (0, 0, +100, Color .Red.ToArgb()); Then I draw it like: device.DrawUserPrimitives( PrimitiveType .LineList, 1, Verts); I noticed that its color - you see up I set it to RED - varies depending on things I do not yet understand - like for example If I had defined a material for a ...Show All
Visual Studio Express Editions Grab the users AD name
Is there a way to grab the users Windows name I am on a company Active directory. I just want to display this in my application. Like welcome john doe! and latter do some authenticaion with this. thanks Who deleted my post noting that Amedilyas has been marking his own posts as answered even when the Answer in incorrect I saw this happen last night. ...Show All
Visual Studio Express Editions header file problem
Hi everyone, In the below header file, there is a function which is implemented in the header file . Why is it really possible to implement functions in header file Another question is that what is the function of #ifdef and #endif in the below codes I will appreciate any helps. 1 // Fig. 10.7: Increment.h 2 // Definition of class Increment. 3 #ifndef INCREMENT_H 4 #define INCREMENT_H 5 6 class Increment 7 { 8 public : 9 Increment( int c = 0 , int i = 1 ); // default constructor 10 ...Show All
Software Development for Windows Vista change delay timeoutduration
Hello guys, I have a state machine workflow, and to create a timer, I used a delay inside an event driven. Is there anyway to change timeoutduration of this delay to a new value, while the instance of the workflow is running, so the timer expires at that new time. I couldn't find any code samples for that. Any help would be greatly appreciated. It IS possible to change the duration during execution , however not with the out-of-the-box Delay-activity. My ConfigurableDelay-activity does exactly that. You can have it wake up every few days/week, independent of the configured duration. I used this functionality to fix a bug in the standard Delay-activity ( http://forums.microsoft.com/MSDN/ShowP ...Show All
.NET Development .Net 2005 app fails if built on XP Home machine
I have been developing an application that utilizes .Net remoting as well as some unmanaged code. It is written in C# and uses Windows Forms (no ASP, SQL, etc). I have been building it on an XP Home machine and testing it on multiple XP Pro machines. After a recent enhancement, if the app is built on XP Home and run on XP Home, it locks up the OS requiring a reboot. If that same build is run on an XP Pro system, it silently fails (hangs) but doesn't crash the system. If I build the app on an XP Pro system, I don't have this problem. In attempting to debug this I tracked the code into a thread Start method. Executing the Thread Start crashes the Home system. I admit I am making an assumption about Home vs. Pro but, other than one bein ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Framerate decoupling
I'm trying to decouple the framerate from Update() so i can have more than 60 FPS. I saw this post with private void graphics_ModifyDevice(object sender, ModifyDeviceEventArgs e) { e.GraphicsDeviceInformation.PresentationParameters[0].PresentationInterval = PresentInterval.Immediate; } but couldnt get that to work... any help/ideas I know I'll have to use the ElapsedRealTime in my FPS code but not sure where to put it at. yeah, that worked.... now to slow down the counter! cause its updating around 10,000 times a second (no models or anything yet, want to get my test base perfect first) thanks man ...Show All
SQL Server Scheduling Maintenance Jobs
Hi, I have setup some maintenance jobs in SQL 2005 but when I try to schedule them I and then "save" the changes I get an error in a popup dialog saying Caption "Microsoft SQL server management studio" Error "Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)" I have no idea what is causing this but it is preventing me from schduling my maintanance tasks. I would really appriciate any assistance with this. Many thanks Derek Hi Derek, The link http://support.microsoft.com/kb/922651 provides a workaround for the problem. Thanks, Kuntal ...Show All
.NET Development Please Heeelp I don't know what's wrong
Hi I'm new to ADO in Visual Basic.Net and have problems with updating the DataSet. I'm using the code below, but after I have used the DataAdapter's Update metod nothing happens to the Dataset OR the database (the record is not deleted). Before I used the ExecuteNonQuery, then the record was gone in the database but the record was still in the DataSet. I were told not to use the ExecuteNonQuery, so I commented it. I have seen example where I should use Me.OleDbDAFilmKat.Fill(DSFilm, "Film") instead, but it didn't help. I have also seen articles there I should use this code Dim oRow as DataRow oRow = Me.DSFilm.Tables("Film").Rows(0) oRow.Delete() Then after that, use the DeleteCommand for the DataAdapter. Do I have to ...Show All
Visual Basic datagrid click
I use the following code to display record to datagrid. I set the datagrid only displaying one record which is Customer_Name only. But, how can i retrieve the primary key(Customer_ID) of the selected cell when the row is being click Dim rd As New OleDb.OleDbDataAdapter("SELECT Customer_ID, Customer_Name FROM Customer;", con) Dim tbl As New Data.DataTable rd.Fill(tbl) DataGrid1.DataSource = tbl Private Sub DataGrid1_click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.Click "WHAT CODE SHOULD I WRITE HERE " End Sub Or any other way to do so to retrieve the primary key HopeDreamsComeTrue wrote: I use the following code to display reco ...Show All
SQL Server Schedule SQL Express BAckup using SQL DMO
Is it possible to schedule SQL Express BAckup using SQL DMO do I need to use WScript.Shell,SQLDMO.SQLServer,SQLDMO.Category,SQLDMO.Job, SQLDMO.JobStep,SQLDMO.JobSchedule Hello, A similar question. I am writing my first application. It is a small data entry and data display Form. How can the user of this deployed (if ever) application save the database to a memory stick and open it in an other instance of the same application on a different computer It is a normal and expected when say someone writes a text, that that text can be saved, moved and opened it in any other computer -- so far the computer has a program installed which is capable to read it. How could this be implemented Is the appl ...Show All
Visual C# Using User32.dll's InvalidateRect
Unless anybody has a better suggestion, I am trying to redraw a portion of the desktop using InvalidateRect from User32. Basically, I have an image that I am drawing to the desktop, and need to clear where it was just drawn before drawing the next frame. I'm currently failing miserably (i.e. nothing happens) with this code: Rectangle Rect = new Rectangle (GetPosition(), _i.Size); WindowsAPI . RECT lpRect = WindowsAPI . RECT .FromRectangle( Rect ); IntPtr ptrRect = Marshal .AllocHGlobal( Marshal .SizeOf(lpRect)); Marshal .StructureToPtr(lpRect, ptrRect, false ); WindowsAPI .InvalidateRect( WindowsAPI .GetDesktopWindow() , ptrRect, true ); internal class WindowsAPI { [System.Runtime.InteropServices. DllImport ( ...Show All
Visual Basic checking ContextMenuStrip existance
Hi All How to check if the contextmenustrip exist in a form following line of code raises null pointer exception Dim f As Form = DirectCast (form_name, System.Windows.Forms.Form) If Not f.ContextMenuStrip Is Nothing Then ' code raises null poiter execption end if Thanks in advance PRash If f = nothing, then looking for f.ContextMenuStrip is going to generate an error, so use the following code. The 'AndAlso' operator will evaluate each condition seperately so it won't look at f.ContextMenuStrip if f is nothing: If f IsNot Nothing AndAlso f.ContextMenuStrip IsNot Nothing Then ' code here End If ...Show All
