Click here to Skip to main content
15,175,307 members

Comments by T2102 (Top 78 by date)

T2102 31-Aug-12 11:12am View
Unfortunately it's not consistent and may have been a coincidence. The article I reference indicates that the ole provider for outlook is meant to be run in STA instead of MTA. Otherwise you get an error such as " System.Data.OleDb.OleDbException: There are no MAPI clients installed on this machine. Install a MAPI client (like Outlook) on this machine." I think .NET and the provider may be the source of the problem, but I still can't figure out why it can't catch an exception.
T2102 13-May-12 20:11pm View
The call to fscanf_s without a buffer size does cause exceptions with Visual Studio 2010. That's the point of using it as an example.
T2102 20-Oct-11 17:54pm View
Yes, I agree with you about Configuration instead of mode. I am only using the console in my example, no WPF or MFC form complications. I don't see Exceptions under the debug menu. I am using Visual C++ 2010. My particular application is simply; run a bat file and send an email indicating whether or not it succeeds. The complication is that if the dlls and exe happen to be in different configurations, Visual Studio refuses to start or gives a pop-up error instead of allowing the try catch blocks to work in my dlls or the exe.
T2102 20-Oct-11 16:31pm View
In debug mode, I compile all of my code into debug.
T2102 16-Aug-11 11:59am View
When I execute the stored procedure calling the executable directly in an executable/dll, it seems to be faster than executing the stored procedure in SQL Server Management Studio. Could the time lag be attributable to SQL Server Management Studio or some option set in it? I've already changed the packet size to 32767 since my internet connection can be slow and a communicate with headquarters on the west coast when I live on the east coast.
T2102 15-Aug-11 17:48pm View
Thanks, I am now using no_output. Could windows firewall have a meaningful effect on run-time too? I toggled it on and off a couple of times, and the run-time dropped. I think it's most likely due to less internet traffic now.
T2102 20-Jul-11 14:12pm View
Thanks for now, I am downloading data in a series of much smaller csv files. It will take me a few hours, but then I avoid the xml problem. I an in 64 bit OS with Pro version of Visual Studio 2010.
T2102 20-Jul-11 8:29am View
No, the question is not related to intellisense in Visual Studio. This is related to customizing the Excel function wizard.
T2102 29-Jun-11 20:02pm View
I'm running Windows 7 and am trying to use Intex at a satellite office. telnet 21 seems to suggest the ports open. Intex says the port is blocked and the building IT says its open.
T2102 22-Jun-11 15:32pm View
Yes, it would be possible to write a template function. However, I am trying to write a template member function inside the template class and only this single function takes additional template parameters. While I could wrap a template function in a namespace with the same name as the template class, that seems cludgy.
T2102 17-Jun-11 8:19am View
Thanks, I spent several hours reviewing and I'm 99% sure this is a memory error in Excel's API and not my code.
T2102 14-Jun-11 9:33am View
Thanks, that did the trick
T2102 18-May-11 12:37pm View
I am bow guessing that an implementation detail in STL is causing the problem, but I am not sure.
T2102 18-May-11 12:33pm View
Note that the error is pointing to xmemory line 48
T2102 18-May-11 12:33pm View
My template class contains an STL template class S. I added both A<c> and S<c> as friends just in case. When the copy constructor is private, I get the error C::C cannot access private member declared in class C. When the copy constructor is public, it compiles correctly.
T2102 18-May-11 11:52am View
It actually looks like it's solely limited to the copy constructor. I want to avoid implicit copy construction whenever possible.
T2102 9-May-11 11:22am View
To know if the call is successful, I can use
<pre>return !system("ping network_DB");</pre>

However, this shows a dialog. I know how to use ShellExecuteEx and ShellExecute to execute the code above with a dialog hidden, but I am not sure how to check whether an error was encountered.

Do you know how I can do this without outputting the results to a file.
T2102 6-May-11 12:07pm View
Unfortunately that did not work. I replace C:\Temp with C:\Windows\Temp since my fresh copy of Windows 7 does not have that directory.
T2102 29-Apr-11 17:38pm View
Pinging is the same problem; there is a timeout involved. I run a spreadsheet that might have zero database calls to a remote server or could have hundreds. Checking this with a registry key or something similar is ideal since the timeout delay can be huge.
T2102 11-Apr-11 23:48pm View
Unfortunately it is much harder to port VC6 to VS2010 when you used MFC. I ported 20+ projects without using MFC with significantly less total effort than an attempt to port a project that heavily utilized MFC. You might be better off buying an old version of VS6 assuming you are lucky enough to find a copy without viruses/malware.
T2102 11-Apr-11 22:29pm View
Yes, I want something interpreted before the compile. My desktop has Windows 7 and my laptop has Windows XP. I want to be able to work and debug on my code on either computer without maintaining two copies of vcxprojs and props files.
T2102 11-Apr-11 22:04pm View
Yes, I understand that I can use conditional compilation. I am hoping to find a preprocessor macro that differentiates windows 7 from windows xp sp3 and hoping it's usable in vxproj too.
T2102 1-Apr-11 22:19pm View
I am looking for help on Windows automation. How can I modify the code above to click the yes button? I think I need to modify the ::PostMessage code and Button_SaveAs code.
T2102 1-Apr-11 10:06am View
The query at the headquarters takes less than a second, but it can take 20-45 seconds for SQL Server Management Studio to finish executing the query and receiving the data at the remote office.

As an analogy, I've found xcopy to be very slow when using a remote network versus getting a file list of both directories and then using C++ commands to copy manual. I thought using a Data Reader might have the same performance implication.
T2102 1-Apr-11 9:58am View
Thanks, reposting there
T2102 22-Mar-11 10:14am View
Thanks; now I know that I'm not going crazy.
T2102 21-Mar-11 15:54pm View
Solution 1
RTSVX.RS is showing up as a hyperlink for some reason when I view the message in gmail

<html><body><pre>Volatility<br />Yahoo Ticker Name Level <br />^VIX VOLATILITY S&P 500 20.84 <br />VCAC.NX CAC40 VOLATILITY 22.362<br />^BVZ CBOE Binary Options Volatility 20.84 <br />^OVX CBOE Crude Oil Volatility Index 39.29 <br />^EVZ CBOE Eurocurrency Volatility In 11.29 <br />^GVZ CBOE Gold Volatitity Index 17.16 <br />^VXN CBOE NASDAQ 100 Voltility 23.92 <br />^VXO CBOE OEX Implied Volatility 19.92 <br />^RVX CBOE RUSSELL 2000 VOLATILITY IN 25.80 <br />^VXV CBOE S&P 500 3-M Volitlity 22.15 <br />^VXDEC CBOE S&P 500 DEC VOLATILITY IND 24.43 <br />^VXJUN CBOE S&P 500 JUN VOLATILITY IND 22.07 <br />^VXMAR CBOE S&P 500 MAR VOLATILITY IND 24.61 <br />^VXSEP CBOE S&P 500 SEP VOLATILITY IND 23.56 <br />^VXD DJIA VOLATILITY 18.01 <br />^RUH IND CBOE SPX Realized VolIx 12.69 <br />^VXB JUMBO CBOE VOLATILITY INDEX 20.84 <br />^QQV QQQ VOLATILITY INDEX 20.86 <br />RTSVX.RS RUSS VOLATILITY IND 26.89 <br /></pre></body></html>
T2102 21-Mar-11 14:24pm View
If I surround the text with <pre> tags and use html, then it almost works perfectly. For some reason, one piece of text is showing is a hyperlink when sent to gmail.
T2102 18-Mar-11 18:34pm View
Does it matter if I use unicode or multi-byte character set in my C++ code?
T2102 18-Mar-11 18:21pm View
I tried that and I my whitespace padding for alignment was all removed.
When I set IsBodyHtml = false, then some of the padding came back. However, it was not properly aligned.
T2102 17-Mar-11 12:21pm View
Thanks. That didn't work, but I figured out that it was a project setting issue. I put the code inside another project and it worked.
T2102 11-Feb-11 9:31am View
Thanks, the xml comment style worked in VC 2010.
T2102 8-Feb-11 20:10pm View
Thanks, I like your suggestion.
T2102 8-Feb-11 7:47am View
I am wondering if I can compute a one-to-one mapping from a series of types to characters using metaprogramming.

I currently have a template with a list of types such as T1, T2, ..., T15.
My code fills a character array with I-th position filled based on the I-th type.
I am wondering if I can compute the character array at compile time somehow.
T2102 5-Feb-11 23:21pm View
I am referring to the year 2002 on the release date for the discs; before .NET 2003 edition. I had the disks for every release since 6.0 at a former employer.
T2102 28-Jan-11 2:16am View
WPF in C# is more current
T2102 28-Jan-11 0:50am View
Interesting. I am no way near 100 folders deep; more like 4 to 6. Based on the article you sent, it appears that the problem is that the maximum path length is 260 characters. When I unzip to a new folder, the maximum path length may be exceeded. So I think I can avoid the file by unzipping to here and not to a new folder.
T2102 25-Jan-11 2:57am View
Yes, bad programming is easy and most programmers I've met are not very good.
T2102 23-Jan-11 20:12pm View
However, you have to be sure that you can use memcmp for your class. For many classes, this is not the case. If it's members could be represented by struct without pointers and without members that use pointers, then it may be possible. You should compare the results for a few test cases to make sure.
T2102 22-Jan-11 19:00pm View
The issue is that Microsoft compilers require the .NET frameworks even when you write native C++ with no CLR support. They made this change in 2003 to try to forcefully roll-out .NET. There might be a way around it, but I did not find a solution before.
T2102 22-Jan-11 18:57pm View
Even if you do not use .NET, you may need to distribute msvcr100.dll and msvcp100.dll or similar files to your clients. I used my wife's 7 year old machine as a test machine once and needed to copy those files.
T2102 22-Jan-11 18:52pm View
They also refused to upgrade their machines since they used an old accounting legacy application that was incompatible with some windows update. After months of arm twisting, I had to have the COO force them to use a single machine for the legacy app and upgrade the other machines.
T2102 22-Jan-11 18:46pm View
VB is utilized for maintaining legacy applications that people do not want to port and VBA is utilized to allow inferior programmers to create quick solutions for Excel.
T2102 22-Jan-11 18:43pm View
Your answer is NOT correct. I've had the misfortune of dealing with annoying Windows 2000 users and Windows XP SP2 users that do not have the .NET framework. They could not use native C++ code with not CLR support written in Visual C++ versions 2003 through 2008.
T2102 21-Jan-11 3:18am View
Arrays allocated on the stack will always be contiguous in memory (ignoring padding for alignment) or the allocation would fail. You can always programatically access memory allocated with new/malloc/calloc etc is if they were contiguous (a[0], a[1], ...), but the OS may map non-contiguous memory into a contiguous virtual space. This might be the case where you use some RAM and some hard disk as an example.
T2102 21-Jan-11 3:06am View
Have you never heard of virtual memory? Dynamic memory allocation cannot always be contiguous. Problems are also sometimes divided across clusters, etc. If the compiler can find contiguous memory to meet the request easily, it probably will. But this is not guaranteed.
T2102 21-Jan-11 2:39am View
Do you see yourself as a cult leader? Repeat after me?
T2102 21-Jan-11 1:42am View
google for that book and see page 68
T2102 20-Jan-11 21:36pm View
Decent answer. Not all arrays (e.g. dynamic) are guaranteed to have contiguous memory even if the associated class has no pointers. I also would recommend using prefix operator instead of postfix operators when possible as it is more efficient.
T2102 20-Jan-11 18:47pm View
Yes, but you could overload an assignment operator directly without defining a copy constructor. For instance if you used matrices, you could create an assignment operator for notational convenience. However, you might not want implicit copy construction/conversion performed.
T2102 20-Jan-11 18:15pm View
You can define a=b with an assignment operator
T2102 20-Jan-11 18:03pm View
It can work, but it's a bad habit.
T2102 19-Jan-11 17:26pm View
I did it that way for a few years, but switched to a version where I have a different output directory for each configuration. When I finish building all of the projects in a configuration, I then copy the add-ins from the output directory to my add-in directory in the path.

For file paths, I use the preprocessor to prepend the particular include directory. I think this may reduce link-time, makes it easier to read, and trace through code. I've found it hard to work with projects in the past the combined a few other projects that all defined date classes for instance.

In Visual C++, I haven't gotten a preprocessor working for a configuration specific lib path consistently for all of native/MFC/CLR projects. So I simply add some extra code

#ifdef _DEBUG
#pragma comment(lib "C:/Addins/Your_Lib.lib")
T2102 11-Jan-11 23:41pm View
If you're writing new code, I might not use C++/CLI in VS2010 is there is no intellisense anymore.
T2102 3-Jan-11 9:27am View
Sorry, I am not sure I read your question right. I thought that you were looking for the Process ID (PID), but am not sure if that is your question. Could you confirm if you want the PID or something else?
T2102 3-Jan-11 8:54am View
I already know the solution, but I do not help those with attitudes not deserving of help.
T2102 2-Jan-11 20:31pm View
Yes, change the prototype and definition to return a float. Then you'd change final to void final(float one, float two) or final(float const & one, float const & two).
T2102 2-Jan-11 20:25pm View
Example: Instead of writing up(speed) you can write float up_value=up(speed).
Alternatively, you could make one and two global static variables. However, that's a practice you want to avoid whenever possible.
T2102 2-Jan-11 18:05pm View
Installing Prio worked great. I am just not sure how they customized the task manager. Prio runs a service, so I am guessing that there is some type of event that is triggers when a new process is launched. Then prio's service automatically changes the priority to the one you saved.
T2102 1-Jan-11 7:56am View
From your file: List() { count=0; }
Comment you should utilize initialization instead of assignment as follows: List() :count(0) {}
T2102 1-Jan-11 7:24am View
I like to be able to use my laptop when running at 100% cpu.
T2102 30-Dec-10 20:12pm View
It should not be a much slower build if you are dynamically linking to a dll. I do it myself with Visual C++.
T2102 27-Dec-10 8:32am View
C++/CLI is very close to C#. In fact, Microsoft stops supporting Intellisense for C++/CLI with Visual Studio 2010 most likely to try to force conversion to C#.
T2102 27-Dec-10 8:31am View
You can install compilers for multiple languages on one machine; you just need a separate test machine(s). I've run Visual Basic, C++, C# 6.0 Enterprise to 2010 Express on the same machine previously.
T2102 24-Dec-10 8:31am View
Unless you're dealing with a very small system, you are better off creating a pattern where you register error codes or create them dynamically.
T2102 24-Dec-10 8:24am View
Using enum for error codes is one of the first textbook examples of poor design in a graduate text I read on developing large scale systems. There are many problems with using an enum for an error code, including that adding additional error codes forces recompiles. At some point, people avoid adding them and just chose a generic error code that is uninformative.
T2102 21-Dec-10 18:24pm View
I second that, otherwise it's easy to crash your program. I also would suggest that you might use deque or stack instead of vector unless your file knows the number of rows should be within a small interval. In that case, you should reserve some space to start with, keep track of how many elements you fill, and only extend the deque/stack/etc. once it is filled.
T2102 15-Dec-10 6:35am View
.NET (e.g. C++/CLI and C#) have multi-threading options and the ability to create processes and threads with relative ease, although using managed code has a performance hit...
T2102 18-Nov-10 21:41pm View
How many conversions are you performing implicitly on the line above? What are the types?
You also do not need to use static_cast if index is an int already...
If your arrays are small, you should use a struct that has value and offset as a members.
You should profile your page faults to increase speed.
T2102 18-Nov-10 21:36pm View
I could not get it to work with double quotes in Visual C++ 2010, but using open and close brackets ( < and > ) worked.
T2102 18-Nov-10 8:59am View
Yes, that format sometimes works. The solution I tried before my post utilized the format you mention. This worked inconsistently. In some projects, I could utilize the path
C:/Documents and Settings/Ted/My Documents/Visual Studio 2010/Projects/
and in others the same include line would not work.
T2102 22-Oct-10 22:45pm View
Another issue that may be unrelated is that when you launch Excel programatically, you need to load all of your add-ins programatically. They will be checked by excel, but may not be available.

Your error message sounds like a permission issue; in SQL Server you would need to run sp_configure to allow access to various paths.

You can get rid of the save as prompt using the Workbook_Before_Save event or something similar to that.
T2102 20-Oct-10 4:07am View
The first suggestion, I would have is not to call Replace(LTRIM(RTRIM(@keystring)) multiple times. Instead declare a new varchar and format the result once. Instead of doing LTRIM and RTRIM on the table, can you first backup, and then modify the dataset removing the leading and trailing spaces, and then add constraints? Alternatively to avoid the constraints, the stored procedure for inserts could trim leaves before it's entered. Also, you can do your three separate queries in parallel using multiple threads.
T2102 27-Sep-10 1:22am View
Note that I mainly work with native C++ and C++/CLI is incompatible with two other libraries I utilize, so I cannot use mixed programming. I also do not want to add the overhead of using C#.
T2102 27-Sep-10 1:21am View
The Wrapper dll example is C# code. I am trying to find out if I need to do anything special to call function in a C++ dll that utilized ADO .NET, but whose function inputs are all native C++ types. I am able to call the function directly like I would any other native C++ dll function, however I want to know whether or not this could cause managed heap corruption.
T2102 22-Sep-10 3:08am View
My statics typically were constant static arrays such as constants utilized for statistical functions, counters, or to cache the inputs and results from the last few calls to a particularly expensive function where the probability of reuse elsewhere is high. I am modifying my static functions to namespaces named after the file name for clarity for me.

Thanks for the input on aliasing and globals. I will try to address global variable next.
T2102 22-Sep-10 0:25am View
I am running several threads at once. Can you tell me why is passing in std::string & Path and std::string & File in a void function is not thread-safe? I will check if I am using fopen elsewhere and whether that is thread-safe.
T2102 10-Sep-10 5:02am View
Thanks, that solved my problem