|
Hey, are you collecting info for the enemy?
From MSDN multimap reference:
<br />
Unlike template class map, an object of template class multimap does not ensure that key_comp()(x.first, y.first) is true. (Keys need not be unique.)<br />
The same diffrence holds for set, multiset pair.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
But, what is the difference between map and set?
|
|
|
|
|
excerpt of MSDN documentation for map:
<br />
The template class describes an object that controls a varying-length sequence of elements of type <big>pair<const Key, T></big>. The first element of each pair is the sort key and the second is its associated value.<br />
excerpt of MSDN documentation for set:
<br />
The template class describes an object that controls a varying-length sequence of elements of type <big>const Key</big>. Each element serves as both a sort key and a value.<br />
Why don't you make a little effort to read documentation, before posting?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
hello! can n e one tell me how can i highlight any text present in a web page, after it has opened.....(i m opening a web page in my VC++(MFC) code).
|
|
|
|
|
Hi,
How you openned the web page using CDHtmlDialog/ CHtmlView, ...?
You can use MSHTML COM objects(IHTMLDocument, IHTMLElement, ..) and change the HTML Text to <Strong> or change the color of text or change the html style of the html element in runtime to highlight the Text. This requires you have to use IE controls in any mean (CDHtmlDialog, WebBrowserCtrl, ...)
|
|
|
|
|
hello...i hav used MFC's method to execute a web page....now whts the method to highlight any word present in the page????
|
|
|
|
|
Hi,
I can't understand "MFC's method to execute a web page".
My method will work only if you have hosted the IE web control in your application.
You "execute the web page" ? Does it uses Internet Explorer window.
Is this Web page is shown in your application.
Sorry I can't understand your setup. Are you showing the web page? in your application window.
|
|
|
|
|
I have almost finished developing a software with vc 6. Then my leader suddenly told me that this software should be also be able to run under Vista. I know it is hard to accept, but it is the fact. I think the fastest way maybe convert it to vs.net 2005. But it is not such easy. It showed a lot of errors.Could onebody give me any suggestion. To write a new software with vs.net 2005, or convert it, or some other good idea.
|
|
|
|
|
VC6 is rubbish, you shouldn't use it anyhow, if you have the option.
If you get a lot of errors, you should work through them, you will, in the process find out ways in which your old code is not standards conformant.
I would, however, just test to see if the app runs on Vista. I don't see how moving to VC2005 would magically cause this to occur.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
why do you say VC6 is rubbish?
I've had nothing but problems with VS2005, even though I applied the service pack 1 and then the vista pack as well. I still can't get add member variables to work properly, and miss the old right click class wizard in VC6.
I can still get to the class wizard/add variable but when I click control type variable all the other fields still stay empty and are unusable.
|
|
|
|
|
Peter, Chan wrote: I think the fastest way maybe convert it to vs.net 2005
That may not make your application to run as expected[edit]on vista[/edit]. As there are other platform issues involved there, like , way to deal with registry.
VC6, is not strictly adheres to C++ standards, and no longer supported by Microsoft. So , better migrate to higher version of compiler.
Peter, Chan wrote: But it is not such easy. It showed a lot of errors.
It should not take long time to fix those.
-- modified at 3:03 Monday 11th June, 2007
Prasad
MS MVP - VC++
|
|
|
|
|
Peter, Chan wrote: I think the fastest way maybe convert it to vs.net 2005. But it is not such easy. It showed a lot of errors.
Those errors have nothing to do with Vista. They are the result of VS2005 being more C++ compliant.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
I just want to know that is there any MFC or ATL class for regular expression search or validation? If not, what are the other alternative?
I don't want to use .Net or anything which needs framework to be installed on client machine.
Looking for any help, suggession.
Thanking you,
Anurag Gandhi.
Anurag Gandhi.
|
|
|
|
|
I think boost may have a regex library. C++ and MFC do not, as standard.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
Hi,
I have some problem in handing the WM_NCPAINT. As per MSDN, the dc with the region clipped can be obtained as follows for handling the WM_NCPAINT.
case WM_NCPAINT:<br />
{<br />
HDC hdc = GetDCEx(hwnd, (HRGN)wParam, DCX_WINDOW|DCX_INTERSECTRGN);<br />
}
But when I tried this am getting hdc as NULL. Any solution for this issue.
N.B - I tried using the DCX_CACHE flag in the GetDCEx() function. Eventhough in this case it returned a dc handle, the clipping is not proper.
Thanks
Naveen
[OpenedFileFinder]
|
|
|
|
|
Can u use GetClipBox API?
akt
|
|
|
|
|
Is wParam == 1 when GetDXEx() fails?
If not, try calling GetLastError() when it fails and see what the error code is.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
its now ok Mark. When I specified the DCX_PARENTCLIP flag it working fine also cliping is proper.
|
|
|
|
|
Hi all,
I am making a multi threaded application in which i have made a UI thread and from that thread i m using SendMessage() function to send a message to be displayed like this.
int row_no = test_int;
m_pLogWnd->SendMessage(MSGDIS, (WPARAM)(CString*)&logmsg,(LPARAM)(&row_no));
and recieving that message in my main class function like this..
LRESULT CMonitorVw::OnDispMessage(WPARAM wparam, LPARAM lparam)
{
CString* pLogMessage = (CString*) wparam;
int *u = (int*)lparam;
m_obj->m_List.SetItemText(u,7,*pLogMessage);
return UpdateData(FALSE);
}
<\pre>
if i do this i am getting an error
SetItemText' : cannot convert parameter 1 from 'int *' to 'int'
either tell me the way to convert int to int* or in any other way i pass or recieve inter value.
Thanks in advance
|
|
|
|
|
neha.agarwal27 wrote: m_obj->m_List.SetItemText(u,7,*pLogMessage);
change it as
m_obj->m_List.SetItemText(*u,7,*pLogMessage);
|
|
|
|
|
Actually you don't to pass an integer pointer, you may pass directly the integer value:
m_pLogWnd->SendMessage(MSGDIS, (WPARAM)(CString*)&logmsg,(LPARAM)row_no);
and
LRESULT CMonitorVw::OnDispMessage(WPARAM wparam, LPARAM lparam)
{
CString* pLogMessage = (CString*) wparam;
int u = (int)lparam;
m_obj->m_List.SetItemText(u,7,*pLogMessage);
return UpdateData(FALSE);
}
BTW usually pointers are passed only as LPARAM (though maybe an issue only on very old Windows versions).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Others have answered the details of your questions, but I wanted to make an observation.
When passing pointers between threads, you need to make sure that the item being pointed to (logmsg and row_no) will remain in existence during the time the receiving thread is processing the message. In general, this means that you should not pass pointers to items allocated on the stack i.e. variables that are local to the function sending the message. Your code is ok in this respect because you use SendMessage instead of PostMessage. However, using SendMessage tends to defeat the purpose of multi-threading by forcing the two threads to act sequentially.
Judy
|
|
|
|
|
Im Create a static control inorder to use it as a label
CStatic *temp = new CStatic();
temp->Create("YYYYY" ,SS_SIMPLE ,CRect(0,0,25,25) ,this);
My requirement is if my text which should display inside static control
exceeds the rectangle limits it should take a new line automatically.
It Must be multiline static control.
so how can i do it.
bhw
|
|
|
|
|
Use MultiLine Edit Control and make it readonly.
|
|
|
|