MrBogomips's Q&A profile
.NET Development Please Help!!! Error:The RPC server is unavailable.
All, i am doing web application. i try to open word on local machine and display a document. user can choose to save the document to their local machine or not. note: i am creating the document based on user's option. an exception throws when my application is processing the following code: WordApp = new Word. ApplicationClass (); for ( int i = 1; i <= WordApp. ActiveDocument .Bookmarks.Count; i++) { } the WordApp. ActiveDocument throws an exception: System.Runtime.InteropServices.COMException: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) i checked Control panel, the RPC is running on my local machine. do you know what is going on If i use WordApp. ActiveDocument, does it mean ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Bug with SpriteBatch.Draw scale?
I'm working on a particle system. While experimenting, I created some scale and rotation tests to make sure the particle system is working as expected. For these tests, I am using both positive and negative values for both the scale and rotation factors. With rotation, a positive value rotates the sprite clockwise and a negative value rotates the sprite counterclockwise. That's fine. I then tried scaling. When I increased the scale factor, the sprite enlarged as expected. However, when I decreased the scale factor, the sprite shrank but ONLY WHILE THE SCALE FACTOR WAS POSITIVE. As soon as the scale factor became negative, the sprite began to enlarge again! In mathematical terms, it appears the sprite is using the Absolute Value of th ...Show All
SQL Server inner join one varchar(50)
Hello, I am doing inner join one varchar(50) fields, although I am sure the same data is available on both T1 and T2 but I am not getting anything with this inner join. SELECT * FROM T1 INNER JOIN T2 ON T1.FirstLastName = T2.FirstLastName What might the problem be In SQL 2000, leading space will make the comparison be False. For example, ' name' <> 'name'. Anyway, JIM.H., should post more details on your case. ...Show All
Windows Forms How to validate Prerequisites for MSI
I'm creating a setup and msi file for a .Net 3.0 windows application. Also I set the prerequisites for the setup project with .Net 2.0 and .Net 3.0. While installing through setup (setup.exe) the validation is happened properly but while installing from MSI(MyApplication.msi) file the validation is not happening properly. The validation is happened for MSI when the system does not have both the .Net 2.0 and .Net 3.0 versions and the installation is allowing when the system has only .net 2.0 version. How to resolve the problem ..any help please Thanks ...Show All
Visual Studio Tools for Office Bind the existing listobject without hard coding the Sheet name
My VSTO application contains more than 100 sheets. In all the sheets there is one list object and a chart bind to it. I can access the list object SetDataBinding as follows. Globals .Sheet2.list1.SetDataBinding(); Is there any way to bind the existing listobject without hard coding the Sheet name. For example: Excel. Worksheet activeSheet = (Excel. Worksheet ) Globals .ThisWorkbook.Sheets[1]; activeSheet.ListObjects[0]. ( here SetDataBinding() is not available! ) It is possible to add listobject dynamically using Control.AddListObject() and that method is returning ListObject instance, for that SetDataBinding() is available. But I need to bind the existing list object. Is ther ...Show All
SQL Server Create Time dimension Year, Week, day problem
Hi, I have a problem when creation a Time dimension Year, Week, day , The week does not start on the correct date eg. Week 42-2006 should start on 16 th. october and end on 22 th october, but in this case it starts on the 15th october and ends on the 21 october. So what happens is that it starts 1 day before it actually should. This is my Time Dimension: DatePart(year,"dbo"."fCapacityLedgerEntry"."Posting Date") DatePart(week,"dbo"."fCapacityLedgerEntry"."Posting Date") 'Week ' + convert(CHAR, DateName(week, "dbo"."fCapacityLedgerEntry"."Posting Date")) convert(CHAR,"dbo"."fCapacityLedgerEntry"."Posting Date&quo ...Show All
SQL Server Duplicated parameter names are not allowed.
I am getting this exception in RC1: SqlCException: Duplicated parameter names are not allowed. [ Parameter name = @SOLUTIONID ] With the following statement: SELECT [VERSIONID], [SOLUTIONID], [BASEVERSIONID], [VERSIONNUMBER], [NAME], [DESCRIPTION], [CREATEDATE], [UPDATEDATE], [VERSIONCLOSED] FROM VERSIONS WHERE SOLUTIONID = @SOLUTIONID AND VERSIONCLOSED = 1 AND VERSIONID IN (SELECT MAX(VERSIONID) FROM VERSIONS WHERE SOLUTIONID = @SOLUTIONID); Besides the obvious of adding a new parameter with the same value and a different name - are there any plans to fix this Another area wher ...Show All
.NET Development Notify user of session timeout?
Hi, I need to notify the user when the session times out and I supose I'm looking to solve two things. 1. I would like to warn the user a minute or so before a timeout occurs and allow the user to extend the session. 2. If the session times out, then I want to redirect the user to a "you're logged out page". How is this done Thanks! This isn't related to web services unless you built your own web services authentication. By default the session timeout for the ASP.Net forms authentication is 20 minutes. You could have a javascript counter on each page that warns them when the timeout is about to occur: window.setTimeout(myalertfunction, 19 * 60 * 1000) //warn after 19 minutes funct ...Show All
Game Technologies: DirectX, XNA, XACT, etc. No typedef and no Include. . .
Are these VBA programmers writing the .Net framework and languages Many of you probably already know this, as I'm arriving late to the party. I wanted to use the typedef equivalent but apparently not in C#. Then of course I thought I'd try the #include -- maybe so, if I wanted comments (I gather). The end result: Common.cs using System; namespace <yoursHere> { using ID = System.Int32; public class objID { private ID itsID; public objID( ID theID ) { itsID = theID; } public ID ID { get { return itsID; } set { itsID = value; } } } } Did I miss something r2d2-proton wrote: Did I miss something Depends on what you were trying ...Show All
.NET Development How to Insert/Update/Delete nodes using XPath expressions?
Hello, I have been using XPath expressions to iterate through a set of nodes (see example below). Can someone please suggest how I can add or drop sibling or child nodes using XPath expressions. Thanks, Tad code snippet: XmlDocument xd = new XmlDocument(); xd.Load("data.xml"); XPathNavigator xn = xd.CreateNavigator(); XPathExpression xe = xn.Compile(" //Assembly/Component/@cn ame"); XPathNodeIterator nodes = xn.Select(xe); while (nodes.MoveNext()) { MessageBox.Show(nodes.Current.Value.ToString()); } data.xml < xml version="1.0" encoding="utf-8" > <WidgetSettings> <Assembly> < ...Show All
.NET Development Partial File Downloading
I want to download file from 3,221,225,472 bytes (3 Gb) to 3,328,599,654 bytes (3.1 Gb) for example Windows Vista Beta ISO if I use HttpWebRequest.AddRange Method (Int32, Int32) occure exception: "System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: The From or To parameter cannot be less than 0. at System.Net.HttpWebRequest.AddRange(String rangeSpecifier, Int32 from,Int32 to)" because 3,221,225,472 > MAX(Int32)=2,147,483,648 How can I download from 3,221,225,472 bytes (3 Gb) to 3,328,599,654 bytes (3.1 Gb) This is what I used, it seems to be faster: public delegate void _AddRange(HttpWebRequest httpWebRequest, string rangeSp ...Show All
Windows Forms Calling open another form
Yet another question for you guys: I have created 2 forms in my application. I want a button on Form1 to "call open" Form2 without opening another window. AKA: Sort of like a "Next Page" option. What code would I put in the button event handler to perform that task I figured it out, thanks. By the way, here is the way I larned to do it: Form1.ActiveForm.Hide(); Form2 theSecondForm = new Form2(); theSecondForm.ShowDialog(); ...Show All
Software Development for Windows Vista CM_Get_DevNode_Registry_Property doesnt work for windows vista. Any alternate ?
I am using CM_Get_DevNode_Registry_Property function to get USB property for the USB drive connected in windows XP. Which is working properly But it is not working properly in Windows Vista. Also I found that it is mentioned in MSDN that do not use this function as it is not supported for later version of windows. But the alternate that they have given SetupDiGetDeviceRegistryProperty is not working properly as it works in XP. Basically I want to get the driver ID from the USB which works for XP using CM_Get_DevNode_Registry_Property but if i try to use it in Vista it doesnt. Can anybody explain me why is it happenning And is there any change in the Windows Vista registry fromat or drive mapping which gives me wrong output. Basicall ...Show All
Visual C# Create Word Documents By C#
Hello, I would like to create a Word doc directly from C# Windows Form codes. 1) How to create and open the Word doc After creating the Word doc and Open it, ... 2) How to insert a text from a textbox to the Word doc that is already currently opened 3) How to check the current Range.Selection location Please exlpain in full as I am a newbe in C# to create Word... Thanks in advance. Keith Elder wrote: Based on what you need to do this can be simple or complex, however, you DEFINITELY you need to start with VSTO first and foremost. There is no need at reinventing the wheel here. Take a look at this: http://msdn.microsoft.com/office/understanding/vsto/ Download the Vis ...Show All
Commerce Server Error in Refresh Site Cache
Hi, I have a problem whem I want to refresh a Site Cache from one of the business applications. The error I get is: System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: Instance validation error: '0' is not a valid value for System.Net.HttpStatusCode. Whats there the problem I've read that tehere was a Hotfix (http://support.microsoft.com/default.aspx/kb/922068) but i cantot download this Hotfix. When I open this link: SiteCacheRefresh.axd CacheToRefresh=CatalogCache for example, I get the problem that It d ...Show All
