terr's Q&A profile
Visual Studio Tools for Office Caller / Sender
Dears, I'm trying to retrieve the information of "calling cell" of a UDF in Excel, but I can't use, for example Application.Caller.Address, in C# code now. What's the equivalent code of Application.Caller (I tried Excel.Range r ca = (Excel.Range)Application.get_caller(1) in C# but it show an error that conversion of Int32 to Excel.Range failed) I want to get the original cell value & formula for a custom UDF in VSTO in the Worksheet_Calculate event handler. (Unlike Worksheet_Change, no Target nor reference to calling cell in Calculate handler base on my understanding) Thanks, You are correct ...Show All
Visual C++ Mixing C & C++: Linker / name-mangling problem
Hello, I am forced to mix C and C++ and ran into trouble compiling and linking the sources under Visual C++ 2005 Express Edition. I have provided a trivial example to illustrate the problem: The header file defines a struct type named MYSTRUCT, cpp-file.cpp declares a global variable of this type and c-file.c declares the same global externally and manipulates it in a function. The linker complains about an unresolved symbol "_variable" in c-file.obj . Obviously, C and C++ linkage apply different name-mangling schemes to the symbols. While this can be easily dealt with in function declarations, it obviously poses ...Show All
Visual Studio Team System Unshelving error
When I try to unshelve one of my shelvesets I get: "Error - No changes unshelved." Any ideas what might cause this First, if I wanted to update my older unshelved file set with what is currently checked into the repository without having to check the files in, how do I do that from VS >> Unshelve your changes, do a get (this will cause a merge), then reshelve your changes. From the pending checkins tool window (which is my current homebase for VCS) I didn't see a way to do that. I had to go to source control explorer to undo pending changes. It might be nice to be able to do that fr ...Show All
Visual Basic VB 2005 Ejecting removable media
I'm writing a program that reads and writes to MO drives and I need to be able to eject the MO disk on completion. Any suggestions how to do this within VB2005 would be most welcome. I assume it is that same process as with Zip drives and similar to that for CD/DVD drives. Thanks Here's a C# version so others may benefit as I got here from Google: Code Block using System.IO; using System.Runtime.InteropServices; using System.Threading; using System; public class DriveController { // 10 Seconds private const int LOCK_TIMEOUT = 10000; private const int LOCK_RETRIES = 20 ...Show All
.NET Development How to create XmlTextReader object for a string stored XML content? Many Thanks!
How to create XmlTextReader object for a string stored XML content Many Thanks! Normally, we create XmlTextReader object using a filename parameter, such as XmlTextReader my = new XmlTextReader(@"E:\Temp_WriteXMLToBookmark\1.xml"); but I have stored XML content into a string, how to create XmlTextReader object for the string stored XML content There is a stupid way, that is to save the string as a XML file first,then use XmlTextReader my = new XmlTextReader(@"E:\Temp_WriteXMLToBookmark\1.xml"); Could you give a good idea For what it is worth this what I did using framework 2.0: String strXML = "<root& ...Show All
SQL Server noob syntax question
What am I doing wrong : DELETE FROM tblmainacs2 WHERE tblmainacs2.IDnum = Meter.id I get this message: Msg 4104, Level 16, State 1, Line 1 The multi-part identifier "Meter.id" could not be bound. Is Meter a table If so you do contain an explicit reference to it in the DELETE statement in the FROM clause or part of subquery for example. You can write it like below assuming you want to perform a join: delete from tblmainacs2 where IDnum in (select id from Meter) ...Show All
Windows Forms Export to Excel
Hi, VB.NET Visual Studio I have a listbox, multiextended with client names list. I want to filter client names with selectioned items in this listbox and export data to excel. The following code return only one client: ¿How I can to get result with multiple selection Private Sub createPage() 'Declarations Dim ExcelAp& ...Show All
Visual C# Cannot focus my own window
Hi, I have written a C# dialogue application that runs other programmes (via a COM interface) that bring themselves to the front. After they've finished and hidden again, my own window should be focused again, but it isn't. Even when I call Focus() or BringToFront() on the form, nothing happens. Any other window that's been there, too, will be focused in the end. Doesn't Focus() work for windows How can I focus my window then Running Windows XP SP2, .NET 1.1, VS 2003. TIA Normally this should work, but if a dialog is focussed in the application you can't force the focus. Wish form has the focus w ...Show All
Visual C# Convert Perl Code to C#
I have a perl script which I wanted to convert to C# which I can use for my application. Is there any tool/utility which does this. Thanks Imtiaz It's not too big. I am pasting it here. It reads a pipe delimeted file fetches some data and write it to another file. Following is the complete script eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_0-9]+=)(.*)/ && shift; $[ = 1; # set array base to 1 $, = ' '; &nb ...Show All
Visual Studio VS2005 + MyProject\licenses.licx Auto Checkout.
Guys, Why is the VS2005 IDE contantly editing the Licenses.licx file when you go to open any form with user controls. All our solution use an exensive set of user controls on all forms. We have a base form which is inherited for all other forms in a project. (you know, stuff like control validation, gradient panels, custom lables, bla bla bla) When one developer wants to checkout and work on one form, they lock all the other users from editing any other form, because source control checks out the licenses.licx file exclusively to that user. This is pure madness. Most of the time you just wan ...Show All
Visual Studio Team System Team Projects and Product Releases
I interested in how people are handling releases in relation the team project. In other word, how do you handling moving from 1.0 to 1.1 or 2.0. The way I see it there are a few ways of handling this: 1. Keep everything in the same project. This seems like it would be a good idea as you would maintain a complete work item history thought the life of a product. But do we really want to Sure, 1.0 issues that are unresolved are good to know during 2.0, but what about 10.2 Seems to me like this could clutter up really fast. Of course the is the problem of what do to about work items you want to push to 2.0's timeframe even though you're ...Show All
.NET Development programmatic access to sqldatasource dataset
i'd like to take advantage of all the benefits of the new sqldatasource control to do quick queries & bindings, but also retain the flexibility of the previous ways of data access (i.e. sqlcommands/sqldataadapters) to fill datasets. is there a way to have programmatic access to the dataset that is filled after a sqldatasource queries a db i dont want to display all the columns queried in my gridview, but i want that data available for further manipulation without having to run another query. am i going about this the wrong way, or have i just not stumbled upon the solution thanks, david nope, no l ...Show All
Visual FoxPro sdtFont object
I need to create a stdFont object. Once at one computer I was able to do it in the command window" X = CREATEOBJECT ("stdFont"). Once I put a period behind "X." the IntelliSense menu appeared and gave me a list of properties. When I tried to use it in a method I got an error message that the " class definition STDFONT was not found ." At another machine I cannot get it to work even in the command window. Which library shall I install to make it available Thanks. Hi Alex Well, whatever it is I have it - but confess I don't know what it is for. The code you posted ( X = CREATEOBJECT ("stdFont ...Show All
Visual Studio 2008 (Pre-release) How to detect( at host side) a client is connected or not
Hi, In a specific requirement I want to I want to detect(at host side) whether a clients is connected or not to the WCF service. I am using NetTcpBinding (without RM). I also want to know the client IP address at service side. Is their any inbuilt functionality in WCF with NetTcpBinding Thanks, Dileep Agarwal Dileep, Why dont you give me a call when you have a chance. It has been a while since you and I spoke. (Washington DC - American University Days) Best, Reggie 864.580.8590 ...Show All
Visual Studio 2008 (Pre-release) Request End Event??
Hi, Is there anyway to be notified when a request (i.e. invocation of web service) ends In my example, I need to make sure that database sessions are closed when the request ends. Thanks, Scott. Thanks for the replies. I ended up solving this using an IDispatchMessageInspector. Here's some sample code in VB.Net. // // Adds Behavior to the Dispatcher to ensure that all // Database connections are cleaned-up after each method call // private void AddChannelBehaviour( ServiceHost serviceHost) { foreach ( ChannelDispatcherBase cdb in serviceHost.ChannelD ...Show All
