|
|
Did you try using CStdioFile?
In another way, you can using CFileDialog to access File Common Dialog from your application.
I hope, those can help you...
|
|
|
|
|
Im tying to cat an integer, such as zero. I am basically trying to count from "0000000" to "99999999" but everytime I set 'int i = 00000000" it shows up as just '0' how can I set the start value as '00000000', so that it will count as "00000001, 00000002, 00000003" and so on?
I figure if it is only going to count as zero, I guess I should count the number of values that it has counted and cat the zeros on to it. The first start was to set and array as "unsigned long int aArray[] = {0,00,000,0000};"" and so on, but that doesnt work.
|
|
|
|
|
For an integer, 0 or 00 or 000 etc. are all the same.
What you're saying is the way you want to visualize it.
That can be done while printing using printf.
printf("%07d", ival);
Or while converting it to a string in MFC.
CString cs;
cs.Format("%07d", ival);
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
is there a way to output visually using namespace std;, I havent used printf in forever
|
|
|
|
|
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
|
|
|
|