|
BSTR are an example of managed string that require you to use the Sys**** routines to manage the memory. However, other strings such as simple char or WCHAR strings are just arrays of characters. ATL uses this fact to store the temporary strings created by A2W or W2A (etc) on the stack (ATL3). Thus when the routine returns, the stack is automatically freed and the memory goes away properly.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
|
Hello everyone:
I need a WTL control in which tree and list is mixed. Please tell me where it is and some sample about it.
Thank you.
-Freehawk
|
|
|
|
|
|
Iam currently in the processing of producing a 3d vector graphics control that is based in an activeX control. Currently all of my data to define the 3d objects used in this control in hardcoded into the control. Obviously Iam very keen to remove this hardcoded data and the control retrieve the data from an external source IE a file.
Ive done some research into this and it seems like I may be wanting to use URLdownloadToFile to retrieve the information from a file. Is it correct that I will need to use this? And also how will I bind this data to a property of the activeX control? Obviously it would be desirable to have this information assigned to a property of the control after its instantiation in the HTML page or have it declared as a parameter upon control creation? Ideas n e 1???
(PS if it helps my control is very similar to such controls as macromedia shockwaves and cult3d which are all data driven exactly like I want mine to be)
[] /\ () X
|
|
|
|
|
Hi gurus,
I'm working on a ATL plug-in for MS Outlook, but I would like to make it work on Outlook Express as well. I understand that it's not possilble via COM technology (as OE does not expose any COM interfaces ), but something with hooks? Any documentation on the subject?
Any help / hint would be much appreciated.
Thanks in advance,
Doru K.
|
|
|
|
|
Hi everybody,
Does anybody know, how I can derive from an ATL object?
I have an ATL 3.0 project and I want to have a base class (suppose CMyBase) with some members, and an interface (suppose IMyBase) with some exposed methods and properties. how do I create a new ATL object that is derived from that class? I mean that the new ATL object inherits members from CMyBase and methods and properties from IMyBase.
Regards,
Roozbeh.
|
|
|
|
|
I am new to C++ and the container classes provided by the standard library (i.e. vector, list, map). Is it bad practice to subclass from a container class in order to add some specific semantics about a desired operation? A simple example would look like:
class MyClassContainer : vector<MyClass><br />
{<br />
bool addMyClass(MyClass &myObject)<br />
{<br />
push_back(myObject);<br />
};<br />
};
or is it better to create a class that contains a vector and define operations in terms of the member variable? The vector would be returned via some type of accessor method.
|
|
|
|
|
Actually, you can approach this two ways:
You already have a MyClass type stl::vector . Do you really need a class?
typedef MyClassVector vector<MyClass>;
The above is sufficient if you don't need anything more than MyClass vector functionality.
The other way is to contain a vector<MyClass> member variable and have type-safe accessors for your containing class as well as validation checks.
Either way is ok. The decision lies in how you will use it. The former would have no additional functionality while the latter can provide more services.
|
|
|
|
|
Thanks for response Ian. This information is helpful. I guess I will attack my problem with your second method. My goal is to provide a container class that will provide some functionality above that provided by the standard container classes. I also want to be able to use some of the standard algorithims (for_each, remove_if, sort) on the class. My original thinking was to subclass a container class so that:
1. I could add the additional services that I need (e.g. a time stamp of when the collection was generated and a method for updating the objects in the collection)
2. Have access to the iterators of the standard container classes...
3. Prevent my application from knowing whether a list, vector, map, multimap... etc. was used to contain the objects so that I could change this at some later date.
As I think that I have a finite number of operations that I wish to inherit from the base class (i.e. begin(), end(), insert()/push_back(), size(), at(), []) I think that I can wrap these calls inside of member functions and still accomplish goal numbers 2 and 3.
Again thanks.
|
|
|
|
|
If you don't want to expose the underlying collection as in 3; for number 2, you could provide an enumerator class (only creatable by your collection class) which exposes these methods:
MoveNext - which moves the iterator, e.g., it++ and returns a bool of true if the next item exists, false if not.
GetCurrent - which returns the current MyClass item, e.g., *it , or NULL if it doesn't exist.
|
|
|
|
|
STL containers don't have virtual destructors, so inheriting from them is, by definition, 'bad practice', although there are always exceptions, pragmatic or otherwise....
If your 'MyClassContainer' isn't actually a 'vector' but uses a vector to implement some other form of container then containment as a member is a good approach. For instance the STL 'stack' is implemented in terms of another container, but not using inheritance. In this case a 'stack' is not a 'vector'.
std::vector has no protected members, and no virtual functions. In this case inheritance seems inappropriate. I would implement your additional functionality as plain old functions that take a reference to a suitable vector as an argument. You could even use some templatry to make things more general,
<br />
template< typename C, typename T> void addT ( C& c, T& t )<br />
{<br />
c.push_back ( t ) ;<br />
}<br />
<br />
vector<MyClass> v ;<br />
addT ( v, MyClass ()) ;<br />
etc.
Paul
|
|
|
|
|
I am using an Sproxy call from an unmanaged C++ DLL to a webservice. In my web.config I am using windows authentication, impersonate = true, and allow users is "*". For the website if the security is set to allow anonymous users, then the component call succeeds. If I turn off anonymous users then the component call fails.
It doesn't appear that the windows identity is being passed with Sproxy. What I had wanted to do was to turn anonymous users off, deny users "*" and allow users "domain/each_user" where "domain/each_user" = the users I wanted to allow access to the service. The method that I describe works if users access the service from their individual IE, but it will not work from the component running on their PC.
Any help would be appreciated.
|
|
|
|
|
Hi,
Assume, I have a parametrized class:
template <class A>
class CBase
{
public:
CBase() {};
~CBase() {};
}
Can I subclass this file as the follows:
template <class A>
class CBaseSub : public CBase <A>
{
public:
CBaseSub() {};
~CBaseSub() {};
}
Visual C++ 6.0 allows such subclassing but Rational Rose 2001 doesn't allow (it told me 'Cannot subclass from parameterized class').
What is true? Can I subclass from parameterized class?
Sincerely Yours,
RadioShark
|
|
|
|
|
The code is perfectly correct. In fact, subclassing from class templates is a fairly common idiom in many situations. UMS is wrong, God knows why.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
OnSize() appears to be called after OnDestroy() for the view of a wizard generated ATL/WTL SDI. This is not the case for an MDI.
Anyone else encountered this? This was unexpected behavior, and while it's easy to work around, seems somewhat undesirable.
-john
|
|
|
|
|
Hello, everyone,
In my current project, I want to display xp style button(OK, Cancel and Apply) in the properties sheet.
If I do it using MFC, it would be very easy. I just need to
m_btnXPButton.SubclassWindow(GetDlgItem(ID_APPLY_NOW)->m_hWand);
But when I tried to do the same thing in ATL, the returned handle for ID_APPLY_NOW (IDOK and IDCANCEL) is NULL.
How can I get the handle of a control in the properties sheet written in ATL.
Thanks a lot in advance.
bin
|
|
|
|
|
Hello everyone:
In my pc, VC6.0 has been installed, I downloaded the wtl zip file from
http://www.microsoft.com/downloads/details.aspx?familyid=128E26EE-2112-4CF7-B28E-7727D9A1F288&displaylang=en
and intalled it.
do I need to install other software or SDK ?
Thank you.
-Freehawk
|
|
|
|
|
No, although you might find the Platform SDK useful too.
You will need to make sure the WTL include folder is in the list of folders to search (tools/options/directories).
Steve S
|
|
|
|
|
|
Thank you for the fast reply.
Please tell me Where Platform SDK is.
-Freehawk.
|
|
|
|
|
|
Thank you.
But I dont know what SDK is required by WTL.
Please tell me.
-Freehawk
|
|
|
|
|
No sdk upgrade is required for WTL (afaik). You shouldn't need anything but the WTL.
|
|
|
|
|
Did you run the AppWiz60 setup script? I think that's all you need to do. It should add the directories to the ide.
|
|
|
|