Yes, STL containers are just template classes and can be manipulated the same as any class objects. And as such, a vector may contain objects, or pointers to objects. But remember in the second case that the items pointed to, must not be removed while the vector still owns them.
std::vector<char*>* pMyvec = newstd::vector<char*>(); // a pointer to a vector of pointers.
// use push_back to fill the vector with pointers:
// pass the vectro to a function:
int result = myfun(pMyvec);
// on return the contents may have been changed
BTW you should not use malloc in C++ code, as new and delete is the correct way to manage memory.
If you add an object to an STL container (vector, list, set, map...), the object is copied into the container. The objects must all be of the same type, however. The only way to put polymorphic objects into a container is to use a container of pointers to their common base class, in which case the objects need to survive outside the container, probably by having been allocated from the heap.
file.cpp(1701): error C2061: syntax error : identifier 'DirectorySearcher'
file.cpp(1701): error C2065: 'directorySearcher' : undeclared identifier
file.cpp(1701): error C2065: 'DirectorySearcher' : undeclared identifier
file.cpp(1702): error C2227: left of '->ClientTimeout' must point to class/struct/union
file.cpp(1268): error C2653: 'System' : is not a class or namespace name
file.cpp(1268): error C2871: 'DirectoryServices' : a namespace with this name does not exist
file.cpp(1702): error C3861: 'directorySearcher': identifier not found, even with argument-dependent lookup
By this way I need to set Request Timeout for SOAP WebService
Can you think about the problem to implement the use of DirectorySearcher class?
I have System.DirectoryServices.dll suitable exactly for my version of Microsoft .Net Framework 1.1 Version 1.1.4322.
Other versions of System.DirectoryServices.dll are refused to be added to the References folder in the project.
About to upgrade software that will be suitable to new Visual Studio version - it not so simple.
It is huge old software. I has performed conversion today but can not yet to see the result today. There were errors that conversion raised during it
Last Visit: 31-Dec-99 18:00 Last Update: 22-Sep-23 1:58