wencey's Q&A profile
Visual C++ Native C++ : Report on what the optimizer has done?
I've recently fixed a problem in my code where the optimizer "optimized out" a variable assignment, causing problems. The assignment happened in one module and any reading happens in other modules, my guess is the compiler thought the assignment was useless and discarded it. Is there any way to get a report on what the optimizer has found / changed after doing a compile/link No: this is not possible - the optimizer has so many passes and does so much that you would be literally swamped in information. But having said that this sounds like a bug - if this is, as it sounds from your description, a global variable then the optimizer can't assume that it isn't used in another compilation unit and t ...Show All
Visual C++ concept of encapsulation
give up with this one, I guess I don’t understand this concept of encapsulation, well I do but I don’t know how to make this program work I declare in the fraction_class the following: as a PRIVATE private : int pnum,pdem; //private numerator and private denominator use for asignment#5 int pnumb1; double presult; //double to hold the fraction decimal value static char const slash = '/' ; //static character field that hold the slash //Private function to calculate the decimal equivalent of a fraction //fraction Assig#5 void calculateDecimalValue() {presult = (( double ) num1 / ( double )dem1);} I understand that I need t ...Show All
Visual Studio Express Editions Why does this give NullReferenceException error?
I'm having problems with arrays of objects. Basically I have a Particle class that has a member called energy, if I try to create an array of particles as shown below I getan error when i try to assign a value to the energy member variable saying object reference is not set... *this gives error* private void InitialiseSystem() { Particle[] particleArray = new Particle[4]; for (int i = 0; i < numParticles; i++) { particleArray[i ].energy = particleEnergy; } } Yet if I just create a single object of type Particle, then I don't get and error as *this gives no error* private void InitialiseSystem() { Particle particle = new Particle(); particle.energy ...Show All
Visual C# Reading the end of an XML file
I have a program that cycles through an XML file and outputs to another file every 1000 records. Thyis works fine until the end of the XML file is reached, when it fails saying my 'root' tag is not closed - although it does for the previous files. It seems to be having issues with recognising the end of the XML file, so can someone please confirm how this is done Currently I have a while loop to do this, with a for loop inside to cycle through the records, ie: while (XmlReader.Read()) { ... for (int i = 1; i <= 100; i++) { while (reads in a node here) { does the work } } Close the XmlReader and XmlWriter } This works fine for the beginning, until the end of the file is reached; is my way of reading the XML file correct (I have also trie ...Show All
Visual Basic Where can I get?
Hi guys, Despite the default blue, olive green and silver windows color schemes, where can I get/download new cool color schemes for windows Thanks, Danial Hi, Despite this not being related to Visual studio try some of the links generated by this GOOGLE page.>> http://www.google.co.uk/search hl=en&ie=ISO-8859-1&q=windows+%28theme*%29&meta = Regards, S_DS ...Show All
Visual Studio Tools for Office Receiving command line parameters in word add-in
Hi All, If a word document is created/opened using automation i.e. using documents.Add and doucments.Open respectively, can we pass any command line parameters/arguments Is it possible for the add-in to be able to receive those parameters Any response will be appreciated TIA ...Show All
.NET Development .NET encourages poor coding?
The more I look at .NET error handling, and how to deal with it, the more frustrating it gets. Take this class for example. It has a single boolean property. You have to know on which side of the call an error will be raised… by the caller or the callee… well here’s a prime example. Say you have to read data from somewhere like a text file and you cannot ensure the format of the data is proper. Well, you cannot depend on a property to check that data for you if you strongly type the property. Read the orange comment to see what I mean, and please let me know how you deal with this situation since to me it appears to require horrible program design. Public Class ...Show All
Visual C++ Reverse Engineering
How get the picture of class structure of VC++ code using visual Studio .net 2005 If this is managed code: use reflection. If it's native code, you cannot simply "get the picture", as there's no real way to translate machine code back to e.g. C++. Buy a good book on the assembly language ...Show All
Game Technologies: DirectX, XNA, XACT, etc. have a look at my 3d game in progress
typeAttack, a 3d typing game. sceenshots: http://hometown.aol.com/JSkunk/jpg/typeAttack01.jpg http://hometown.aol.com/JSkunk/jpg/typeAttack02.jpg http://hometown.aol.com/JSkunk/jpg/typeAttack03.jpg no source, yet... but the game is here: http://briefcase.yahoo.com/jskunk@sbcglobal.net then in the game/TypeAttack.zip some info: I'm using fbx files(included in zip) for my models, skeletons, and animations. I still need to replace my temp cities with the real ones I finally just started on. Also there is some more art and sound effects to be added(over using the voice overs now as that is all I've added so far), as well as the type attack theme song(its good to have friends in a band). And I need to do some more work on the wpm counter ...Show All
SQL Server Xa transaction and MS DTC
Hi! I'm studying how xa transaction works and how NS DTC works. I'd like to have one more information about them. Windows documentation says about managing transactions, that "an XID corresponding to a OLE Transaction has the formatID field set to 0x00445443, the gtrid_length field set to 16, and a the first 16 bytes of the data field set to the UOW" So, if XA transaction uses XID with the following structure: struct xid_t { long formatID; /* format identifier */ long gtrid_length; /* value not to exceed 64 */ long bqual_length; /* value not to exceed 64 */ char data[128]; } it means that the branch id (bqual) is not used. Is it true or is there the possibility to set it What happens if the XID is set by user Is it trun ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Global profile settings
I was playing around with the RocketCommander game and immediately realized I needed the Y axis inverted. Is there any way to read the profile global settings from XNA If not, I suppose each XNA game will need to duplicate these settings. The profile settings aren't currently exposed in XNA. Please file a suggestion over on the Connect site if you think this feature would be important to have in future versions. ...Show All
Visual C++ (MSVCRT) _iob disappeared?
What can I do to replace the functionality of _iob Seems to be missing in MSVCR7/8 (using VS2005). To resolve the issue, I made stubs in my main code: ... void _acmdln( ) { } void __pioinfo( ) { } void __badioinfo( ) { } ... The compiler still went through the .def and properly linked my exports to their real outside counterparts. Go figure! ...Show All
SQL Server how do i?
hi, i want to know how to do that: table: costtypes fields : typecode values: amount, vat, duty, table bills: fields: billid, costtype, amount value bi1 amount 1000 bi1 vat 10 bi2 amount 200 i need to create a view that will display amount, vat, duty as fields. note that these are values in the table. so that i will have billid amount vat duty bi1 ...Show All
Visual Studio Team System Unit Testing the new Database Unit Test Code
We're working through creating our own unit test for comparing multiple result sets. I got sick of running the gacutil after every edit & build so I decided to create a unit test to test the code. HELP! I've figured out that I need to call my test through something like this: MyTest mTest = new MyTest(); Sqlconnection mcon = new SqlConnection("connectstring"); mcon.Open(); DatabaseTestAction ta = new DatabaseTestAction(); ta.SqlScript = "EXEC spr_SomeQuery 'value'" ConnectionContext scriptcon = new ConnectionContext(); scriptcon.Connection = mcon; MyTest.Assert(mcon, ts.Execute(scriptcon,scriptcon,ta,xparams)); But I get the error "The provider factory cannot be null" I'm clearly mi ...Show All
SQL Server SSIS to SAP Integration
Hi All I am new to SSIS and my first task is to find out if there are any good third party/strongly recommended connectors out there to connect to SAP. Our goal is to get information from SAP using SSIS and run transformations on source data Thanks I would strongly recommend that you check out this tools: http://www.theobald-software.com/IS_EN/index.php If you do want to extract or import data these tools would be fine - if you want a kind of "real" interopability and a process orientation you should consider if SSIS is the right tool to use or if it would be better to use BizTalk. For a better understanding which tool you should use in which case this link should h ...Show All
