|
|
I was try to incorporate this cool TabCrtl software
... http://www.codeproject.com/useritems/mditabs.asp
into my project.
I followed the instructions and try to
build my project and I get that C1010 error?
I didn't change any code but merely added
the .h and .cpp to my project.
What am I doing wrong?
|
|
|
|
|
You need to make sure that the cpp file has the "stdafx.h" file included in it. this is the precompiled header file.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
1/ Open a CP account
2/ Post this question on the article in question.
Because you have opened an account, the author will get an email letting them know you asked the question.
BTW in this case, the problem is that the original article must have used automatic inclusion of precompiled headers, so go to the project settings and set them to automatically use stdafx as a precompiled header, instead of always doing so. Or #include "stdafx.h" at the top of the cpp file, but I presume he had a reason for not doing so in the first instance.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"But there isn't a whole lot out there that pisses me off more than someone leaving my code looking like they leaned on the keyboard and prayed that it would compile.
- Jamie Hale, 17/4/2002
|
|
|
|
|
Hi.
Is it possible to enable/disable a message from the message for a time interval?
For example, let say I have a program that plays AVI files. For the first ten seconds, I want to disable the open button. I can disable a button. However, I found that if the user clicks on it while it is disabled, the framework keeps the message and class the message handler after I enable the button.
Is it possible to disable a button *completely*, or even better, ignore/unignore a specific message?
Thanks,
Kuphryn
|
|
|
|
|
m, the button is either disabled or not disabled. Possibly what is happening is the button is not even getting the mouse message until after it is re-enabled; ensure you are processing messages at an acceptable rate.
--------
Well actually they are sort of interesting Nish, on Nudes
|
|
|
|
|
You could remove all the WM_LBUTTONDOWN messages from the message queue before reenabling the button.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
As title.
I'm amumu, and you?
|
|
|
|
|
I want to be able to automate my stock buying and selling, so I can go to work and not worry that I my stock will go down while I'm a way.
I want my computer to enter the stock symbol of my stock into for example msn, and then be able to parse the price from the site. It would then connect to my financial site and then be able to push the submit button to make the transaction.
What are the technologies that will enable me to do this? The sites are not XML enabled. Your help will greatly be appricated! What Functions do I need to call to do this? THanks in advance!!!
|
|
|
|
|
Is this a bug in MS's stl string code?
In this case _E would be sizeof(char). Why then would you make _MIN_SIZE 31 for a char but 7 for some data type that's larger than 31 bytes?
XSTRING line 519:
enum {_MIN_SIZE = sizeof (_E) <= 32 ? 31 : 7};
Todd Smith
|
|
|
|
|
This is just an internal optimization trick. _MIN_SIZE is the minimum capacity a basic_string<E> can have. The purpose of this boundary is- to avoid memory fragmentation due to huge amounts of tiny blocks being reserved
- and to provide a reasonable starting size that a significant portion of strings will fit in without further reallocations.
So for small-sized types (like char ), the minimum capacity is no less than 31 bytes, while for larger types we moderate our first reservation to 7*sizeof(E) bytes.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
What's the best way to optimize this min size? Hack the code and redefine the min size?
I've been trying to use the swap trick to minimize memory usage but the little sucker wont budge beyond 31 bytes. I don't want to switch to vectors since I use a lot of the string functions.
I was trying to use stlport but the current version doens't like having VC6, .NET and the Platform SDK on the same computer. It refuses to compile.
Todd Smith
|
|
|
|
|
I have been able to build the current stlport with VC6 and VCNET
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
|
Sorry, I would have to check my work computer. Make sure you read the STLPort release notes. There are some things for VS.NET you have to watch out for.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
I have a function: CString CMyView::GetNextString( ifstream &File ). Now that has been working for quite a while and all of a sudden I'm getting an error that says syntax error: identifier 'ifstream' and points to the the function declaration. I have the #include "fstream.h". It was working but now its not. Any reason why it just stopped working and how to fix it?
-Raffi
|
|
|
|
|
I haven't used ifstream in a while, but as i recall you want to use
#include <fstream> not
#include "fstream.h".
--------
Sip my mind.
|
|
|
|
|
Did you migrate to .NET ? Maybe it finally removes the deprecated header fstream.h. As has been said already, you should use #include <fstream> and then you need using std::fstream; as well.
What else has changed in your project ? Things don't just stop working by themselves, it must no longer be able to see the header.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
I havent moved to .NET .I tried useing #include < fstream > and I got 16 errors.
When I fisrt added my function I got that same error. Then I deleted the function, rewrote it and it worked for some reason. I added other functions(a change) and then the error reocurred. I tried rewriting the function but it doesnt work now.
Could you explain the std::fstream a little? I've never seen that before and it might be the solution.
Thanks for the help.
-Raffi
|
|
|
|
|
(With the permission of Christian)
Try this. In every .cpp of your project, right after the #include s write
using namespace std; This is usually labelled as a big no-no as C++ coding style goes, but it should get your program working with minimum effort.
If you want to know more about namespaces (that's what std is), have a look at (for instance) this tutorial.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Joaquín M López Muñoz wrote:
If you want to know more about namespaces (that's what std is), have a look at (for instance) this tutorial.
Is there no namespaces tutorial in CP ? Hmm... I've been wanting to play with unnamed namespaces for a while, maybe I should write an article.....
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"But there isn't a whole lot out there that pisses me off more than someone leaving my code looking like they leaned on the keyboard and prayed that it would compile.
- Jamie Hale, 17/4/2002
|
|
|
|
|
Is there no namespaces tutorial in CP ?
None that I know of... Unnamed namespaces are rather exotic constructs, and (IMHO) students of C++ will have a hard time learning their uses (so a tutorial of yours might be just very well called for ). To make things worse, the standard guys are considering deprecating static where it means "local to the current compilation unit" in favor of unnamed spaces --a controversial and little advantageous decision in my opinion.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Joaquín M López Muñoz wrote:
Unnamed namespaces are rather exotic constructs, and (IMHO) students of C++ will have a hard time learning their uses (so a tutorial of yours might be just very well called for ).
To be honest, my manager showed them to me and the purpose of the tutorial would at least partly be to understand their uses fully myself. It looked exciting, but I need to play with it to appreciate it a bit better.
Joaquín M López Muñoz wrote:
To make things worse, the standard guys are considering deprecating static where it means "local to the current compilation unit" in favor of unnamed spaces --a controversial and little advantageous decision in my opinion.
Why do they want to do that ? From what I've seen of the stuff they want to include in the next standard ( threads, GUI stuff) ,I think the standards committe may be running out of useful things to talk about.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"But there isn't a whole lot out there that pisses me off more than someone leaving my code looking like they leaned on the keyboard and prayed that it would compile.
- Jamie Hale, 17/4/2002
|
|
|
|
|
As always, the crowd cheers and roars at your upcoming tutorial If you accept suggestions, there's an interesting subject in connection with namespaces that you might find worth writing about, namely the use of namespaces to support versioning: the library vendor just releases upgrades with different namespaces (say wonderlibrary1_0 , wonderlibrary2_0 , etc.) and the user decides the actual version she wants to use with
namespace wonderlibrary{
using namespace wonderlibrary2_5;
} Cute, isn't it.
Why do they want to do that ?
Don't know. I guess you can find explanations in comp.lang.c++.moderated. To be precise, the declaration has been annonunced from the latest 98 standard.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Joaquín M López Muñoz wrote:
there's an interesting subject in connection with namespaces that you might find worth writing about, namely the use of namespaces to support versioning
Hey - that *is* a cool idea. I will definately make mention of it.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"But there isn't a whole lot out there that pisses me off more than someone leaving my code looking like they leaned on the keyboard and prayed that it would compile.
- Jamie Hale, 17/4/2002
|
|
|
|