|
|
Can someone show me how to send (save/Write) and receive (load/Read) data contained in a map and/or vector. class CData{ public: string one, two, three; CData() {}; ~CData() {} };
the map is declared as: map<string CData> DATA; How do I read/write it's data to a file ("MyMapFile.dat") ???
vector<CData> vecDATA; how do I read/write it's data to a file("MyVecDATA.dat") ???
I'm new to the STL and would need explicit examples that are known to work properly PLEASE.
C++ is my favorite programming language
|
|
|
|
|
You cannot automatically serialize STL objects to files. You must write your own file format. If you use only MFC then you can use CArray and CMap as containers and serialize with CArchive.
Regards,
Alexandru Savescu
|
|
|
|
|
|
Is it possible to get the title that is enclosed in the html as <title>My webpage</title>?
I have found that IWebBrowser2 have the GetProperty method, what are the properties of the page that we can get?
|
|
|
|
|
IWebBrowser2->GetDocument() will return the the docuement interface of the Loaded page.
wait a min i demonstrate that by code
<br />
IHTMLElementCollection *pColl=NULL;<br />
IHTMLElement *pEle=NULL;<br />
<br />
m_HtmDom->get_all(&pColl);<br />
MessageBox("yeah");<br />
<br />
CComVariant varTitle("title");<br />
CComVariant varIndex(0);<br />
IDispatch *pDisp;<br />
<br />
pColl->item(varTitle,varIndex,&pDisp);<br />
MessageBox("yeah1");<br />
<br />
if(pDisp)<br />
pDisp->QueryInterface(IID_IHTMLElement,(LPVOID*)&pEle);<br />
<br />
MessageBox("yeah3");<br />
if(pEle)<br />
{<br />
BSTR p;<br />
pEle->get_innerText(&p);<br />
MessageBoxW(NULL,p,L"",NULL);<br />
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
|
Modern programmers don't use nature and science for making programs. I am use. You may to make big and fast programs. There is no other solution.
<http: luckyware.tripod.com="">
Luckyware-tripod-com
Sory. E-Mail don't readed.
|
|
|
|
|
Don't drink and post
|
|
|
|
|
Abecedarian wrote:
Don't drink
iS he a Drinker!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
|
so what ? that's all ???
i'm quite sure you don't even know anything on what you are talking about...
you've got my vote : 1 !
... ok, move on now
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi
Can we use templates with variable argument list. Plz help me if anybody has the solution.
Thanks and Regards
Siji
|
|
|
|
|
The short answer is no. The long answer is no, but you can fake this feature. For instance, the following creates the illusion of a class template allowing for an arbitrary number of type parameters up to 10:
struct void_arg{};
template <
typename T0=void_arg,
typename T1=void_arg,
typename T2=void_arg,
typename T3=void_arg,
typename T4=void_arg,
typename T5=void_arg,
typename T6=void_arg,
typename T7=void_arg,
typename T8=void_arg,
typename T9=void_arg
>
class my_template
{
...
};
...
typedef my_template<int,char,double> foo; Note that void_arg is used as a marker meaning "no parameter specified". Now, the real problem is how to handle the variable number of parameters to do something useful: this will lead you to the realm of template metaprogramming (google for that.) Two libraries in Boost[^] named Boost.TypeTraits[^] and Boost MPL[^] are commonly used for doing template metaprogamming (beware, this is non-trivial stuff.)
If you have a specific problem where you want to take advantage of a variable number of template parameters, please post what you've got here and I can try to help a little.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
|
|
|
|
|
There is an interesting technique for simulating this feature described in this book[^] Maybe you can find the example on the book's web site.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
I have a WTL based application. In response to a particular user action, it is to create and show a new CFrameWindowImpl<> based window that includes a splitter and two client windows. This all works fine on my development computer. It does not work when I distribute to the computer that this application is suppose to be run on.
On the other computer, the two client windows are not being painted. Both computers are running Win2000 Service Pack 3.
Any clues?
|
|
|
|
|
|
Sorry, I found the answer shortly after posting the message and forgot to update my message here.
I wasn't calling PreTranslateMessage() for the two windows. Once I did this it started working perfectly.
|
|
|
|
|
I want to search word file(.doc) according the key word in the word file's content(not title^_^).who can tell me what i should do??thanks!!!
Jack
|
|
|
|
|
Please do not crosspost things like this. Start by opening the file and searching for keywords, ones with consistent formatting will be easy to spot.
Try opening the file in an editor and see what you can find. Have you even tried running strings on it?
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
I use CSingleLock and CMutex and a webservice in a multithread application, so I inlude <atlsoap.h> and <afxmt.h> in the "stdafx.h", then appear error information below:
error C2872 "CSemaphore" ambiguous symbol
error C2872 "CEvent" ambiguous symbol
error C2872 "CEvent" ambiguous symbol
how can i do to this,THX!
Big is Big.....
|
|
|
|
|
I don't know about ATLSoap but it presumably resides in a namespace. Try to do explicit namespace qualificaton. Something like:
ATLSoap::CSemaphore semaphore;
|
|
|
|
|
I just used the CSingleLock and CMutex contained in MFC, I needn't use the ATL::CSemaphore, but I need to use the atlsoap.h related to webservie..
maybe both MFC and ATL define the CSemaphore, so compiler can't differ from them... I can't know how to avoid it.
Big is big...
|
|
|
|
|
Yu_Matrix wrote:
I just used the CSingleLock and CMutex contained in MFC, I needn't use the ATL::CSemaphore, but I need to use the atlsoap.h related to webservie..
maybe both MFC and ATL define the CSemaphore, so compiler can't differ from them... I can't know how to avoid it.
In one of your header or source files you probably have a using namespace ATL; which may cause the problems. Try to remove it.
|
|
|
|
|
Thx, I find another way to avoid it, use ATL::CMutexLock instead of CSingleLock.....
Big is big...
|
|
|
|