|
I have an ATL service (ATL 3). I'd like to create a hidden window to send messages to from one of my threads.
What is the best way to approach this? Is WTL needed or would the standard ATL window classes do the job?
Any recommended reading and examples so that I can understand the principles better?
Michael
Time flies like an arrow. Fruit flies like a banana
|
|
|
|
|
For a plain-jane window, just use CWindowImpl.
class CMySvcWindow : public CWindowImpl<CMySvcWindow> and give it a message map.
--Mike--
Just released - RightClick-Encrypt v1.3 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Im trying to program an STL version of sprints and sscans using stl strings to format a variable number of arguments and print to or read from a string, but have become hopelessly lost in format flags/precisions etc.
Function headers i would like to expose are:
int SPrintS( std::string buffer, const std::string format, ...);
... and ...
int SScanS( std::string buffer, const std::string format, ...);
Both functions return the number of chars read/written to the string or -1 on conversion failure.
In the implementation of these functions i dont want to call the c version of sprints or sscans (or svprintf etc).
I understand how to deal with variable arguments, the problem im having is in parsing the format specifier, it takes the general form:
%[flags] [width] [.precision] [{h | l | I64 | L}]type
My attempts at a parse function always seems to become unruly then break down before it can cope with the complete range of optional prefixes to a type (those within [] ), that coupled with format strings can contain any number of format specifiers.
Any suggstions as to the way forward would be welcomed.
|
|
|
|
|
Easiest route is to take a look at the GNU source code for sprintf and see how theyve done it!
|
|
|
|
|
|
thanks guys
|
|
|
|
|
|
Hello there !!!!
Excusme for my crazy question
But can you tell what is WTL ?
Regards,
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
It is a Win32 framework that is written in the same style as ATL. It stands for Windows Template Library. It is a set of templates that wrap the basic windowing functions and objects in the Win32 API, and it is a great alternative to MFC.
WTL produces very small and efficient applications that do not need to link to any external DLL's like MFC.
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!
|
|
|
|
|
Thanks for reply ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I read the other threads here, downloaded the MS SDK core and cannot locate any of the wtl files. Also read and downloaded the WTL files from the link in the artle "Introduction To WTL Part I" on this site. The read-me file says that it is version 3.1, not version 7 as described in other threads here.
So where is version 7?
|
|
|
|
|
|
Hi,
i want to return a collection from my ATL-Component to Simple VBAppl. I
have gone through the example of MSDN in which it is using the Interface
"ICollectionOnSTLImpl ", but in that Example it is returning a particular
value as per the given Index or key and i am looking for returning whole
collection.
There is Data member "m_coll" of "ICollectionOnSTLImpl" it holds the
collection values. Is there any way to return "m_coll" from ATL-Component
? or any other way to return Collection type from COM.
Thanking you,
Regards,
Shailaja
|
|
|
|
|
You don't return a collection, a collection is only for holding and iterating through items. What you want is a SAFEARRAY. See Q207931[^] for some sample code. Scenario 3 in the article is the one that applies to your situation.
--Mike--
Just released - RightClick-Encrypt v1.3 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
This class may also be helpful
http://www.codeproject.com/cpp/VariantArray.asp
|
|
|
|
|
Once upon a time I tried wrapping my head around MFC. In the end I decided that I hated it. Perhaps I didn't spend enough time with it but how much time does one really need to make a hello world?
Then I found ATL. I liked ATL because it was small and made sense it even had a windowing system to make gui apps with called "ATL Window Classes." They were great and supported by Microsoft.
Then came WTL. I found it when it was called 3.1 and I fell in love. It is just the extension to the ATL Window classes. In fact they are exactly the same at the root level. WTL just adds a whole bunch of new wrappers to bring the controls up to date.
Granted the lack of true documentation makes it a tad more difficult but any one who has done raw Win32 API programming will find the controls very similar. To find out the parameters all one has to do is find out what the WTL is wrapping and there you have it - Documenation.
The WTL support groups are also fantastic. They have always had an answer for me when I need them.
Three cheers for WTL!
|
|
|
|
|
I love it to, you need to know your c++ and the win32 api, then everything works like a charm.
MFC just adds a lot of limitations and wierd behaviour you have to work around.
/M
- Don't sweat the petty things, and don't pet the sweaty things.
|
|
|
|
|
Yay! My sentiments exactly. Having started Windows programming back in the dark days of Win16 (3.0/3.1) I have found WTL easy to use and being template based, extremely flexible. I don't think enough emphasis has been placed on the fact the library is a collection of C++ templates - which is a far more flexible approach than monolithic MFC.
Actually, I know one or two developers that won't go near WTL because they find C++ template programming too difficult! Madness.
So, hip-hip hooray for WTL. Nenad deserves a medal for his hard work.
Faith. Believing in something you *know* isn't true.
|
|
|
|
|
I've been developing in WTL for a few months and have submitted a few articles to CP. However, I'm wondering whether to scrap WTL and jump on the C# bandwagon. I'm starting to feel left behind. Most of the new articles seem to be C#/MC++/.NET.sucks stuff. I bought into fading technology once or twice in the past and got burned. Is WTL dying?
|
|
|
|
|
It has its own place. You don't need to give up anything to learn anything new. What is the problem in learning everything managed - unmanaged stuff?
|
|
|
|
|
It is possible to waste a lot of time learning things that are not productive. There are only so many days in a year and I need to pursue marketable skills.
|
|
|
|
|
WTL and .NET are two entirely different animals. There's no way to answer "which one should I use?" without knowing what you want to do. It's just like asking "Should I use MFC or .NET?".
As for whether it's dying... well, I don't know if it was ever really "living". It's always been an underground type of library, although I personally like it, and MS updated it recently to version 7 (which you can happily use with VC6).
--Mike--
Just released - RightClick-Encrypt v1.3 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I'm writing a personal credit manager for home PC users. It is pure client-based and (I think) a prime candidate for WTL. Multi-tier? No way. Web services? In the future, it may require a web link to obtain updated bank rates but that's for a future release.
Thanks for your response, Michael.
|
|
|
|
|
WTL was never born. It's a side project from a single Microsoft employee, and has been officially denounced by Microsoft. (http://windows.oreilly.com/news/visualc_0500.html[^])
I wasted 6 months on WTL.. it's going nowhere. Don't you make the same mistake!!
|
|
|
|
|
Dude, update your references. That interview pre-dates WTL 7, so MS has actively worked on it and updated it. And for something that was allegedly an accidental release and about to be recalled, it sure seems to be readily available as a download from (of all places) MSDN.
Again, any claims of having wasted time with it are meaningless without stating what you wanted to do with it in the first place.
--Mike--
Just released - RightClick-Encrypt v1.3 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|