|
Did you add a #include <vector> in your stdafx.h ?
Did you forget to add using namespace std; or add the std:: before vector < int > VectIter; ?
|
|
|
|
|
yeah sure, i put on my StdAfx.h
<br />
#include < vector ><br />
extern vector < int > VectIter; <br />
and on my Prog.cpp
<br />
#include < vector ><br />
using namespace std;<br />
vector < int > VectIter; <br />
BUT the error still remains
"The Ultimate Limit Is Only Your Imagination.
|
|
|
|
|
in stdafx.h, change the declaration line with this:
extern std::vector < int > VectIter;
|
|
|
|
|
i changed it to extern std::vector < int > VectIter; and i had 12 Errors.
So i think that i will keep my first declaration.
but i read on net that VC6 generates errors even if the code is right like
<br />
std::set<int> s;<br />
std::vector<int> v(s.begin(), s.end());
<br />
std::list<int> l;<br />
l.sort(std::less<int>());
<br />
truct A<br />
{<br />
void Func()<br />
{<br />
}<br />
};<br />
<br />
std::vector<A> Tab;<br />
std::for_each(Tab.begin(), Tab.end(), std::mem_fun_ref(A::Func));<br />
So whazuuup. what should i do. i Need Vector type
"The Ultimate Limit Is Only Your Imagination.
|
|
|
|
|
Blood_HaZaRd wrote: i changed it to extern std::vector < int > VectIter; and i had 12 Errors.
So i think that i will keep my first declaration.
you shouldn't think so. firstly because you're not really understanding all that you're doing, but also because the number of errors is not relevant.
sometimes, you can have the compiler complaining about more than 50 errors, and just because you forgot a ";" in a header included in many files, you fixed all in a flashlight.
why don't you post a relevant piece of code, and tell us what are the compiler errors returned ?
(no matter if your Visual Studio is speaking french, I'm french, so i still can help).
btw, be careful when posting code involving templates, because the < > characters are understood by the browser as html tags...
-- modified at 7:45 Thursday 29th November, 2007
so, for your compilations errors, here is what i suggest you to do:
in stdafx.h, only add this:
#include <vector>
extern std::vector<int> vec;
then, in every place you need the vector class, prefer using std::vector<int>
|
|
|
|
|
Or have about 120 error for just a closing bracket "}" :P (I do know )
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Your stdafx.h gets compiled first. So put the "using namespace std" in stdafx.h
Change it as follows in StdAfx.h
#include < vector ><br />
using namespace std;<br />
extern vector < int > VectIter;
and in Prog.cpp
#include < vector ><br />
vector < int > VectIter;
Regards,
Jijo.
________________________________
Yesterday is history,
Tomorrow is a mystery,
But today is a present.
|
|
|
|
|
no, definitely don't declare using the whole std namespace within stdafx.h !!!!!
|
|
|
|
|
toxcct wrote: no, definitely don't declare using the whole std namespace within stdafx.h !!!!!
why, i shouldn't do that ?
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
because you're leading to name collisions.
your can confuse the compiler with 2 classes which have the same name, just because it doesn't know to search whether the std:: namespace, the glogal one, or another namespace you just import entierely.
it's commonly accepted to avoid the using namespace std declaration, but if you really need it, then don't do it in a header file (and worst in stdafx.h, because the entiere application includes it !!!).
prefer using namespace std inside shorter scopes like functions
|
|
|
|
|
Great here it comes.
Thank you. it works now. O errors.;)
"The Ultimate Limit Is Only Your Imagination.
|
|
|
|
|
having the code compiling doesn't mean it's very clean. let's continue on our first investigation, if you like so.
|
|
|
|
|
toxcct wrote: having the code compiling doesn't mean it's very clean. let's continue on our first investigation, if you like so.
yeah sure. let's Continue on our First investig. But i hope that it runs
"The Ultimate Limit Is Only Your Imagination.
|
|
|
|
|
Hi all,
int nLen = onlyFName.GetLength();
LPCSTR lpszBuf = onlyFName.GetBuffer(nLen);
compiling this code in VC2005 gives this error:
error C2440: 'initializing' : cannot convert from 'wchar_t *' to 'LPCSTR'
|
|
|
|
|
Why do you need a LPCSTR ?
I mean, you have several options:
(1) Make an ANSI build of your code instead of a UNICODE one (default on VC2005). And your code will compile.
(2) Use LPCTSTR instead of LPCSTR , and probably, your code will be happy with this (since it is a UNICODE build).
(3) If you try point (2) and it doesn't work (maybe there is explicit use of ANSI functions in your code) the you have to convert the wide-character string to the ANSI counterpart
(may use WideCharToMultiByte for the purpose).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
neha.agarwal27 wrote: LPCSTR lpszBuf = onlyFName.GetBuffer(nLen);
Since VS2005 defaults to Unicode, simply change LPCSTR to LPCTSTR instead.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hai,
i am new to ISAPI Filter, i want a sample program in ISAPI filter to change the html content or Dispaly a text through the ISAPI filter.
how to do this..?
reply me
Jothi.G
Born to win...!
|
|
|
|
|
Can visual c++6 mfc convert the bmp file to pdf file ? If it can be how is it possible please give me some hints.
|
|
|
|
|
What about making a programm to open the bmp file, show it in the window and print it to the acrobat pdf distiller (phantom printer)?
If you want to make the transformation "on the fly" you will need to know how the pdf stores the data, how the bmp stores the data and make a conversion. I you have luck, searching in the web can give you some coded snippets, if you have to programm it by yourself... good luck.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Actually I have open the bmp file and need to convert in pdf (not to print) and i need to send that file through e-mail.
|
|
|
|
|
Adobe has a plugin that creates a phantom printer and creates a pdf. If you are able to print the bmp in a normal printer, then you are able to print the pdf.
Just save the bmp as a pdf... is going to be difficult. Not impossibl, but difficult (and I can not help u with it)
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Hello all,
Do anybody have some idea of the Rinjdael algorithm? I ahve encryt some data from this algo but i am not geeting anything accurate on web. Please tell me the logic of the algorithm.
Neema Jain
|
|
|
|
|
i.e. Mathematics and Algorithms
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Rijindael is a more flexible scheme of AES. Unlike AES which has a fixed block size, 128 bits, Rijindael supports both key size and block size of 128, 192 and 256 bits.
Which crypto API do you use? In general,
+ Since it is a block cipher, make sure you use the same cipher mode during Encryption and Decryption.
+ For ECB and CBC mode, you must process data in multiples of the block size.
+ Take care of data padding if needed.
+ Process your Initialization Vector properly
+ Of course you should verify the encryption key is the same as the decryption key
Toe the line
Thread the needle
Think outside of the box
|
|
|
|
|
Hi,
How to determine the cursorfocus whether it is in the dialog or on the control.
Thanks and Regards,
Mayank
|
|
|
|