ShortBus's Q&A profile
Visual Basic Dynamic Variable Assignment
I am looking for a way to simplify my code and to make it more extendable for the future Right now I have a function that takes in an object and a string as an argument and, for all intents and purposes, returns a reference to an instance variable of that object, what I have is a large bunch of if-elseif statements that is very bulky and limiting: If str = "Temperature" Then Return myObj.Temperature ElseIf str= "Pressure" Then Return myObj.Pressure ... End If If in the future more instance variables are added this function will also grow, and it is already pretty bulky as is. Also I dont like har ...Show All
Visual Studio 2008 (Pre-release) setting mouse position relative to screen or controls?
How is this possible I've seen only a GetPosition function, but there's no SetPosition function or Position property for the mouse. I think it's a really basic thing, isn't this supported by Avalon (I wouldn't like to think so). I believe p/invoke is the only way. Moving the user's mouse is generally frowned upon from a usability point of view. HTH, Drew ...Show All
Visual C++ need good string object reccomentdation
been using MFC's CString for years. it works great but need something more portable for big new project. seems std::string too clunky. what is a modern powerful string obj with much formatting caps does boost have something that doesn't require downloading the world to use thanks al I would say: Stcuk on CString. The newer versions in VS2003/2005 are templated versions and are capable to be used stand alone withoutthe MFC kernel. I still love them and they are protable... :-) ...Show All
Visual C++ Problem running program in release mode. Please help.
Project was created using old beta version of VS2005. Everything work fine using April CTP Team Suite. After upgrading to August CTP Team Suite, program runs fine under win2K (both debug & release). But under winXP, only debug version runs, while release version gives errors and exits. Below are the messages that I got in the output window. The program exits even before going inside Main() function. I tried to create a dummy winform project in August CTP and both (debug & release) versions run fine under the XP machine. Does anyone have any ideas what went wrong any suggestions on how to debug this prob ...Show All
Visual Studio 2008 (Pre-release) PDC COM312 Federation demo source code needed
Does anybody would have the source code for the PDC presentation (COM312) presented by Martin Gudgin (Gudge) I would like to see the source code of the STS Service that was used for the Federation sample. We can see clearly in this demo that the STS client credential type was set to Certificate. This is exactly what i need to do and i would like to see what the STS looks like because i have not been able to make the STS from the SDK's Federation sample working with other client credential types than the default (Windows). It always end up with the same error (See my prevous post about that " Service Constructors: How do they work &q ...Show All
SQL Server Aritmectic Operator in Formula?
Hi all, this formula doesn't work as calculated column but WHY Column [MAIN]: VARCHAR(150) VALUE : 'blabla - zobzob' SUBSTRING([MAIN],1,CHARINDEX('-',[MAIN])) WORKS and return 'blabla -' BUT SUBSTRING([MAIN],1,CHARINDEX('-',[MAIN])-2) DOESN'T WORK in a Formula BUT well in a select clause... Any Idea Thanks In what way does it 'not work'... It seems to work ok... (SQL Server 2000) create table #x (main varchar(20) not null) insert #x select 'blabla - zobzob' alter table #x add b as SUBSTRING(MAIN,1,CHARINDEX('-',MAIN)-2) select * from #x drop table #x main ...Show All
Visual C# web user control and its files
I'm creating a web user control (file ascx,ascx.cs e ascx.resx) which is connected to a DB (i have other 2 classes and so 2 other files). 1.Is it correct or is it better to have only one file with all the classes 2.When I use my web user control, have i to copy all the files i used, true THX No, you should put them in 1 project so they will be stored in one DLL. Then you can use then in every project you want by only adding the DLL to the reference of the project. ...Show All
Visual C++ Where's my VC++ 6.0 keyboard layout (Beta 2) ?
Maybe I'm just not looking at the right place, but I can't find a way to go back to my old VC++ user shortcuts. Old habits die hard ;-) The only options I have are: - Brief - Emacs - VC++ 2 - VS 6 (not VC++ 6) Is the support for VC++ 6.0 shortcuts gone in Beta 2 If you are using the "C++ Developer" profile, you can select "Default" and this essentially is the same as selecting "VC6" since VC6 is now our default. If you are not using the "C++ Developer" profile, then you'll need to go through the "Import Settings" dialog, which, admittedly, is not an ideal experience. Thanks, Tarek ...Show All
SQL Server T Cannot connect to MSSAS 2005 Standard on local machine
I have installed SQL2005 completely, including Service Pack 1. Using Mgt Studio, I can connect to the relational db. I am not able to connect to analysis services though! The error message I receive is :"A connection cannot be made. Ensure that the server is running. (Microsoft.AnalysisServices.AdomdClient". The additional information says: "Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.(System)." The service is certainly running (I see this in the Mgt Studio). I am able to connect to the service on another machine. However, once I try to browse a cu ...Show All
Windows Forms Centering Controls Vertically at Runtime
Hi everyone, I have user control lets call it A. I mad trying to make a collection of this control called ACollection, deriving from UserControl class. I am providing two methods Add and Remove that would allow adding or removing controls of type A. Thus basically ACollection acts like a container control. I would like to add controls A so that that ce ...Show All
Visual Studio Express Editions atlbase.h
While trying to convert com projects from VC6.0, I get: LINK : fatal error LNK1104: cannot open file 'atlthunk.lib' This is from atlbase.h . There is no way I can just comment out the #include for that, as some lucky programmer here said he did. It causes many projects to err out. Is there any way to get around this linkage error something like "#pragma error disable: 1104)" (wild stab in the dark here) Note that atlthunk.lib was not on my vc6 system, and apparently on anyone elses either. Short of modifying atlbase.h, I don't know what to do, unless maybe create a dummy lib and rename it and stick it in the lib sear ...Show All
Visual C# How to save html file and respective dependent files in server
Hi All Currently iam working with web application using C# ,my requirement is need to save a html file ,whenever saving a file the related image files should save in a folder Ex: When you click http://aspalliance.com/150 in URL when we use save as we can save it as HTML file and the related images are saved in related folder I need to implement the same concept Could any one please guide me Thanks a lot Probably you can using regular expression to find any external links (aka <img src="" /> etc) in the targeting html file, and then save those files pointed by those links, and then save the html text fil ...Show All
Visual Studio Visual Studio MSDN Help Is Rubbish
I realise that Micro$oft reject the adage "If it ain't broke, don't fix it", but did they really have to change MSDN help in quite such an appalling fashion Does anyone have a way for me to access the VS2005 information without having to use Document Explorer Chris / Neophyte -- Our intent was certainly not to make you hate the help system; at least we didn't add Clippy :) From your posts, I'm not clear on what you dislike about the Visual Studio 2005 help. Changes to Document Explorer features That Help defaults to using Document Explorer rather than the internal-to-the-IDE help viewer MSDN O ...Show All
Visual Studio Team System uploading Agile templates in italian to en english TFS
Just after the launch of the TFS localized version I am trying to extract the Agile process template from the italian version to upload to the english TFS version. Both are workgroup edition. The TFS installation is a single server. I did the following : 1. I download and installed the Microsoft Windows SharePoint Services 2.0 Language Template Pack for the italian language so to support site template with language code 1041 2. From the italian TFS iso file i extracted the file MsAgile_new.zip. 3. Extracted the zip file in a folder 4. Changed the Name inside ProcessTemplate.xml 5. From VS2005 started the Process Template Manager and uplo ...Show All
Software Development for Windows Vista Multiple conditions for a signle rule
I'm working with the External Ruleset Example (great sample!) and the Ruleset Editor. The Ruleset sample executes rules I create using the Ruleset Editor except when a rule has multiple conditions. For example, I have a rule that's something like this: Condition: this.Color.isGreen && this.Shape.isRound && this.is3DObject Action: this.Helper.AddItem("This is a green ball") The problem is that the action fires when any of the three boolean "is" properties are true. Using the && operator, I want the Action to fire when all of the properties are true. I tried the following: * Converted the && operators ...Show All
