cngzhnmrl's Q&A profile
Visual C++ I met a weird thing when using fwrite() and fputc()
I am using VS 2005. In a project when I was trying to write some unsigned char into a file, I used fwrite() and fputc(). But I found whenever I tried to write 0x0a, fwrite() function automaticly wrote 0x0d before 0x0a. So I wrote a small test to test it. Here is it: FILE* file; unsigned char p = 0x0a; long offset = ftell(file); // here the offset = 0; fwrite(*p,1,1,file); offset = ftell(file); // after this, the offset = 2. and in the file I // found 0x0d and 0x0a was written. I can't understand. I just want to write byte by byte, automatically inserted byte 0x0d will cause problems in my project. can someone tell me what is the cause and how to avoid the unwanted byte ...Show All
Visual Studio 2008 (Pre-release) Do we have a master page function like ASP.NET 2.0 in WPF?
Do we have a master page function like ASP.NET 2.0 in WPF Chester ...Show All
Game Technologies: DirectX, XNA, XACT, etc. XNA templates not showing up
I can't get any of the XNA features to show up inside Visual C# Express. I read through the XNA FAQ and tried: Running Visual C# at least once before installing XNA Game Studio Uninstalling XNA Game Studio and making sure Visual C# isn't running when re-installing XNA Making sure my Visual C# Express is registered before installing XNA. None of it helps, I'm missing all of the Windows Game templates, and XBox 360 templates. Any ideas Are you using Vista That happens if you install XNA GSE incorrectly on vista. You may want to check out this link: http://letskilldave.com/archive/2007/02/08/Getting-XNA-Game-Studio-Express-to-run-in-Windows-Vista.aspx ...Show All
Visual Basic Place Points in audio.video files
My multimedia teacher has asked us to find a term that means "to place points in the audio/video file" this term has the same number of letters as the word "redact" nobugz wrote: On the other hand, they might be elated about a "not business as usual" kinda question like this... You've got to be kidding me. Look at the other threads that get marked/locked and tell me how this one differs... facinating or not, this isn't the right place for it. Even if you don't lock it, at the very least it must be marked OTP... This has absolutely nothing to do with VB or programing and will just end up as more garbage for people searching for legit help in coding around AV files to wade through. -EDI ...Show All
SQL Server sp_xml_preparedocument VS nodes()
I am considering converting a stored proc which uses sp_xml_preparedocument to a select using the node() syntax. I made two sql scripts, one of each method with identical input xml and ran a query plan on each of them. To my surprise, the Sp_xml_preparedocument seemed to produce the better query plan. The Estimated subtree cost for sp_xml... was 3.36433 for 10000 rows and the estimated subtree cost for nodes() was 421.126 for 60 rows. Am I missing something or is sp_xml_preparedocument still the best method to shred an xml document sp_xml code: DECLARE @idoc INT , @trans_id int , @after_doc xml , @record_type int , @sm_session_id nvarchar ( 50 ), @trigger_start_time datetime , @user_id int , @fo ...Show All
Commerce Server Server Error in '/OrdersWebService' Application.
We are receiving the following error when trying to browse to ./orderswebservice/orderswebservice.asmx. Any thoughts as to what can be the issue ------------------------------ Server Error in '/OrdersWebService' Application. Howard, Open up Commerce Server Manager and expand the Commerce Sites node corresponding to the site you've unpacked and make sure you've unpacked the profiles resource (look under site resources, and there should be a profiles resource referencing a global resource. If what I've just described doesn't match what's on your screen, you need to unpackage these resources again from the PUP file. ...Show All
Visual Basic Text File Search Duplicate Lines
Hi, I'm looking to search through a fixed width Text file line by line and return lines that have duplicate values in at a certain location(position 10-19). For example: 990500024001385713 990500024001388061 990500024001388061 990500024001388694 The first 9 characters are always the same, but the next 9 characters can contain the duplicate values. In this example I want to write the middle 2 lines to another file called "C:\duplicates.txt". The file to be searched called "C:\MainFile.txt" is about 95,000 lines. Any sugguestion would be great!!! YES, YES YES, Nog. I often use dictionaries for dup detection. Using DDD (Dictionary Dup Detection) you could for the above routine in about seven lines of code ...Show All
Visual Studio Team System Load test – Turning threshold Settings to off
I ran a smoke load test as per your walkthrough in the help section. Even though the tests passed, there were several threshold violations and errors. Most of the errors were related to the threshold violation. I read in one of the professional books on VSTS, that there is an option in VS to turn the setting to off, so that these threshold violation messages wont appear. They did not mention how to do it. I could not figure it out in Visual Studio. Kindly advice. 2162 The two default threshold rules are associated with the counter definition in the Load test. To remove the rule associated with counter "Avg. Connection Wait Time" ...Show All
Visual Studio addin auto upgrade?
Hello, there. I am facing a problem related to addin upgrade. I developed an addin and distribute it to my customer, all works well. Now I add some new features to my addin, I know I can distribute it to my customer to finish upgrade by providing setup program. But I don't want to adopt this way. I want to know whether VS2005 extensibility provides such interface that I can program it to help completing update issue. For example, I can place my upgraded addin on my site, whenever my customer opens vs2005 IDE, it will automatically check if higher version exists by connecting to my site, if existing, it will download higher version and complete upgrade Thanks Rigards, wang AFAIK, there is no support for autoupgrading in ...Show All
Visual Studio Team System MSF Template - Risk WIT has a validation error
Hi, I am getting an error when trying to save a Risk WIT in a MSF CMMI and AGILE team project. There is no other information I have about this error other than what is recorded in the trace log: [WI] [Error, 3328, 1, 13:19:31.622] SvrEx: Microsoft.TeamFoundation.WorkItemTracking.Server.ValidationException: Forcing rollback ---> System.Data.SqlClient.SqlException: Forcing rollback at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior ...Show All
.NET Development manipulating PDF file
i am developing an application, which will store PDF files in the database in binary format.. the problem is that the links within the file must be preserved and once the PDF is retrieve from the database the link should still works properly and shows the page the link is pointing to.. is there any way you can get all the links the PDF have is that so..do you mean that when i store a pdf in the database if i try to browse it and click on the link still it would bring me to the pointed link Another question how does the link in the PDF goes Is it in a relative path format What if you have to browse the file from the database and not from the file system How does the PDF links works in that scenario For example: You have a PDF ...Show All
Windows Forms Problem with inherits form
I am trying to modify my existing form to use a new base form. In my new base form, I have added the following property. <DefaultValue(False)> _ Public Property TrainingMode() As Boolean Get Return Me.trainingLabel.Visible End Get Set(ByVal value As Boolean) Me.trainingLabel.Visible = value End Set End Property I use the trainingLabel visibility to indicate whether my system is in training mode. In the base form designer view, I have set the trainingLabel.visible to false. The problem is those inherited form based on the previous base form will change the TrainingMode to true automatically after I rebuilt the base form. I don't know how to debug this problem. As all this happened during the design ti ...Show All
Visual Studio 2008 (Pre-release) Memory Leak problem when using bitmap image as tooltip?
My code: Image img = new Image(); BitmapImage bi = new BitmapImage(); bi.BeginInit(); bi.UriSource = new Uri(@"C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Water lilies.jpg"); bi.EndInit(); img.Source = bi; btn1.ToolTip = img; //btn1 is a Button Symptom: Every time when the tooltip of "btn1" shows, some memory is consumed and will not be released later. So, is it the problem of my code or the winfx Thanks a lot. I don't think that's a WinFX problem. I believe that, as long as the btn1 element exists, its property value (in this case, the bitmap image) is stored in memory. So, if you really want it gone, set btn1.too ...Show All
Visual Studio Team System TFS's answer for ClearCase Components
Hi all, Were using ClearCase and want to migrate to TFS. We are using Components & Composite-Baselines in CC and I wanted to know what's the alternative in TFS How it is done We have one project which is a framework and 2 seperate projects built on this framework, called A & B. The framework, A & B are developed by 3 seperate teams. We want to deploy A with a specific version of the framework and B with another version of the framework. Do we have to put these 3 projects under the same Team Project, each under a different dir in the source-control and use a lot of branches :-( thnx Hello, There are a few alternatives for using components in TFS - the question to dete ...Show All
Visual Basic Datetime Empty
Hello. A question please. By default a DateTimePicker shows the current day and time. Is there a way to clear this and show this control empty Thanks... By default no... you could always implement your own user control that hides a contained DateTimePicker until a value is set. The reason for this lack of a more... null/default state is that the DateTime class is a value type and thus cannot be null (ignoring for the moment nullable values that were introduced in 2.0) and then you end up with the undesirable position of possibly having to define a symbolic date whose value means null but still accidentally usable. You also may try an extended DataTimePicker control like this one that may do some ...Show All
