|
I'm trying to figure out a way to easily parse and formating date/time values using STL. Unfortunately, I can't seem to find much information regarding the time_get and time_put facets. I can use strftime and the other associated crt calls but I would prefer to stay in stl for this if I can.
Does anyone have a good sample, or reference to a sample on how to do this?
Thanks in advance,
Shawn Nagase
|
|
|
|
|
Does anybody knows how can I solved the following problem.
When I make a ATL Project with the ATL/WTL AppWizard and I try to use the ClassWizard, I get the following error:
The ClassWizard database c:\app\app.clw does not exist. Would you like to build it from your sorce files?
After selecting my source files, it won't rebuildem.
Does anybody knoes how can I correct(prevent) this problem.
This happens also in my first time Visual C++ installation.
|
|
|
|
|
ClassWizard is for MFC apps. For ATL, you can right-click a class in ClassView, and if it's a window class the menu will have "add message handler" and other commands for adding handlers to the ATL msg map.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
duh!!! sorry for the expression.. but you dont use the class wizard in ATL dude.. that;s for MFC !! forget ATL if you wanna stick to classwizard... or mebbe vice versa! LOL
happy programming
One more addition to the addiction of coding!
If you want a helping hand, you'll find one at the end of your arm.
|
|
|
|
|
Environnement: VC6, ATL3, Win98
Here's my problem: I followed Michael Dunn's article[^] but instead of using simple controls, I create dynamically an instance of an activeX control, to place it on the added property page. I use the function CreateWindow in the OnInitDialog function, with the parameters "AtlAxWindow" and the CLSID of the activeX I want.
<br />
BOOL OnInitDialog(HWND hwnd, LPARAM lParam)<br />
{<br />
[...].br />
HWND hCtrl = CreateWindow("AtlAxWin", _T("{BA9DD568-114B-11D4-98DA-00104B458137}"), WS_VISIBLE | WS_CHILD, x, y, iWidth, iHeight, hwnd, (HMENU) IDI_MYACTIVEX, _Module.GetModuleInstance(), NULL);<br />
[...].br />
}<br />
If this works nicely on Win95, WinME, Win2000 and WinXP, the creation of the activeX blocks under Win98, at least with non-microsoft ActiveX. The Shell extension is frozen as is explorer
Does anybody have any clue of what may be happen, or if there are known issues about Shell extensions with W98?
TIA!
K.
Who gives a f*ck
If my life sucks ?
I just know one day
I won't give up
Beg For Me/KoЯn
|
|
|
|
|
Hi,
I have to loop through a large amount of text messages, and for each of these messages, I have to tokenize every words. I find it quite slow, for example, tokenizing 300 messages takes around half an hour! Each message can take from 1/4 of a sec. to ~30 secs.
I'm using these caracters to determine the tokens separators:
"% #=+,&*[]”“…:/(){}!®<>.\\|;~?`^¿\"\n\a\b\f\r\t\v"
Why is it so slow? Is there a faster way to retreive tokens?
Thanks!
---------------
Concentrating on Ideas
http://www.edovia.com
|
|
|
|
|
That is one hell of a list of tokens there. CStringT is going to be using mbsspn which will run slower if you just need ASCII. Also, even if you are just using strspn, it will have to build a bitmask of the valid terminators each call. LOTS of wasted time.
I would just toss CStringT and work with a character array directly. Build yourself a mask of the valid terminators and scan the string by hand. You will be shocked at how fast your program will run.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
I wrote an ActiveX control. This control read a bitmap and resize itself to the bitmap.
I set m_bAutoSize to TRUE. And use SetWindowPos to set it's size. But it just can't work. What can I do? Thanks
|
|
|
|
|
Why is there an "erase" function *and* a "remove" function in STL lists? Wouldn't a single overloaded function have served equally well?
What's the difference between the two? Why would you use one over the other?
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
erase works on iterators
remove works on the value stored in the list.
hence
list<int> int_list;
int_list.push_back(1);
int_list.push_back(2);
int_list.push_back(2);
int_list.remove(2); //removes both the 2s stored in the list
int_list.erase(int_list.begin(), int_list.end()); // remove all items
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Because the naming in STL sucks. begin() is a verb yet it doesn't actually do any action. empty() isn't clear unless you memorize what it does (does it empty the list, or check if it is empty?). And so on.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Yeah, I was always told that STL was so efficient and logical. Bull pucky.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
I have a love/hate relationship with STL too. So many great jewels in a sea of ****.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Do anyone know a technical discussion article as to detrmining the number of items at which a map becomes more expensive than a hash_map. Say, if there is a map of 10 items, I would assume that hash_map would fare worse than a map; and the reverse would be true if the number of items were a 100,000. But, is there a way to determine this based on an understanding of how these containers work internally?
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Herb Sutter wrote an article talking about the difference between hash_map and map.
http://www.cuj.com/experts/2005/hyslop.htm[^]
However, the standard hash_map can be very brain dead. I have found that if I am that worried about performance, my own hash table does better (2-3 times faster than STLPort's (yes in release mode for all of you who think STL can do no wrong)). But in each case I had special needs. In the first case, my hash_map was VERY dynamic. STL's brain dead hash_map loves to rehash at the drop of a hat and thus was wasting a lot of time. I actually got better performance by fixing my hash size at 17 (a prime since I was hashing addresses) and using my own hash class.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Hey, you might consider posting your hash_map to CP (STL section is currently so meager).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Actually, it isn't a template. It is straight plain C/C++. All I really did was fix the hash width and then store the hash information in the actual objects being hashed. Thus you get rid of any extra allocated memory devoted just to the hash map.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Can anyone tell me how to permanently disable the STL compile warnings that I get each time I compile my code in debug.
The specific warning is C4786.
I am using Visual C++ 6.0 with SP5 and I am using the MS provided version of STL. Will moving to STLPort fix this?
|
|
|
|
|
What has always worked for me was to #pragma -down the warning level, and disable that specific warning.
This is what I use in a current project:
<br />
#pragma warning( push, 1 )<br />
#pragma warning( disable:4786 )<br />
#include <vector><br />
#include <iterator><br />
#include <string><br />
#include <map><br />
#include <stack><br />
#include <vector><br />
#include <xtree><br />
#pragma warning( pop )<br />
Peace!
-=- James (Sonork:100.21837)
"There is nothing worse than being oblivious to the fact that you do not know what you are doing."
[Get Check Favorites 1.5 Now!]
|
|
|
|
|
Thanks for the quick reply. I will try it out ASAP.
|
|
|
|
|
James R. Twine wrote:
#pragma warning( push, 1 )
what does this do?
modified 29-Aug-18 21:01pm.
|
|
|
|
|
> > #pragma warning( push, 1 )
>
> what does this do?
That pushes the current warning level/state onto an internal stack and changes the warning level to 1 . The corresponding pop restores (pops) the previous warning level back.
Note that when you pop , any warnings that were specifically disabled/modified after push will return to their previous state.
Peace!
-=- James (Sonork:100.21837)
"There is nothing worse than being oblivious to the fact that you do not know what you are doing."
[Get Check Favorites 1.5 Now!]
|
|
|
|
|
I am somewhat new to proxy stubs. I have been playing around with building a proxy stub. So, I used VC6's to create ATL COM exe.
I have added a method to the interface and everything compiles and links and all that.
Now, I am trying to use CoCreateInstanceEx to instantiate this interface in my client application with the CLSID of my interface and using the CLSCTX_SERVER parameter. Everything compiles and links on the client as well, but when it gets to the CreateInstance part, I get an HR that indicates the Interface is not supported.
I am not sure if this is an open-ended question or not, but is there an easy fix to this? Have I missed a step or something?
thanks
|
|
|
|
|
IIRC, a proxy/stub is required when crossing apartments or remoting (DCOM). Have you built the ATL COM object with merged proxy/stub code?
Peace!
-=- James (Sonork:100.21837)
"There is nothing worse than being oblivious to the fact that you do not know what you are doing."
[Get Check Favorites 1.5 Now!]
|
|
|
|
|
I'm working on a new shell extension (I've written them before, just not this kind...) implementing IShellExtInit and IContextMenu. IShellExtInit::Initialize works correctly - but is called a random number of times (seems to depend on how long it takes me to step throuh the code) for a single action in Explorer. After about 1 to 3 times, the debugger breaks to this colling block of code:
<br />
template <class T, const IID* piid = &__uuidof(T), const GUID* plibid = &CAtlModule::m_libid, WORD wMajor = 1,<br />
WORD wMinor = 0, class tihclass = CComTypeInfoHolder><br />
class ATL_NO_VTABLE IDispatchImpl : public T<br />
{<br />
public:<br />
typedef tihclass _tihclass;<br />
STDMETHOD(GetTypeInfoCount)(UINT* pctinfo)<br />
{<br />
*pctinfo = 1; <br />
return S_OK;<br />
}<br />
The interface and typelib GUID for the template are mine (and other COM automation servers in the library work). What could be causing this problem?
I've tried approaching it from many different angles, but have yet to figure out 1) why IShellExtInit::Initialize is getting called multiple times before IContextMenu is even QI'd, and 2) why it'd break here (I'm sure it's related to #1).
TIA
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|