|
First I have to say, I like WTL so far and have decided to create a control instead of using MFC, my only question is this...actually i think i know the answer, but i'm not sure how...
How do I include an WTL control (mycontrol.h) in an MFC project???
What steps are required...?
Thanks...
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
My project compiles and builds and runs fine for debugging but when I try to build the release version I get the following error. Anyone ever seen this before?
error C2065: '_AtlModule' : undeclared identifier
I should mention that I was able to build the release before without a problem, then one day this showed up. I'm not sure what is going on. TIA for any assistance.
Matt (Padawan Learner)
|
|
|
|
|
Hi all,
I have an application written in C++ using win32, it creates a few windows, has a menu etc. Nothing fancy. But it's becomming a major pain to add new windows, fancy controls and whatnot so I thought about using WTL instead of the raw API's.
Is that feasible? The app works fine right now so I would like to create the new windows using WTL, the existing may be converted in the future.
.Henrik
---
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
|
|
|
|
|
Yep, it's pretty easy.- Remove your include of windows.h; instead, include atlbase.h, atlapp.h, then whatever other ATL/WTL headers you need.
- Right after the atlapp.h include, add
extern CAppModule _Module; - In one of your CPP files, declare the global
CAppModule _Module; - At the beginning of
WinMain() , call _Module.Init(NULL, hInstance); (where hInstance is the 1st param to WinMain() ).
--Mike--
Eh! Steve!
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Great, I'll give it a try.
Thanks for the info.
---
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
|
|
|
|
|
Hi All,
I am working on a Windows browser sort of a thing and building it in ATL domain. The problem I am facing is that I can't "Cut" a file from a given location. I have "Copied" a file and "Pasted" it but I don't know how to "Cut" a file.
Can anybody help me????
Best regards,
Pious.
|
|
|
|
|
Cut/Paste == Copy + Delete.
Copy from old location to new, then delete from the old location.
-Sean
----
Shag a Lizard
|
|
|
|
|
Is this a MS specific library?
For instance could I use WTL in say Bloodshed C++? I'm not sure if the ming(??) compiler supports templates or not?
Anyways, if I can use WTL in VC++ and bloodshed...that would be super...
Thanks
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
I believe ATL is MS-specific - I think it uses some MS extensions, such as __uuidof , in places. Looking at the WTL code, the only thing I can see (in a small sample of the code) is the use of #pragma once .
Best thing to do is to try compiling some WTL code and see what happens!!!!
If you're not tied to GCC, you could try the Borland or Watcom C++ compilers - they're both freely downloadable....
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
How can I shift all the items on a stack up by one?
Item1
Item2
Item3
Item4
After shifting up by one you would have
Item2
Item3
Item4
Item5
Do I have to create a temp stack? Or is there any way I can access each item in the stack like vector? A quick hack maybe...I just think swapping the values (except index 0 which would overwritten) would be more efficient the creating a temp stack (or popping the values off into a vector, then copying the vector values over to the new stack)
Anyways...if I made myself clear and you understand what i'm trying to do...can this be accomplished???
Thanks
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
One solution is to use a list or a deque container that way you can add elements from both ends.
Kuphryn
|
|
|
|
|
You can use a stack::iterator and iterate through elements in the stack.
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
i find CArry class in mfc quite convenient to use, then can we use it in wtl?
modified 1-May-21 21:01pm.
|
|
|
|
|
I am not sure if you can without MFC, but I suggest that it is better to learn STL. I have a lot of old code that uses the MFC template classes and I wish I would have switched to STL sooner. The only problem is STL is a lot harder to learn to use, however it is worth the extra time because STL is way more powerful than MFC template classes and also more portable.
John
|
|
|
|
|
|
Michael Dunn wrote:
You can use the STL equivalent, std::vector
:-DI can use CAtlArray instead.
modified 1-May-21 21:01pm.
|
|
|
|
|
Yes, but why would you ? Seriously, why are people so scared of learning STL, when it's so much better ?
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
CAtlArray has some advantages over std::vector. For one it is a LOT like the old (and crappy) CArray. It also produces a lot smaller code than std::vector.
Now that being said, I have to agree that people should take the plunge and learn STL so they can make intelligent decisions on when to use which container. If I was doing a project with STL already in it, std::vector is a no brainer. However, if I was doing a pure WTL/ATL program with no STL and didn't need all the nice STL features, I would have no problem using CAtlArray.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
STL requires CRT, doesn't it?
|
|
|
|
|
I doubt it.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
From "Avoiding the Visual C++ Runtime Library By Matthew Wilson"[^]:
The implementation of some of the STL classes that ship with Visual C++ means that the CRT Library is required for some, but not all, parts of the STL Library. For example, if you declare a single string, with a literal string constructor argument, the linker reports that it cannot see the following symbols:
"void __cdecl std::_Xlen(void)"
(?_Xlen@std@@YAXXZ)
___CxxFrameHandler
__except_list
__EH_prolog
Also, virtually no parts of the iostreams are usable without the CRT Library.
However, other parts of the library are eminently usable without the CRT Library, including auto_ptr, list, map, and vector, along with the algorithms and functionals.
|
|
|
|
|
I`m writing my own thesaurus, and I have some problem:
How to find a word (CString) in multimap and get index (int) of this word?
Can somebody tell me where I can find some examples of thesauruses in VC++
Hegemon
|
|
|
|
|
You can find the word by using the multimap container's find method. As for the index to the word, what do you mean by that? There are no indexes in maps, per-say; however, you can get an iterator that references the matched pair (Which I gather is a CString-to-int), but not an integer (unless you mean the int that is paired with the CString in which case you would just dereference the iterator returned by find and access the second data members).
cheers,
-B
|
|
|
|
|
modified 1-May-21 21:01pm.
|
|
|
|
|
chain to the base class. Reflect to local controls in the class.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|