|
That looks fine to me. You can treat a bool as you would nay other type. Its just limited in values, false or true
If you vote me down, my score will only get lower
|
|
|
|
|
Hi,Dears
How can i use Edit Control in View of SDI application?
Or How can i use View of SDI application such as Edit Control?
Best Regards.
MJM.
|
|
|
|
|
mostafa_pasha wrote:
How can i use Edit Control in View of SDI application?
Use a CFormView -based view.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thanks For your attention.
But when i use CFormView class , alerted me
CFormView does not support Printing service !
this means i write routin to support Printing ?
Best Regards.
MJM.
|
|
|
|
|
It helps to keep threads short by mentioning all of your requirements up front, rather than one at a time.
mostafa_pasha wrote:
CFormView does not support Printing service !
By default, printing and print preview are not supported by the CFormView class. To add printing support, override the OnPrint() method in your derived class.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thanks a lot.
But u say Threads!
i am writing application that use serial port to communicate
with PC.
I use two threads for Write and Read but i do not know how can i
Synchronize between these threads !
I wanna use Critical section But i do not have any expirement can u
know refrence or example about these?
Best Regards. ;)
MJM.
|
|
|
|
|
mostafa_pasha wrote:
But u say Threads!
Not that kind of thread. A thread is a set of posts on a newsgroup, composed of an initial post about a topic and all responses to it.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Oh, sorry to barge in on this thread. But this is something that is coming up that I'll eventually have to do also. I thought I remember being able to add printing support for a CFormView-based app in VC6, but now in VC7, I'm told the support won't be available. I haven't done anything with built-in print and print preview in a while, but in my OnPrint() how would I be able to use MFC's print preview? instead of the regular printer? Before it was pretty much taken care of for you.
BTW, there was also a feature in VC6 where you could make a custom appwizard and select "base on existing project" so that once I had the barebones code for a certain type of app, I could more or less make a template for that app a lot easier. I don't see this anymore either, and it makes me
[insert witty comment here]
bdiamond
|
|
|
|
|
Background.
I have an App. written by me, that is a win32 console App.
It does some processing and produces some console output, as they usually do.
Now, I am quite happy with the output, as its simply a dump of some data. But, I have developed a GUI which ShellExeceuteEx's the console App as the user requires. So, I can have many instances of the console App running at the same time.
I would like to know if it is possible, that when the user presses the keyboard pause key, only the console window with the focus is paused. At the moment thay all get paused, which of course is expected.
I have looked around and I can not find any general solution. My only idea is to create a keyboard hook DLL, test if the main window focus is on one of the spawned console Apps and to issue a pause/suspend against that thread.
If anyone knows of a better or any other elegant solution I would be interested to know.
Oh, and one more question. Does anyone know how to specify which font is used for Stdout for a console application.
Thanks.
James.
|
|
|
|
|
Hi,
The CHINESE CHARACTERS that I entered for the COMBOBOX control by its property tab(DATA) under chinese OS could not be displayed correctly under English OS. Even though I compile the source code with UNICODE. Does anyone know?
Robert
|
|
|
|
|
Does the PC with the English OS have any Chinese fonts installed?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Yes. The Chinese fonts have been installed. Because I can input the chinese characrer under English OS. Especially, the other controls such as static and button with chinese characters can be displayed properly under English OS.
Futhermore, If I inser or add items using the source code instead of using combobox property TAB(DATA), they can be well displayed.
I don't know why it does not work with the property TAB(DATA.
Robert
|
|
|
|
|
Hi.
I got one dimensional array with integer numbers in it. I want to reverse the numbers. The fisrt number should be last and last should be first e.g. [1,2,3,4,5,6,7,8,9] reverse to [9,8,7,6,5,4,3,2,1]. How can I do it fast?
Regards.
|
|
|
|
|
With STL it's simple:
#include <algorithm>
...
int array[]={1,2,3,4,5,6,7,8,9};
...
std::reverse(array,array+9);
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi.
The fastest way to 'reverse' the array, would be to traverse it backwards. This requires no copying.
James.
|
|
|
|
|
|
Hello I was wondering if there was a simple way of getting the difference between two times for example
using Ctime, get the current time and 5 hours later get the current time and see what the difference in hours and minutes is, for example
Tuesday September 12 2004 10:42 AM
Tuesday September 12 2004 2:21 PM
One more question is there a way of displayhing text on a dialog box, i have a login box, and i would like to display a greeting message to the employee, right now i display a message box with an ok button, but i was wondering if i could skip the message box and just add text.
|
|
|
|
|
Take a look at CTimespan - it should do what you need.
Adding text to a dialog is very easy. What version of VC are you using? In VC6, (and probably most earlier versions) you just place a static control on the dialog template and change it's text. If you need to do it from within the program, you can use SetDlgItemText(...) or use a member variable.
|
|
|
|
|
I have a couple of CControlBar derived classes floating control bars.
when the application starts, I create them , and load their state, either visible or docked, or floating; but when I try setting the text on the floating frame ( CMiniDockFrameWnd ) but it does not really work well.
I had a peek at Cristi Posea's CSizingControlBar , and in one method, there's :
if (IsFloating() && GetParentFrame()->IsKindOf(RUNTIME_CLASS(CMiniDockFrameWnd)))
{
m_pDockBar->SetWindowText((LPCTSTR) lParam);
GetParentFrame()->DelayRecalcLayout();
}
but if I call a method with this in the OnCreate of my MainFrame ( where the CControlBar are created ), they are not yet floating; but they actually are floating.
if I call the same code from an test menu command, it works like it should and change the caption of the floating frames.
Is there a "Post Create" handler that I can use when creating the mainframe ?
Thanks.
Max.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hey Max
Im a newbe and maybe this may help but again you may already know this.
CControlBar is an abstract base class for the control bar classes found in MFC.
A control bar is a window that is usually docked to one of the side os a fames window.
These windows can also float inside of the frame window. The control bar provided by MFC include CStatusBar, CToolBar, CDialogBar, CReBar, and COLeResizeBar.
The IsFloating Method
Bool IsFoating();
Returns True if the control bar is floating
book: Sams Teach Yourself Visual C++ in 21 Days
If not, Im sorry
|
|
|
|
|
I know about IsFloating() and it didn't return the good value ... it returned false even if the control bars were floating ...
Thanks anyway ..
M.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hi there.
I have this class, derived from CFormView. It contains a CTabCtrl. I'm trying that, when a tab is clicked, to change the dialog resource id. Now, as you might remember, the constructor for CFormView includes the resource id. I've been trying many solutions (such as changing the m_lpszTemplateName member name and calling CreateDialog and CreateDialogIndirect), but I cannot find a solution.
I hope you can help me with this. Thanks a lot.
Kith.
Fools say "I know, you don't know", silence like a cancer grows...
Hear my words that I might teach you, take my arms that I might reach you...
but my words like silent raindrops fell... no one dare...
to disturb the sound of silence.
|
|
|
|
|
Hello,
If I understand correctly, you want to change a dialog when you click a tab on a tab control. This tab control is on the dialog you want to change.
If the above assumption is correct, read further, if not skip the next paragraph.
I don't think that you should change the resource ID of the class. I don't know what will happen, but it sure is something that you don't want!
If you want to display another dialog, you can make the dialog you want to change invisible (or destroy it if you want) and create another dialog with the resource ID that you want.
If you really need to reuse the class with another ID (I don't see the benefit in that) you can destroy the window (and the class) and create another one (the same class derived from CFormView) except with another ID.
Hope this information is of any help.
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Sounds like you need to embed a porpertysheet or a tab control into your form. that way it can handle the page changing for you.
There are several articles on that subject
If you vote me down, my score will only get lower
|
|
|
|
|
Hello,
How can I know the path of a running app without recurring to neither registry entries nor to an .INI file ?
I have been checking CWinApp for a function or variable member but was unable to find one...
Any suggestions?
David
BTW, m_pszExeName/m_pszAppName in CWinApp do not retrieve the path...
|
|
|
|