|
According instruction, I try to install WTL 7.0 step by step. The wizard icon appears in the new/project dialog, but when I create a new project, it said: Object with program ID VsWizard.VsWizardEngine can not be created. Why? Could you help me? Thank you.
|
|
|
|
|
The WTL 7.0 Wizard isn't immediately compatible with VS.NET 2003 (there's some registry key differences). However, it can be fixed See this[^]
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Ah! Thank you! I found out about this little problem earlier today.
--
Im hayu samim et hamo'ach shelcha betoch tsipor, hi hayta matchila la'uf achora!
|
|
|
|
|
Considering a vector could grow, is it wise to make vectors (and other STL containers) part of a class definition?
If it's OK, is there a way to do it safely?
Thanks.
William
Fortes in fide et opere!
|
|
|
|
|
You mean as members of a class??? Yes, it's safe - they manage space allocated on the heap, not in the class itself (i.e. the vector object just contains a pointer to it's contents).
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Thanks for replying, and thanks for the reassurance.
I was beginning to suspect a program I'm currently working with, was causing all the problems I was experiencing from it because of the vectors (of strings) that were defined in one of its classes. The vectors were growing by leaps and bounds and I was suspecting the extra memory they were using, were encroaching in other territories.
William
Fortes in fide et opere!
|
|
|
|
|
Why do you think that a vector growing is a bad thing?
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
Hi Dears
I've created an Exchange 2000 Store Event Sink in Visual C++ using
______________________________________________________
http://support.microsoft.com/default.aspx?scid=kb;en-us;288156
------------------------------------------------------
I've also created a COM+ Event Sink Application usin
________________________________________________________
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/wsst_create_a_com_event_sink_application.asp
--------------------------------------------------------
Now I have to register my "Event Sink"
There is some guidance on thr URL
___________________________________________________
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/wsst_registering_an_event_sink.asp
---------------------------------------------------
But I think it's for Visual Basic not for Visual C++ implementation
Please help me...................
I'll be very grateful to you.
Kind Regards
Atif
Watch Your Thoughts for they will become your actions.
Watch Your Actions for they will become your habits.
Watch Your Habits for they will become your beliefs.
Watch Your Beliefs for they will determine your destiny.
|
|
|
|
|
// define interface
IEnumString* pEnumStr;
...
|
|
|
|
|
STL messages output by VC++ 6.0 compiler is something that should be shun at any cost. Is there a way someone can get something more sane from the compiler when it is outputting STL messages?
Is there a way to suppress STL warning messages?
Thanks.
William
Fortes in fide et opere!
|
|
|
|
|
One solution is to set the compiler error/warning level under configuration properties.
Kuphryn
|
|
|
|
|
There are a few things that you can try. If you build with your warning level at 3 which is the default setting you can get rid of most of the warnings by using:
#pragma warning(disable:4786)
which solves warning C4786 - 'identifier' : identifier was truncated to 'number' characters in the debug information. It's perfectly safe to do that, Microsoft say it's a limitation of the debugger rather than the compiler.
If you need to run at warning level 4, you can try the article STL without warnings[^]
If you're having trouble you can have a look at an STL Error Decryptor at STLFilt: An STL Error Message Decryptor for C++[^]
Most of the STL Error Decryptors are based on the material from the CUJ article by Leor Zolman, An STL Error Message Decryptor for Visual C++[^]
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
|
Hi,
I want to create an ATL componenet or
control that "catches" all windows messages for a specific hWnd and raises its
own event. Basically I want to be able to create an instance of the control,
pass to it an hWnd and whenever that hWnd receives a windows message I want it
to raise an event. The primary use will be to allow eVB users to subclass
controls.Pls help.Pls provide any sampls or links if possible.
Thnks in advance
Ram
|
|
|
|
|
Hi,
I have a class similar to the one below:
class CBook{
public:
char m_szAuthor[256];
char m_szBookname[256];
long m_nID;
};
I need to store a list of thousands of CBook objects. I need to do sorting on the list.
Assuming that I am going to use the std::list STL object, would it be better for me to create a list of objects or of pointers?
ie: list<cbook> or list<cbook*> ?
What are the advantages/disadvantages of each?
Thanks in advance,
Jeremy.
Jeremy Pullicino
C++ Developer
Homepage
|
|
|
|
|
It depends on how 'expensive' copying your objects is. If all you need to coppy is two pointers to strings (std::string or CString ) and a long int, probably having a list < Book > is OK. But if you need to store a lot of data in your objects, copying around the elements gets expensive.
The downside for a list < Book* > is that you need to provide all kind of sorting functionality yourself (as you do not want to sort on your pointers numerical value, but on the property of the underlying object. You end up writing a lot of functors yourself.
Maybe you can write some sort of proxy-class, which contains a pointer to a Book-object with all the data, and provides the needed operators to get sorted automatically by the STL-build in routines. operator!=() and operator<() should be sufficient for sorting. Additionally you would probably need constructor/destructor, copy-constructor and assignment-operator, You would then have the best of both worlds: Transparent working with the proxy-objects and cheap copying.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Thanks for your quick and comprehensive answer.
Are you aware of any such proxy-objects? Perhaps auto_ptr would do the trick?
Copying could be quite expensive since much more data could exist in the CBook class.
Jeremy Pullicino
C++ Developer
Homepage
|
|
|
|
|
Never ever put an auto_ptr in a standard container.
auto_ptr has a funny copy semantic, and you end up with your objects getting deleted while being copied.
You could use boosts[^]shared_ptr, which does reference counting and has a more intuitive copy semantic.
Or you can simply make your own class: Constructor that takes an Book-object, a few Get/Set functions for the underlying object, assignment-op and copy constructor that deletes its contained object and takes ownership of the new one and a set of operators that access the contained Book-object to determine the sorting sequence.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
All of the sort algorithm's in STL have approximately O(N log N) complexity.
Maps on the other hand have an insertion complexity of O(N * log(size() + N)), so it may be quicker to add all of the books to a map, which is always sorted rather than having to do it explicitly. It may depend on the application.
SGI STL Complexity[^]
jhwurmbach correctly pointed out that using pointers will be cheaper, but missed that the sort algorithms can optionally take a predicate. In cases like this, you are almost always going to use a functor to sort your data based on your criteria.
jhwurmbach wrote
Maybe you can write some sort of proxy-class. ... Additionally you would probably need ...
This isn't really true, raw pointers are fine, you don't need anything extra in the container, the extra stuff will go into the sort criteria function object.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Hello,
I would like to insert an element into a list container during iteration.
How would I do that? Please refer my comment in the code.
<br />
list<long> myList;<br />
myList.push_back(2);<br />
myList.push_back(4);<br />
myList.push_back(6);<br />
myList.push_back(8);<br />
myList.push_back(10);<br />
myList.push_back(12);<br />
myList.push_back(14);<br />
<br />
list<long>::iterator lItemItr;<br />
for(lItemItr= myList.begin(); lItemItr!= myList.end(); lItemItr++)<br />
{<br />
if(*lItemItr == 8)<br />
myList.insert( lItemItr + 1, *lItemItr);
}
How would I do that?
thank you
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
If you want to insert after the 10, you need to compare with 10, not withsome other number!?!
Also, MSDN states about std::list::insert: "Each of the member functions inserts, before the element pointed to by it in the controlled sequence, a sequence specified by the remaining operands. The first member function inserts a single element with value x and returns an iterator that points to the newly inserted element."
SO, this lines should work:
if (*lItemIter == 10)
{
lItemIter++;
list<long>::iterator newElem = myList.insert (lItemIter, 8);
}
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Probably I would play around with the return "newElem" to do some trick here.
thanks
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
<br />
list<<long>>::iterator lItemItr;<br />
for(lItemItr= myList.begin(); lItemItr!= myList.end(); lItemItr++)<br />
{<br />
if(*lItemItr == 10) myList.insert( lItemItr , 8);<br />
}
Jeremy Pullicino
C++ Developer
Homepage
|
|
|
|
|
Of course, I could just do it this way but this codes is just to demonstrate my another problem. It is not my actual problem. My actual problem is way too long to be explained here.
In short. I do not want to insert in this direct way.
if(*lItemItr == 10) myList.insert( lItemItr , 8);
I want to insert during if(*lItemItr == 8)
Any idea?
thank you
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Anthony_Yio wrote:
I want to insert during if(*lItemItr == 8)
Any idea?
No.
Insert during a comparsion? How could that work?
Do you mean you want to assign to some iterator?
I am sorry, but as long as your actual problem is way too long to be explained, you will get only solutions that are way too short to be helpful.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|