|
member "open" of "fstream" and "wfstream" has only one Ansi type
void open(const char *s, ios_base::openmode mode =
ios_base::in | ios_base::out,
long protection = 0666);
that means if i use Standard C++ Library to open a unicode named file,it will fail.
why SCL not support unicode names fstream
Stick to C++
|
|
|
|
|
My application has three dialog boxes. the first one has three buttons, Load, Modify and cancel.Load is used to display a bitmap on to the second dialog box and modify to make changes to the bitmap displayed on the second dialog. i have successfully displayed the image on the second box but cant find a way to modify the bitmap and display it on the third dialog. By modify, i mean to change the number the pixel values and the width and height of the bitmap. i tried changing the object of CBitmap to which i am loading the image and the BITMAP structure also. But it doesnt seem to change at all. Can anyone please help me out of this.
|
|
|
|
|
Load the bitmap into 2 different CBitmaps, one for each dialog.
To change pixel values:
1) Select current CBitmap into a memory DC and use GDI drawing functions.
2) Restore memory DC to initial state.
3) Update bitmap in 3rd dialog (InvalidateRect...What ever).
To change the size:
1) Create a new CBitmap of the needed size and select it into a memeory DC.
2) Select current CBitmap into a memory DC.
3) Use StretchBlt (resize bitmap) to copy the current CBitmap to the new CBitmap. Or Use BitBlt to copy any piece (sub-rectnagle) of the current CBitmap to the new CBitmap.
4) Restore memory DCs to intial states.
5) Make the new CBitmap your current bitmap, then destroy previous CBitmap (unless undo is required).
6) Update bitmap in 3rd dialog (InvalidateRect...What ever).
Well thats a general outline of what is required based on your post.
Good Luck!
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hi there,
i'm using Teofilov's NTGraph control to show some 2D charts in my application.
Now I'd like the control get resized when dialog box is resized but I have no idea about how to do that....
Does anyone know how resizing such controls to keep the same aspect ratio as containing dialog box...?
Thanks in advance,
Almenara
|
|
|
|
|
The ActiveX wrapper class derivates from CWnd, so it can be used like any other control. You can use the MoveWindow function from CWnd for that purpose.
|
|
|
|
|
hi all,
I am building a system tray like utlity for a mfc dialog based application( infact property sheet based application). just like Date/Time Property sheet application. in system tray.
I have done following.
1. Initialize the NOTIFYICONDATA structure m_nidIconData
2. Declare and defined a called back function using a user defined message.
3. Calling Shell_NotifyIcon(NIM_ADD,&m_nidIconData)in InitDialog of PropertySheet class.
4. handing msg in call back function such as WM_MOUSEMOVE,WM_LBUTTONDOWN etc.
5. Calling Shell_NotifyIcon(NIM_DELETE,&m_nidIconData) in d'ctor of PropertySheet class.
When ever i moved my mouse message the tray icon gets disappeard.
Can someone throw light on the problem?
Thanks in Advance
Abhi Lahare
|
|
|
|
|
Suddenly all the console applications written using the wizard in Visual C++ 6.0 no longer finish with "Press any key to continue" so I have to use my own few lines of code to see the results.
What have I done
|
|
|
|
|
From where are you running the console applications?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have been running them from inside the Visual C++ development environment using the F5 key, however running the exec file directly has the same result.
Unfortunately I do not have any "old" console applications lying around that I am certain are working (eg that the file they were reading is still there etc )but the ones I have tried all seem to start up and then immediately close again with no message.
Could it be something that has changed in the operating system which is Windows XP? I believe that the service pack 2 updates may have been made since I last used a console application.
Alan Johnstone
|
|
|
|
|
It used to be that when you ran a console application from an already-open console window, the console window would remain open after the application exits. When you ran a console application from within the IDE, the console window would prompt you then close.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
To be honest I cannot remember what happens is you run outside IDE but something has definitely changed as an "Hello World" program run from within IDE runs and immediately closes. So either I have inadvertently set some switch within IDE or there has been a change in the operating system.
Alan Johnstone
|
|
|
|
|
add this in your code to pause temporarily your running program :
add this header :
<font color=#0000FF>#include</font> <conio.h>
and this where you want to stop :
getch();
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Mr. John R. Shaw.... Please provide information on the working of the menu... whenever i attach a menu with two tabs standard and scientific then i attach a function to the standard tab.. what should be the body of this function....and yeah why should i do the coding in the dialog's application initinstance function , can't be the coding done in the above mentioned function....and yeah sir,, please provide detail and mention the meaning of CMydiakog dlg(nResponse)
thanx and sorry for the trouble
haseeb
|
|
|
|
|
I have a problem in print previewing in dialog based application. The "prev page" button in toolbar is not getting enabled. Can anyone help me out. URGENT!
Thanks in Advance!
Jega Renga Kumari
|
|
|
|
|
I am implementing a feature - autoprint. Its purpose is to print an html file from my VC++ application after every
transaction is made. I tried with ShellExecute and ShellExecuteEx. But the print dialog opens which i dont want. Can
anyone tell me how to suppress the print dialog when i print an html file! Can anyone help me! URGENT!
Thanks in advance!
Jega Renga Kumari
|
|
|
|
|
How are you calling ShellExecute() ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi David,
Thanks for showing interest.
I am invoking this function when a dialog-print button gets clicked.
ShellExecute("Print", "ABC.htm", NULL..);
I get the html page printed , but before printing, its opening up the print dialog. Do you know how to suppress!
renkumari
|
|
|
|
|
jega renga kumari wrote:
ShellExecute("Print", "ABC.htm", NULL..);
This produces the same result as if you had right-clicked the file in Windows Explorer and selected Print. I do not know of a way to circumvent the Print dialog box.
My first guess would be an SDI application that used a CHtmlView . You could then programmatically print whatever was in the view.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
i use serial communication both two class.
first,i open com port from one class for receiving data and displaying data in the dialog.
and i receive data from com.
this is fine work..
samelly,i open com port from another class in my application for displaying another format in another dialog.
in case, i have problems.
it doesn't work.
i have not receive data from com port.
i want to know
can i open same com port(eg:com1) in both two class within one application?
|
|
|
|
|
No, you can only open a COM port once. So, you'll need to share the handle of the port to be able to read/write data from another class
|
|
|
|
|
Hi
I´m quite new to VC++ .NET, and I´m building an application that is going to display graphically the readings from a sensor.
What kind of container (if container is the right word) should I use for displaing the graph?
Appreciate any suggestions,
doneiriik
|
|
|
|
|
We found that NTGraph controls (below) were fantastic on my last project. Very easy to use, easy to control and lots of functionality. If all else fails you could always save out as comma delimited files and use excel or excel automation as an alternative.
2D NTGraph
3D NTGraph
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts your aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
I have a CToolbarCtrl with an CEditControl and a CComboBox in it.
In order to have a tooltip for those controls I added ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipText)
to the toolbar. This solution worked fine until I added Manifest to the application.
With manifest I don't get the wanted tooltip. OnToolTipText doesn't get called.
Does anyone how to solve this problem?
|
|
|
|
|
How to make my dialog box always display on top?
On Visual C++ 6.0, how to I identify a user who is having what kind of privileges? (i.e admin privilege, etc)
|
|
|
|
|