|
Try this:
int main()
{
for (int i=0;i<10;++i)
std::cout << std::setfill('0') << std::setw(7) << i <<std::endl;
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
haha I remember seeing "setfill" around somewhere, I just never thought of it. Ty so much the works hella. ty
|
|
|
|
|
If you mean using C++ streams, you should be able to it like this -
cout << setw(7) << setfill('0') << ival;
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I got it all worked out, my overall output is:
#include "stdafx.h"
#include <conio.h>
#include <iomanip>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
unsigned long int o = 99999999;
for (int i=0;i<o;++i)
cout << setfill('0') << setw(9) << i << endl;
getch();
return 0;
}
|
|
|
|
|
Hi,
I need to get the logo of the user and put it in my application. But it should be of about 5" X 5" and jpg/bmp type only.
How do check these specifications in the image? I am using VC++6/MFC
Thanks,
Tara
|
|
|
|
|
You may load the log image usign a CImage object (taht is able to load both formats) and then check (or just adapt) the size.
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
[My articles]
|
|
|
|
|
I'm having a problem with an MFC app. I open a modal dialog, press F1,
HTML Help pops up with the appropriate context sensitive help. I close
the Help Window and can then press any shortcut key (such as Ctrl+O
for open) and the app will open the file open dialog, even though the
modal dialog is still visible and should have the keybord focus.
I'm using the new MFC feature pack.
This behavior can be duplicated with a stock MFC application. Using
the MFC Application Wizard, build a SDI app with Context Sensatvie
Help. Leave all other options at the default. Build and run the app.
Open the Help About dialog, Press F1, Close the Help Window, press Ctrl
+O, you'll see this issue.
If after closing the Help Window you click the app window or dialog
box with the mouse the focus is set properly and pressing shortcut
keys does nothing.
It appears that this might be a defect in the new MFC featrue pack
classes. Does anyone have an idea as to how I can correct this
behavior?
Thanks.
|
|
|
|
|
Tom M wrote: It appears that this might be a defect in the new MFC featrue pack
classes. Does anyone have an idea as to how I can correct this
behavior?
Who created this feature pack? Maybe you should tell them about it.
|
|
|
|
|
My program generates a latitude and longitude and I would like to display a map of the area with the exact location marked.
Is Google Maps the best way to go for this?
At the moment I do not want the map to be embedded in my program. I would be happy just to spawn the default web browser passing it a maps.google.com URL that would display the correct Google Map with the location marked accurately.
Is there a page which describes how to construct the necessary URL ?
Also, do Google allow this sort of use for free, or would their terms require a fee for programs which spawn the map in a web browser like this?
|
|
|
|
|
Does this[^] help?
Why not embed a browser (IE? WebKit if you're feeling ambitious) in your program? That'd be cool!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks, that's a great help. Embedding a browser sounds interesting - I'm still using VC++ 2003, would that be too old to use WebKit?
Is there anything else provided by Microsoft that can be used to create a web browser within a program's window?
|
|
|
|
|
Note: WebKit is the open-source HTML engine used in Google Chrome and Apple Safari. It is wrapped in a class in the Qt library.
colinbr wrote: would that be too old to use WebKit?
No - but other than Qt, I'm not sure of easy ways of using it.
colinbr wrote: Is there anything else provided by Microsoft that can be used to create a web browser within a program's window?
IE. Use the MSHTML ActiveX control. It's pretty simple and (if you've already got an MFC program running) probably easiest.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks, I'll look at that. When I created ny project originally I did not have ActiveX ticked in the project wizard. I don't relish the thought of recreating the project from scratch, so is there a simple list of changes I can make manually to the project files that would add ActiveX support?
Incidentally I found a reference to Microsoft's CHtmlView which I think is a wrapper around the ActiveX control - and also a CHtmlCtrl which allows CHtmlView to be used in a dialog window. But there seemed to be comments about memory leaks.
Would it be easier/safer to go for the ActiveX control itself - I guess this is
http://msdn.microsoft.com/en-us/library/aa752046%28VS.85%29.aspx[^]
or to go for the CHtmlView/CHtmlCtrl solution?
|
|
|
|
|
I would have thought that CHtmlView/CHtmlCtrl would wrap the ActiveX control. I'm not sure what's required for ActiveX support in MFC - I've only used the Web Browser ActiveX control in WTL, which doesn't require you to enable ActiveX support at a project level.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
Hello Guys,
I am trying to handle key code for power key/switch off key for Windows mobile in MFC application but still to get the correct key code for the same.
Your inputs are most welcome. Waiting for your reply.
Thanks in advance.
Regards,
Rushikesh123
modified on Tuesday, September 29, 2009 12:43 AM
|
|
|
|
|
can we develop rtd client like excel to get data from rtd server
Trioum
|
|
|
|
|
Yes, we can.
For instance I'm a famous RTD (ready to drink) client.
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
[My articles]
|
|
|
|
|
how is it possible
Trioum
|
|
|
|
|
trioum wrote: can we develop rtd client like excel to get data from rtd server
Yes, that should be possible. Question answered. Period.
But "how to develop an rtd client" may not be a specific question. You might want to read the guidelines in that case...
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi,
I need to compress wave-pcm to gsm-format with acm(audio compression manager).
So can you help me? and if there is some source codes it can be more helpful.
Thanks
|
|
|
|
|
Dear all,
How to pohibit some character on edit box VC 6.0?
I have no idea about that.
Thanks and regards,
Eka Candra
|
|
|
|
|
Check ON_EN_UPDATE message handler. Sent after the control has formatted the text but before it displays the text so that the window size can be altered, if necessary.
check this
Or In PreTranslateMessage(inside parent of edit box), you can do check for prohibited character -
if(pMsg->message == WM_KEYDOWN && pMsg->wParam == PROHIBITED_CHARACTER && pMsg->hWnd == MY_EDIT_BOX_WINDOW)
{
return TRUE;
}
|
|
|
|
|
Thank you for your help and answer.
I am not try it yet. Firstly, I will learn article that you give in your message.
thanks a lot...
|
|
|
|
|
Have a look in the Edit Controls[^] section here on codeproject - there are many good articles here (thought that tutorial is a great start)
Masked and Validating Controls[^] is probably the subsection you want!
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|