|
Sounds interesting for me. Thanks Rajesh...
|
|
|
|
|
You're most welcome Alex.
FYI, osalt.com[^] has a wide variety of open source programs and you can search for an open source program by providing a commercial program's name.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Very thanks again. In the last days, I was searching a site that seems to sourceforge and now I found.
Very helpful.
BTW, is there other sites like these
|
|
|
|
|
Wikipedia Entry[^]
OSI[^]
OSW[^] (This is just fantastic).
And there is OSALT and sourceforge. That's all I can think of right now.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
THHHHHAAAAAAANNNNNKKKKKSSSSSS.....
Very helpful
|
|
|
|
|
You're welcome man. I'm glad I could be of some help to you.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
hi, i wondered how i can do this with ostringstream
i want to print time in this format: mm:ss
for minutes=5, seconds=2 it should be 05:02 for example
any ideas? thanks in advance
|
|
|
|
|
std::stringstream sl;
sl<<3<<":"<<12;
std::cout<<sl.str();
|
|
|
|
|
I refuse to take that 1 vote, without reply or reason .
I consider it cowardly.
|
|
|
|
|
I think you got 1 because your code will not properly format numbers (BTW I didn't vote you).
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Agree. I overlooked OP's question.
|
|
|
|
|
I didn't vote you down but this doesn't answer the question. This would be equivalent to printf("%d:%d");
So there's no lenght and filling specification.
|
|
|
|
|
I know, you would not vote me, without reply.
Yes, I missed some part of original question.
|
|
|
|
|
ostringstream ostr;
ostr.fill('0');
ostr.width(2);
ostr << 5 << ":";
ostr.width(2);
ostr << 2 << endl;
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks, it worked perfectly.
btw, it seems an awkward construction, with printf the formatting is more natural. guess the new c++ classes can't be better at everything...
|
|
|
|
|
all the lines explained by CPallini can be "inlined" into once (if i remember well)...
|
|
|
|
|
Yes, it can be done, including <iomanip> and slightly changing the syntax:
#include <iomainip>
str.fill('0');
str << setw(2) << 2 << ":" << setw(2) << 5 << endl;
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
sashoalm wrote: it seems an awkward construction
I agree, that's why I tend to use printf family functions. On the other hand manipulator syntax is great for dealing with complex objects.
[added]
BTW, thanks to toxcct suggestion, have a look at
http://www.codeproject.com/script/Forums/View.aspx?fid=1647&msg=2559997[^]
[/added]
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
also, you (and the OP) must be aware that printf()-like functions are not thread safe, were C++ xxstream classes are.
|
|
|
|
|
Hello,
I have a class in MFC and I want to use this class in Windows forms. For that I create a .dll file using the MFC class and load that .dll file in to CLR project and draw that object in Windows form. But now I want to add an event to that new control. How can I do this?
eg:
I have a ctreeview in MFC and I create a .dll file using that MFC class and open a CLR project in VC++2008 and add a form to that project and load that .dll file. Then I can access that MFC class in my new Windows form ( in CLR project ). and it is working. But my current problem is that, I want to read selected node value from that tree node to my Windows forms's text entry. How can I do this? I think, for that we need to add an event ( After select ) to that control. But that control is loaded from .dll file.
How can I solve this problem?
Please help me.
|
|
|
|
|
Don't cross post
led mike
|
|
|
|
|
Using Visual C++ 6.0 MFC in SDI application
I typically get confused with the "this" pointer. For example, I created a Dialog Box using Visual C++ 6.0 MFC. Its class has its own .cpp and .h files (Class name for this dialog box is CMyCustomDlg). In the book "Using Visual C++ 6" by Jon Bates and Tim Tompkins on page 219 they talk about Displaying a Modal Dialog Box. They say to declare a dialog class object local to the function handler, such as
CMyCustomDlg dlgMyCustom(this);
//and then display it using
int nRetCode = dlgMyCustom.DoModal();
where CMyCustomDlg is the class name given to this dialog class. I don't understand what is happening here with the "this" pointer with this type of syntax and what the (this) in parenthesis means, and I don't understand where I can use
CMyCustomDlg dlgMyCustom;
int nRetCode = dlgMyCustom.DoModal();
without putting the "this" in parenthesis in the object declaration.
Thanks ahead of time.
|
|
|
|
|
the this in parenthesis is the pointer of the current instance (the meaning of this ) passed as a parameter to the CMyCustomDlg class constructor.
|
|
|
|
|
A pointer to the parent or window owner object that is being passed to the constructor of the dialog. If it is NULL [default value], the dialog objects parent window is set to the main application window.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I use following code but can't get the property of docx file
hr = ::StgOpenStorageEx(wcFilename, STGM_READ | STGM_SHARE_EXCLUSIVE, STGFMT_ANY,
0, NULL, 0, IID_IPropertySetStorage, (void**)&pPropSetStg);
hr = pPropSetStg->Open(FMTID_SummaryInformation,
STGM_READ | STGM_SHARE_EXCLUSIVE, &pPropStg);
hr = pPropStg->ReadMultiple(nPidsi, pPropSpec, pPropVar);
|
|
|
|