Bystrik's Q&A profile
.NET Development Bizarre .NET performance benchmarks
While attempting to achieve a maximum performance in .NET code I have stumbled on a very peculiar effect. If you compile and run the following C# code, you get a better performance in Debug configuration than in Release configuration. Moreover, if you comment out any one of the unused (!) case blocks in the Distance method, you get 5-fold !! increase in the performance in the Release configuration. I would appreciate any explanation that anyone can offer. And it would be great to hear comments from the .NET development them if they are following this forum. Thanks, Victor P.S. I am using VS 2005 and Framework v 2.0.50727.42 using System; using System.Text; using System.IO; using System.Diagnostics; names ...Show All
Silverlight (formerly WPF/E) Creating controls without XAML?
I assume this might be coming in a later release, but it seems like an unecessary restriction to be required to create controls using XAML (i.e. CreateFromXaml). A method that just takes a typename and a namespace might just be more natural for programming against: function Create(tagName[, namespaceUri]); The nameSpaceUri param is optional and defaults to XAML's v1 namespace when not specified. This way I don't have to think in XAML so much and can just think about creating my instance by type and go off an set the properties using JavaScript. Just thinking out loud, Drew Thanks for the feedback, Drew. We may be adding the functionality you describe in the future... we tackled "createFro ...Show All
Visual Studio Tools for Office Document level customization slow loading time
Hi We are facing serious performance issues with document level addins for Office 2003 and VSTO2005. It take very long time for word to START loading the customization assembly (in some cases, even up to 2 minutes) I have been reading some posts on the subject and we have been following MSDN best practices and recommendations as close as possible. Especially followed this useful link: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=290423&SiteID=1 and that is where I learned about the "PIA certificate trick". Still, even after implementing this, I still see the same behavior. Feeling in a deadlock at the moment since I am running out of fresh ideas – any help wil ...Show All
Visual C++ How to close a file safely no matter whether the file is closed or not?
How to close a file safely no matter whether the file is closed or not I hope that some expert can give me some sample for this small problem. Thanks. Folks on the newsgroups at http://msdn.microsoft.com/newsgroups should be more familiar with such issues. OTP Thanks, Ayman Shoukry VC++ Team ...Show All
Visual C++ Mixed mode C++/CLI idiom
In my C++/CLI components, for each component I create a ref CLR class and a C++ class, the latter which does most of the internal processing and interfaces to the C++ standard library and 3rd party libraries such as Boost. I do this so I can use C++ libraries in my CLR component, especially when the .Net framework does not offer all the facilities which 3rd party C++ libraries have. In order to allow the C++ class to access the properties, methods, and events of the corresponding CLR class I have a pointer to the C++ class as a private member of my CLR class and dynamically create an object of the C++ class, passing a pointer ( ^ ) to the CLR object to the constructor of the C++ class, and assign the resulting C++ object to the pointer in ...Show All
Visual Studio How Can I create a multiproject Template?
VS 2005 made adding project/item template very easy however if want to create a multiproject template than you stuck. Well taking into account my knowledge in the matter(little) i am stuck. Is there a walkthrough how to create a multiproject template How a tutorial on how to extend it Thanks a lot I have the same problem. It would appear as if teh VS.Net 2005 team have done a great job with the new Template and Code Snippet mechanisms, but then gone an dover complicated everything (ideal hands). Using .zip files, caches, binary cache.bin files. Were did keep it simple and stupid go. Given templates exist to allow reuse of code and improve productivity, why is it so hard to reuse t ...Show All
Visual Studio Express Editions Save layout
Hello! How can i save my layout in Form1 I am using VB 2005 Express. Form1 contains about 150 TextBoxes, 50 Labels and 1 Rich TextBox. I want to save the layout as a Word document with Boderstyle around TextBoxes and Labels. Does anyone have a code example Can't get it to work! Grateful for any help. OK, the following thread will determine how to save the form to a jpg file - which would be step 1 http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=434448&SiteID=1 The second step would be to create a word document with this image http://msdn2.microsoft.com/en-us/library/78whx7s6.aspx Contains all the code you need for automating creating word documents and a ...Show All
Visual C++ converting address to string
How can I veiw the address of a location, that is to say how can I convert an adress to a string or some other type Just as a side note you can have a look at some (not so intuitive, but handy) code of mine at http://einaros.blogspot.com/2006/11/put-hex-on-that-dump.html . ...Show All
.NET Development What Privilege Do I Need for Low-Priv Server to Listen on Port?
I am trying to follow Keith Brown's recommendations in his book "The .NET Devloper's Guide to Security". I have created a server app using HttpListener. The server app runs fine when logged in as Administrator, but when I created a user account and assigned to the Users Group I get an "Access Denied" on the listener.Start() method. I am not sure how to determine what level of security I need to perform this operation. Thanks M.D.A M.D.A wrote: I do not have a MSDN license at this time. I'll post the question to microsoft.public.donet.framework ... ...Show All
Visual Studio Express Editions Save RadioButton Settings "vb Express"
hi how can i save settings of RadioButton For example: If i have 3 RadioButtons, when i'm select one of them, in the next time when I run my application, the checked RadioButton must be the same that was checked at the last time. Thanks I have something like this, but I use this method: I put this on load RadioButton1.Checked = My .Settings.Setting1 RadioButton2.Checked = My .Settings.Setting2 RadioButton3.Checked = My .Settings.Setting3 then I put these on form closing: My .Settings.Setting1 = RadioButton1.Checked My .Settings.Setting2 = RadioButton2.Checked My .Settings.Setting2 = RadioButton3.Checked It's shorter. ...Show All
SQL Server passing varibales as SP input inside a cursor
Hi dear, I want to assign the variable @myVar an input to my stored procedure parameter @myParam. But I want to do that my cursor code: declare @myVar as.. fetch next from crsMyTblParams into @DBparam while @@fetch_status=0 begin EXEC sys.sp_helprotect @username=@myVar fetch next from crsMyTblParams into @DBparam end close crsMyTblParams deallocate crsMyTblParams But that gives me an error 2/ another question pls: how can I use use @myDB for a varibale like this: declare @myDB ...cursor code use @myDB ...rest of cursor code ...end of cursor code Is that possible , thank you The error i m still facing is this: There are no matching rows on which to report . That happens when the ...Show All
Visual Studio Express Editions Installer Help.
I know this is probably a tough question, but, can anybody give me an example of an installer built from scratch in Visual Basic 2005 Express VB Express provides only the click once way of deploying your application - it doesnt provide any projects to build windows installer applications. For an example of how to publish an application using click once http://www.dnrtv.com/default.aspx showID=8 Its really very simple. ...Show All
Visual C++ About DLLs adres space(wrong information in MSDN?)
Hi Please look at this MSDN page http://msdn2.microsoft.com/en-us/library/d1587c1h.aspx here it writes: "An application can have multiple instances of itself running in the system simultaneously, whereas a DLL can have only one instance." But here http://www.windowsitlibrary.com/Content/356/03/1.html#3 it writes: "Under Windows 95/98, the operating system DLLs, such as KERNEL32, USER32, and GDI32, reside in the shared address space, whereas in Windows NT these DLLs are loaded in the process’s private address space. Hence, under Windows 95/98, it is possible for one application to interfere with the working of another application." So in winnt systems a DLL can have multiple instances.Right If true so is MSDN information page wrong Which on ...Show All
Smart Device Development Loading an assembly in a new AppDomain
Hi all! Is there a way to load an assembly in a new AppDomain Thanks in advance, Marco Minerva, marco.minerva@tiscali.it http://blogs.ugidotnet.org/marcom You could use the AppDomain class, call CreateDomain to create a new app domain and then call ExecuteAssembly to run the new assembly in that domain. AppDomain also supports Load but not for the compact framework. ...Show All
Visual Studio 2008 (Pre-release) Schema Crawling Question
Hey there team, If I wanted to get the names of fields that comprise a key, what's the preferred way of doing that :) I've been crawling around in the MetadataWorkspace, and boy there's a lot there. Might be beneficial to have some sort of post that outlines the big concepts with this namespace... Thanks! Mike You need to look for the type in "CSpace", not in "OSpace" (of course, those terms are not supposed to surface in the API :), so you may need to tweak the function a bit in order to find the entity type. Pablo Castro ADO.NET Technical Lead Microsoft Corporation ...Show All
