|
Yes, Now I can see it.
Is it is definitely a bug(Now we should say 'was', as VC 6 is no longer supported).
I wonder,How it goes unnoticed for such length of time.
May be, nobody is supposed to see implementation.
|
|
|
|
|
What documentation should i read?
Are there any books published (if yes, which ones should i buy),any good tutorials, where do i find the namespace's reference..?
Thanks
|
|
|
|
|
|
CodeProject site on the subject[^] is always a good place to start.
Before you begin you should be aware of what STL is in general.
STL stands for "Standard Template Library" and is a set of C++ templates to be used when creating common data structures such as arrays, lists, stacks, maps and so on.
If you don't know how to use templates and data structures mentioned above, or more important; when to use them, you should get yourself a book of basic C++ before taking the plounge into STL.
STL is like a toolbox with tools designed to solve different kinds of problems. You just have to know which tool to use in any given situation, otherwise the tool may become part of the problem.
Hope this helps
--
Roger
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998 "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above
|
|
|
|
|
I recommend The C++ Standard Library by Nicolai M. Josuttis - perfect for C++ programmers who have yet to take the STL plunge. It's pretty much my bible on the subject (along with Scott Meyers Effective STL book of course).
Amazon UK link[^]
Kicking squealing Gucci little piggy.
|
|
|
|
|
|
I agree 100% with you and Rob!
|
|
|
|
|
I agree 100% with you and you and Rob!
Kevin
|
|
|
|
|
Thanks. Just what i was looking for
|
|
|
|
|
I agree with you & him & him & him. Now Chris is not going to agree with all of us
|
|
|
|
|
Hi.
I'm writing an ATL control, (composite control), and handling some button message I need to load a cursor from resource. So I tried to use the API LoadCursor(hInstance, LPCTSTR lpCursorName) and I found that I need the instance of the control and I don't know where to find it.
With a regular MFC application I can call AfxGetApp()->m_hInstance but now it does'nt work in spite of my application class is derived from CWinApp because it support MFC.
So, how could I get the control hInstance needed for many API functions????
Thank you.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
I found it!
Is a member of CComModule, and there's a global object of CComModule called _Module.:->
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
Use _Module.GetResourceInstance() when loading resources.
|
|
|
|
|
Ok.
Thank you Mike.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
I have to create an ActiveX control from a huge .IDL file.
I have no problem creating a class to control the control but there seems to be a lot of leg work in writing out the declaration, definition, dispatch enumeration and dispatch map when creating the control class.
Apart from manually running through the properties and methods in the IDL file is there a way of automating this process instead?
Thanks
Tom
It will always be the bane of the civilized as to what to do with the barbarian
|
|
|
|
|
In VC6, once you'd built the IDL there was an 'implement interface' option. Can't remember exactly where, since I saw it demo-ed on a COM course once, and never used it myself, since I preferred to go through and do it by hand to help reinforce my memory
Don't know if there's an equivalent in later VS though, as I wouldn't use it if there was ...
Steve S
Developer for hire
|
|
|
|
|
Ummm - use ATL? That'll do the IDispatch implementation for you if you ask it nicely, as well as loads of other interfaces - I just created an ATL Control class in VS2003 and it looks like it'll implement these interfaces for you:
IDispatch, IPersistStreamInit, IOleControl, IOleObject, IOleInPlaceActiveObject, IViewObjectEx, IOleInPlaceObjectWindowless, IPersistStorage, ISpecifyPropertyPages, IQuickActivate, IDataObject, IProvideClassInfo2<br />
|
|
|
|
|
Thanks for the responses guys
I agree with your do it your self attitude but this interface has literally hundreds of events, methods and properties and I start to go a bit nuts after a while of doing that much repetitive work.
Unfortunately, I've failed at failed at finding any assistance from VC2005. so I've decided I'd rather write a parser myself than manually go through it all. Is there a document that lists the complete spec for IDL files? and would anyone be interested in me publishing the resulting app?
Thanks again
Tom
It will always be the bane of the civilised as to what to do with the barbarian
|
|
|
|
|
Would it be less work to use the type library instead of the IDL ?
Steve S
Developer for hire
|
|
|
|
|
Hi Steve
Hmmm... I'm not sure.
The control has to have all the functionality of the old contol but certain of the methods, events and properties require modification. It also has to fit into alot of legacy JavaScript functions and I can only change the GUID which luckily I put into a resource file but modifying the JavaScript is out of the question. The reason I say this is that I am unaware of how to achieve this effect using a type library. A nifty alternative would be great but I haven't thought of one.
Thanks
tom
|
|
|
|
|
OK - I think I've got an automated solution for you. Note - this was done with VS2003...
- Create an ATL DLL project.
- Add an 'ATL Control' class. Use some throwaway name for the control interface (because you *will* be throwing it away ), but make sure the class names are ones you're happy with.
- Copy'n'paste your IDL interface into the new projects IDL file
- In the Class View, right click the ATL Control class and select Add->Implement Interface... The interface you want to implement should be in the dialog that appears. Select it and click Finish. This should create bare method definitions.
Note that I've not determined what happens to event definitions.
|
|
|
|
|
Fantastic solution
Worked like a treat! Events too!
Thanks loads
Tom
It will always be the bane of the civilised as to what to do with the barbarian
|
|
|
|
|
Ah. That's how you get to it. I knew it was around here somewhere
Steve S
Developer for hire
|
|
|
|
|
Hi all,
I am a beginner in ATL programming . How I can use IHTMLDocument2 or IWebBrowser2 Objects in my ATL programme made by using "Simple Object"
Please Help me,
Thanks in Advance
George K Jolly
-- modified at 2:16 Tuesday 3rd October, 2006
|
|
|
|
|
Typically you use the standard COM connection point mechanism to receive events.
Steve
|
|
|
|