Jarrardi's Q&A profile
Windows Forms Variable [ReadOnly()] property ?
I have an object that is displayed in a property grid at runtime. There is a string property that sometimes should be readonly, but at other times should be editable (depending on the values of other properties). Is it possible to implement a variable [ReadOnly()] ability Do I need to implement a custom property descriptor hello Mickie, here we have a article called " How to define readonly variables " hope it fit your requirement http://www.tanguay.info/web/codeExample.php5 id=328 ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Dynamically casting an object of unknown type
Hello everyone! I think I've got a tough problem for you. I've got a List<object> full of various types of objects, and I want to grab an element from the list and cast it back as the type of object it actually is. Ideally, what I would do is something along the lines of: List<object> objects = new List<object>(); MyClass instance = new MyClass(); objects.add(instance); object something = objects[0]; Type somethingtype = something.GetType(); somethingtype variable = (somethingtype) something; this works fine except for the last line. Once I have the type of the object, I can't use that to either declare a new variable of that type, nor can I use it for casting (as far as I know). Does anyone know of a way to use Type info ...Show All
SQL Server The fastest way to stop SQL Server 2000 without admin permissions... (Bug)
Do You want to stop the SQL Server service without admin permissions Use this Code : CREATE TABLE [dbo].[stop_service] ( [NUMBER] [int] NULL , ) ON [PRIMARY] GO INSERT [dbo].[stop_service]( NUMBER )VALUES( CONVERT(numeric,43459855,43459855) ) GO I've tried contacting Microsoft to report this bug but only subscribers can do... Don't run the code above in a production environment !! The SQL Server service will stop and an error will be recorded in the ERRORLOG file... Does anybody know how to submit this error Thanks for Your help Umachandar, I don't have control over all statements executed in our servers and I'm sure that there are unnecessary conversions. The main problem here is that b ...Show All
Visual Basic VB and Outlook 2003 return items as mailitem
I wrote and addin for outlook 2003 and whenever my program hits a returned email and I try to open it as a mailitem it crashes my program. What are returned emails if not a mailitem I can't seem to find a way to open those emails and parse them. I get a run time error 13 - type mismatch. I don't think that's my error trapping and doing MsgBox Err.Description, but the addin dying. ...Show All
Visual Studio Express Editions How do I into Sleep mode by VC 6.0
I would like to into sleep state after program executed 5 secs later. I know the sleep modes are include 6 states that S0~S5. The simple information of these modes are show as below. S1 (POS) ==> Stop HDD and monitor power, but CPU and memory still alive. S3 (Suspend) ==> Stop CPU and HDD. Store data to RAM. S4 (Hibernate) ==> Stop CPU, memory, HDD. Store data to HDD. Now, I can control my program into S3 and S4 by "SetSystemPowerState". But I don't know how I can into S1 mode. Could you please give me some hint If SetSystemPowerState() or any APIs does not into S1 mode, could you please help me to close monitor and stop HDD Thanks, Rabin After ...Show All
Visual Studio Express Editions Database Search for Visual Basic Express
I have created a database with MS Access 2003. The database is read with Visual Basic Express. I am now trying to find a way to do a search. The search would allow my program to find data in my database based from Visual Basic Express. Thanks in advance. There's this walkthrough that you should read, it tells you step by step on how to do this search Walkthrough: Creating a Form to Search Data in a Windows Application ...Show All
SQL Server value is null remotely - non null locally
ok here is a WIERD issue. I've NEVER EVER had this issue, I have always done this and it works great both locally and remotely. I have a table, which is a "customers" table. I have a stored procedure which takes in parameters (name, address, password etc...) and returns me back, via a parameter declared as output - the customer ID. I've always done this, and works great. Now, this works fine locally. IF I try to run this/do the exact same execution of commands (create a customer) remotely (where the database is stored, so copying everything from local to "over there") it does not work. I get a DBNULL value back from the parameter, declared as an int output. IF I copy and paste this Stor ...Show All
Visual Studio Express Editions Script Control Help Please
Good morning, I hope to get some advice, council and wisdom about the MS Script Control 1.0. I have not been able to find a reference that deals with implementing this control in a VB 2005 application. In my application I want to evaluate an expression which has been entered in a TextBox and include a variable from VB. Here is the code that has been giving me a problem. Dim tbText As String = """String1 "" & V1 & ""String2""" Dim txt As String = "GrandpaB " ‘mScriptControl.AddCode("V1=" & txt) mScriptControl.ExecuteStatement( "V1=" & txt) TextBox1.Text = mScriptControl.Eval(tbText) In the app ...Show All
Visual Studio Express Editions Newbie Crisis
I am trying to learn programming using VB express 2005. It is becoming very frustrating especially when you are new and your ideas can not be accomplished. This is what I would like to do an maybe someone could guide me through the steps needed to perform such actions or maybe someone who reads this would like to earn a few bucks teaching me how to program using vb. What I want to do is take my 3 contracts lets call them A,B, and C and create a simply Database for each of these contracts. I would then like to create a single user interface that will allow me to choose the contract group A, B, or C from a combolist and then in a listbox it will display all of the names of my clients in that contract group. Then I could select an ...Show All
Visual C# Translating from vb
Hi, Does anyone know how I would go about converting the following code into C# Partial Class Login Inherits System.Web.UI.Page Protected Sub Login1_LoginError( ByVal sender As Object , ByVal e As System.EventArgs) Handles Login1.LoginError 'Set the parameters for InvalidCredentialsLogDataSource InvalidCredentialsLogDataSource.InsertParameters( "ApplicationName" ).DefaultValue = Membership.ApplicationName InvalidCredentialsLogDataSource.InsertParameters( "UserName" ).DefaultValue = Login1.UserName InvalidCredentialsLogDataSource.InsertParameters( "IPAddress" ).DefaultValue = Request.UserHostAddress 'The password is only supplied if the user enters an invalid usern ...Show All
Gadgets can't "build" a valid gadget file!!! UGH!
I have created a zip file. I have all the proper files in it. I rename it to x.gadget and the icon changed to a sidebar gadget icon. I double-click it and it prompts to install the gadget. I hit "Install" It pops up an error message saying this is not a valid gadget file. In the directory it puts a folder with my gadgets name with ".~0019" appended to the end of the foldername. The number increments with each attempt. MyfolderName.gadget.~0019 What is going on I downloaded AlphaZip and compressed the files into a cabinet file instead of a zip, then I renamed it to a gadget file and the install works fine. Something is wrong with using "Compressed Zipped Folder ...Show All
Game Technologies: DirectX, XNA, XACT, etc. XNA Vehice Physics
Hi, I've been trying to learn vehicle physics for a car game that I'm making. I took some physics from the SpaceWar starter kit but it doesn't have the right physics for my kind of game. In SpaceWar, when you move the ship and then turn it in another direction, it keeps going in the initial direction. That wouldn't work with a car, which needs to change direction when the wheel does no matter if acceleration is being applied or not. Does anyone know of some real easy and good car physics tutorials and examples out there Thanks, Dan Castellon There is a book, while not XNA specific, that focuses on developing racing games. You may want to give it a look through. There's some pretty handy stuff in there. ht ...Show All
Visual Studio Team System RTM: Build Type running Test List always fails test
Im adding unit tests to our Build Type. Whenever, I run it always fails the tests. I dont understand why. Is there a trick to running Unit Tests in a Build Type This is the output in the log: Target CoreTest: Creating directory "C:\MARS_Daily_Build\MARS_Platform\SSMARSSmokeTest\BuildType\..\Sources\..\TestResults". __________________________________________________ Project "C:\MARS_Daily_Build\MARS_Platform\SSMARSSmokeTest\BuildType\TFSBuild.proj" is building "C:\MARS_Daily_Build\MARS_Platform\SSMARSSmokeTest\BuildType\TFSBuild.proj" (RunTestWithConfiguration target(s)): Target RunTestWithConfiguration: TestToolsTask MetadataFile="C:\MARS_Daily_Build\MARS_Platform\SSMA ...Show All
Visual Basic How-to cancel changes to a record on user request...
Hi, I have a form where I "catch" if the user made any changes. If they try to move to another record without saving, I ask them if they want to save or not. If NOT, I would like the changed data NOT TO BE SAVED! But IT IS! Here's the code... Private Sub Check_if_record_modified(ByRef result As DialogResult, ByVal Action As String) Me.ItemsBindingSource.EndEdit() If (Me.SignsDataSet.HasChanges = True ) Then result = MessageBox.Show("Do you want to save these modifications before moving to another record ", "Warning: Data Modified.", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button3) If (result = Windows.Forms.DialogResult.Yes) Then SaveChanges ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Problem with RenderTarget2D SurfaceFormat
For offscreen GPU calculations, I am trying to use a RenderTarget2D with a non standard surface format (Bgra1010102 for example, but floating point would also be nice) on Windows. Afterwards I do some rendering into this RenderTarget and use it as a Texture for the rendering on the screen. However, whenever I use a different format than SurfaceFormat.Color it throws an exception at runtime (InvaldOperationException was unhandled). The code is something like the following: static private RenderTarget2D rtU0; rtU0 = new RenderTarget2D(graphics.GraphicsDevice, RenderSurfaceSize, RenderSurfaceSize, 1, SurfaceFormat.Bgra1010102); Could this be a problem with my graphics card (Nvidia GeForce FX Go5200) or do I have to initialize something for ...Show All
