jay_jay's Q&A profile
Visual C++ How to do proper infinite loops
I am writing a console application for a Windows box that is constantly polling for certain external input to be read and it is basically in an infinite loop. Roughly: while(1) { wait 5 minutes; check value; if user asked to kill us quit; } The only thing is that the CPU jumps to 100% utilization when this program is running. Since the console application, as far as I know, is not event-driven in any way, how do I do an infinite loop without taking 100% of the CPU longwood How do you wait 5 minutes Use System.Threading.Thread.Sleep(300000); to wait without using the CPU. -- SvenC ...Show All
SQL Server How to enforce SQL Server 2005 to use Worktable?
I have a problem in SQL Server 2005. In some cases SQL Server produces an execution plan of complex query (8 joins of views, some of views contains couple of joins) which does not contain a woktable creation in tempdb. As a result time of query execution increasion for about 5 seconds to about 4 minutes. All necessary indexes are created. It sims all data located in cache. Is there any way to enforce SQL Server to create worktable Query SELECT [a0].[id],[a0].[Priority],[a0].[Heading],[a0].[DocumentDate],[a0].[LastName],[a0].[FirstName],[a2].[Name],[a1].[Position],[a4].[ContactTime],[a4].[Subject],[a0].[WorkPhone],[a0].[MobilePhone],[a0].[FaxNumber],[a0].[PrimaryEmail],[a5].[ContactTime],[a6].[Value],[a7].[id],[a7].[id_class],[a8].[id ...Show All
Visual C# probem with generics
Hi, I've written the the code below: static public void Test<T>(T arg) { write(arg); } static public void write( char c) { Console .WriteLine( "char" ); } static public void write( int c) { Console .WriteLine( "int" ); } It should be possible to write like this: Test('c'); or Test(10) and the appropiate write methods should be called. When I try to compile it I get two errors: Error 1 The best overloaded method match for 'tester.Program.write(char)' has some invalid arguments. Error 2 Argument '1': cannot convert from 'T' to 'char'. Is there another way to make the templated method call the appropiate methods. It seems to me that writing some ...Show All
Visual Studio Tools for Office Outlook add-in example
Hi. im trying to implement the outlook add-in presented in http://msdn2.microsoft.com/en-us/library/ms788695.aspx I have vs2005 sp1 professional and vsto 2005 SE installed. But in the connect.cs file, where i change the signature to public partial class Connect : Outlook. FormRegionStartup I am getting this error: 'InternetHeaderAddin.Connect' does not implement interface member 'Microsoft.Office.Interop.Outlook._FormRegionStartup.GetFormRegionManifest(string, int)' Any help will be wellcome! thx in advance I believe you need to explicitly implement the interface in your method signatures, i.e. public object Microsoft.Office.Interop.Outlook._FormRegionStartup. ...Show All
SQL Server Books Online
I have registered to use SQL server 2005 Express Edition. I want to download relevant documentation for books online. The guidance for this is to download the 'SqlServer2k5_BOL_Jul2006.msi' software. When I initiate this download:- (1) I get a message from my ISP (I.e AOL) saying the publisher coud not be verified, and asking if I wanted to run this software. (2) when I press 'run' software is downloaded to a tmp file, and I get the option to install. (3) On clicking the install button, a Windiws Installer message appears - this states that ' the installation package cannot be opened and suggests contacting the application vendor to verify that this is a valid Windows Installer Package. How can I access the ...Show All
Visual Basic Wireless Connections
Ok so heres my problem. Im trying to automate the addition of a new wireless profile. I dont know if its possibly in VB or if its even possible in general and I have been searching endlessley on the internet. In the Wireless Network Connection Properties window, under the wireless networks tab is a button thats says Add... Instead of having to physically go to a users computer and add a new connection I want to make some sort of program or script that i can give to the user which they will run and automatically confiure the new wireless network connection for them along with the data encrption type, the network key and everything else. Any insight on this would be greatly appreciated. Thanks in Advance, Paul ...Show All
Visual C++ Using Visual Styles in VC++ 6
Can anybody give me a sample code for using visual styles in VC++ 6. I wanted to display texts using XP's font and style. Urgent. Just add a manifest to your resource of type 24 and id of 1 see: http://msdn2.microsoft.com/en-us/library/ms997646.aspx If you're not familiar with using a resource editor, here's some code to generate the manifest in your EXE. http://www.codeproject.com/cpp/AddXpStyle.asp ...Show All
Visual Studio Express Editions DataGridView when adding data this occurs for the very 1st entry:
Hi, I linked up my DataGridView with a .mdb file. I use a button to add data to my file but on the DataGridView my 'Sample' column starts from zero. Why is this so How come it does not start from 1 Can I program it to start from 1 Thanks for the help, Scott. I used the simplest method to solve this problem. Its describe here . ...Show All
Audio and Video Development XML Parser Performance..
Does anyone have any relationship data between XML Parsing (using the built in spec Parser) and specific CES devices We are looking for data based on the parsing and handling the parsed xml stream, such as dynamically creating menus, pop up messages, dynamic playlist navigation, game engine datasets etc. Our SAX implementation and DOM implementations are multi-format compatible but we are looking to verify performance at this time before giving up on the built in spec parser. Any one doing this kind of dynamic work already and willing to share their experiences Thanks, Denny B. I would recommend you try very hard to use the built-in one. Using your own could lead to poor performnace issues when loading large DOMs (eit ...Show All
.NET Development URGENT:Resolution Problem
Hi all, I having the big application having several forms and controls over it. I developed that application in the environment 1024 * 768 resolution. The probelm is that when we change the resolution, my application does not show the forms and controls over it correctly, if we increase the resolution, the forms goes outside the screen, if we decrease the resolution, the the controls over the contol get shrink and form do not shrink in the same ratio, it shows the unnessary gap between the forms and control over it. Can anybody tells me the solution for this, my reqirement is my application should always shown with in the screen of the monitor, ...Show All
Visual C++ Profiler for umanaged and managed c++ ?
Hi, We have a solution with a couple of C# projects and some Managed C++ projects. The C++ projects also contains quite a bit unmanaged C++. Finally, we use some third party libraries. Are there any good profiler tools to be used in our setting I want to be able to profile all parts of our solution. Thanks! Torbjorn Torbjorn wrote: Do you know if the profiler in VS Team Edition can profile unmanaged C++ I believe it can. I haven't actually tried it, though (too expensive for my private use), so you will probably get more accurate answers on that in the VSTS-forum (See http://forums.microsoft.com/MSDN/ ). Torbjorn wrote: (I think I've tried AQTime, but found it ...Show All
.NET Development Filter a dataset on the month of the date column
Hi, I have two data grids. First one is showing data of all Invoices for a year. There will be one text box in that user will enter a month. I want to show all Invoices for that month from First data grid to the second data grid. ( I have InvoiceDate column of DateTime datatype and i want to show all records for a specified month in the second grid. Basically I want to use Month(InvoiceDate) = 2 this kind of filter query on dataset) How should i do it Mangesh First try "DatePart('m', InvoiceDate) = 2" as the filter. That probably won't work, but if it does, it better than the alternative. If it doesn't work, try this: "Convert(Substring(Convert(InvoiceDate,'System.String'), 0,2), 'System.Int32') = 2&quo ...Show All
SQL Server how to call web service from within Script Component ?
Appreciate if anyone can show me the code to call a web service from Script Component I cannot use the Web Service Task. Because parameters to the webservice are from rows of data inside Data Flow Task. Thanks !! mf915 wrote: thanks ! but the book is not available from rationalpress.com until March :( Don't worry. You can get the beta preview version. It contains the same stuff: http://www.amazon.com/Rational-Scripting-Integration-Services-Preview/dp/1932577211/sr=1-2/qid=1171050141/ref=sr_1_2/102-7891523-4086513 ie=UTF8&s=books -Jamie ...Show All
Visual C++ Get System Date and Time
Hi all, Can anyone plz help me how to get the System date(dd:mm:yyyy) n time(hh:mm:ss:miilisec) in Managed C++ without using the DateTime class regards, Kish Is it possible to get the date and time(hh:mm:ss:milisec) by using PerformanceCounter coz by using struct tm *newtime; we r having some performance issue in our project as it is Win32 API. regards, Kishaloy ...Show All
Visual C# Getting the month out of a string date!
Hi, I'm facing a small problem and it would be great if someone could provide me a solution to this problem. I have the following code: string str="11/09/2006"; // In "dd/MM/yyyy" format. int month; Now when I specify month = Convert.ToDateTime(str).Month; I get the value of month as 11, which means its taking the "MM/dd/yyyy" format. How can I specify the "dd/MM/yyyy" format so that I get the value of month as 09. I do not want to use the spilt function and get the month, is there any other efficient way of doing this. Thanks & Regards, Frenz The Brits (and the Frenz) put the day before the month: System.Globalization.CultureInfo cult = S ...Show All
