bpsmith's Q&A profile
Visual C++ C++/CLI C++ Interop and FxCop/Code-Analysis warning CA2122
I've purposely been ignoring a CA2122 warning in some C++ interop code I've been working on for quite some time. I've just recently had the cycles to investigate the warning The warning message is as follows Warning CA2122 : Microsoft.Security : MyClass.Method():Void calls into Marshal.GetExceptionPointers():IntPtr which has a LinkDemand. By making this call, Marshal.GetExceptionPointers():IntPtr is indirectly exposed to user code. Review the following call stack that might expose a way to circumvent security protection: ->System.Runtime.InteropServices.Marshal.GetExceptionPointers : IntPtr ->MyClass.Method : Void ... MyClass is a managed class where Method calls a native static (for readable illustration purp ...Show All
Visual Studio 2008 (Pre-release) WCF: IIS7, HTTP, Basic Authentication & Membership
Hi, I'm trying to use WCF with HTTP binding and Basic Authentication using IIS7/WAS. It works when authenticate using Windows accounts, however it return 401 when using ASP.Net Membership. Note: I do not want to use HTTPS since the HTTPS is terminated in a router in front of my web server. Here is my WCF binding configuration: < basicHttpBinding > < binding name = " HttpBinding " > < security mode = " TransportCredentialOnly " > < transport clientCredentialType = " Basic " /> </ security > </ binding > When I'm using the standard IIS7 Basic Authentication handler everything work fine. However, I want to authenticate against username cr ...Show All
SQL Server no luck w/ execute sql task and assigning variable
Hello, I've asked this question before and I've read the answers before and I still cannot get it to work. My task is simple, I want to use the execute sql task container to grab a value from a database and put it in a variable. I've done all the preliminary stuff such as running profiler to make sure that the package is getting the call to the database, setting up the ResultSet to be "single row" in the general tab, mapped the Result Set correctly, but nothing works. I get the same error every time. This is my sql command: select output_location as output_location from script_master Result Set is set up like this: Result Name: output_location ; Variable Name: User::output_location Here is the error I get: ...Show All
.NET Development How to update an element's value?
I am building an xml file in SQL Server 2005 (SSIS). The problem is that one of the first element that is written I won't know the value until I have processed all of the records. So I was wondering if there is a way to open up the file that was generated and update the element named "DeclaredValue" Thanks. If you want to edit an XML document then with .NET DOM/System.Xml.XmlDocument is a tool to do that e.g. XmlDocument xmlDocument = new XmlDocument(); xmlDocument.Load(@"file.xml"); XmlElement declaredValue = xmlDocument.SelectSingleNode(@"//DeclaredValue") as XmlElement; if (declaredValue != null) { declaredValue.InnerText = "new content"; } ...Show All
Windows Live Developer Forums predownload whole tilesets on a PDA
I'm running virtual earth on a PDA, but only have GPRS access. I'd therefore like to download the whole of my local city in hybrid (aerial and roads) mode whilst connected to my PC, such that it will be available in future for offline browsing on the PDA. Is this possible Unfortunately that would be a violation of the terms and agreements. In terms of mobile access your better off using the Mappoint Web Service which serves static maps which is much quicker / suitable for mobile use. Also since you just want to display it for personal use you can use a MWS developer (trial) account to do the work for you (you would be stuck with the staging watermark on your MWS maps however) ...Show All
Smart Device Development Which Platform?
I have written an application using VS 2005, and installed it on a pda(s) running Windows Mobile 5.0. Now, what I want to do now, is to load the same application on to a Windows CE 5.0 environmnet as well. Looking at it, it should work The main question I have is that once loaded on either enviroment, I need to know which one the application is running. If the application is running on WM 5.0 follow a set up route of say a) or if it is CE 5.0 then do b). Not too much differnce to be honest, but I was wondering if there was some system variable that I could look at, which would indicate the environment - WM 5.0 or CE 5.0 Ok, I've just about everything I can think of, and I always get an 'unhandled exception error ...Show All
Visual C# C# Threads
Hi, I have a problem with thread and i'm hoping someone can help me. I start a thread with the following code... Thread m_NewThread = new Thread(new ThreadStart(DoWork)); m_NewThread.Start(); The threaad starts find and executes the code within DoWork, for example: private void DoWork() { ... //Finished work so show thread finished ThreadFinished(); } Again it executes the code within ThreadFinished, for example: private void ThreadFinished() { .... //Thread has finished so show finish form and close frmFinished f = new frmFinished(); f.Show(); this.Close(); } Now this is where it goes wrong. Stepping through this code it show's the finished form as you can see it in the taskbar b ...Show All
.NET Development Performance question with DataReader
The list Add method takes two strings. Are there any performance advantages between the two lines within the while loop. Positions 0 an 1 are both Int32s. using ( IDataReader dr = db.ExecuteReader(cmd)) { while (dr.Read()) { list.Add(dr.GetInt32(0).ToString(), dr.GetInt32(1).ToString()); list.Add(dr.GetString(0), dr.GetString(1)); } } Thank you, Todd hi, I think you save one cast (box/unbox)in that operation. Initially you get an integer from an object and then you get the string representation for that object. In the second operation you get a string from an object, so you dont need the last step. Best Regards ...Show All
Visual C++ Memory leaks created by the compiler/ run-time system
I have spent nearly two weeks trying to find some memory leaks in a program I am developing. Initially I thought it had something to do with PlaySound (see previous post, 30 Jan 2007) but that was not so. I have now discovered some hidden memory leaks in C++ which I am happy to share with others. (Please note I am using Version 6.0. It’s possible these problems have been fixed in later versions.) The following code: CSize test = pDC->GetTextExtent(“ABCDEFG”); creates a memory leak. I thought that all memory allocated within a function (when not using ‘new’) would be deallocated at the exit, but this is not so. My best guess is this. GetTextExtent has two forms and the form used above needs a CString par ...Show All
SQL Server Business Intelligence on ROLAP
Hi all, I am inquiring whether I can have some business Intelligence on Relational DBMS in SQL 2005 as projecting the number of patients within a health care basing on the available data. Please help me out. Regards, Ronnie I have one mining structure using Microsoft Decision Tress that I have created basing on the tutorial of Adventure Works DW. How can be able to incorporate this mining structure with ASP.NET 2.0 so as my project can be intelligenct or so that my GUI that users use there are to project or get meaningful information through the data in the database basing on my mining model. Thanx ...Show All
Visual Basic Problem in using Try/Catch/Finally
A textbox(T_TextBox) is bound to a float-type number in a database. The innitial value of the textbox is from that column of the database. I used these codes in my program: Dim T as Double Try T = Double.Parse(T_TextBox.text) Catch MsgBox("Please enter a number for T.") Finally End Try The problem is: every time before I run the program, a message box saying "Please enter a number of T." shows up. This problem only happens at the very beggining. When I change the text later (I select another number from the database, and this is done through a combobox), this message does NOT show up. Anyone knows how to get rid of the msgbox at the begging Thanks, Lili Thanks, Andre ...Show All
SQL Server Data alignment in Textbox
Hi All, I am working on a report, in this report a textbox is present, which is expected to show string. This string length is larger than what textbox can accommodate in single line. I want this textbox to show only right part of the string in case it can accommodate full string. After using the right alignment I assumed it would do show, however it does not work like that. It always shows the left part of string in case, string is bigger than width of textbox. Restriction from design: 1. Cannot increase the width of textbox. 2. Cannot use the Can Grow = true to show string in multiple lines. Below is the example of my issue: Say there is a string: "Microsoft SQL Server Reporting Services". because the textbox width is not suffi ...Show All
SQL Server Line Chart in RS - simple design question
I have a simply data file that I want to make a time-based line chart and I can't seem to get charts in RS to do it. The data file structure is as follows: (first line is column labels and each row is a case with three data points - one for each year) school 2003 2004 2005 SchA 100 122 133 SchB 121 145 115 SchC 98 112 120 I can't seem to get the right series, category, and data fields to get a very simple line chart for each school (one trend line for each school connecting the three data points all one the same chart). It's trivial in Excel and using pivot tables, but RS charts is not structured the same way. The fields in the SQL result set returned are School ...Show All
Software Development for Windows Vista complexity of finding UI elements with TreeWalker or FindFirst/FindAll in HTML
Hi, I was amazed to see that it takes plenty of time (~100-200ms) to for GetNextSibling (of TreeWalker) in HTML,so if i am going through 400 siblings it takes forever. it is also happens if i use element.FindAll. Does anyone know what can i do to avoid this. Thanks in advance It seems that it takes a long time just if there are many childrens. It happens with parent which is table with about 400 customcontrols There is an option that only this type of customcontrol has some provider that takes pleanty of time for GetNextSibling I will update when i have more info ...Show All
Software Development for Windows Vista How do i implement this workflow ?
Hi All, I am trying to make a simple workflow that has 4 parallel activities each getting input from different users (say it takes interger as it's input) and then adds the inputs (integer values). I was thinking of creating a custom activity that takes input from the user and run 4 instances of it parallely so i will get 4 different inputs and then at the end of the parallel activity i have a cusum activity that adds the 4 input. Is this the right approach. Do parallel activities end seperately and can't be merged into another activity Or if they could then in my case how do i send data from the parallel activities into the activity that does addition. Thanks, Sonali Using activity binding ...Show All
