|
I am not realy sure the problem but I think you should move:
<br />
CRect rcPanelRect(rcBounds.TopLeft(),CSize(rcBounds.Width(),rcBounds.Height()/4));<br />
configPanel.MoveWindow(rcPanelRect,TRUE);<br />
to OnSize event handler.
|
|
|
|
|
I have a printing application which works quite good for some years now.
It uses a modless abort dialog which can be used to abort the banded printing process. The dialog uses the well known "keep the message pump alive" method which is e.g. described in this article (http://www.codeproject.com/threads/TemplatedLengthyOperation.asp[^].
So the printing process queries an abort method of the dialog continuously which keeps the message handling alive and checks the abort button. This works very good for years now.
But now I want to use a progress bar and an abort button in the toolbar of the print preview view instead of the dialog - but I am not sure if this will work with the same technique like in the abort dialog. I could not find any information about it. Everyone seems to use a dialog.
Has anyone an idea if this works?
|
|
|
|
|
Printing in a background thread and when the UI thread tool button is clicked us PostThreadMessage to inform the printing thread of the abort.
|
|
|
|
|
Thanks for your answer. Of course this would work, but I try not to change how the internal printing routine work. So want to avoid using a thread if it is possible.
|
|
|
|
|
Why is it not compiling?
Errors:
1. (16): error C2079: 'file_op' uses undefined class 'std::basic_fstream<_Elem,_Traits>'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
2. (16): error C2078: too many initializers
3. (17): error C2228: left of '.eof' must have class/struct/union type
4. ..test.cpp(17): fatal error C1903: unable to recover from previous error(s); stopping compilation
test.cpp
#define MAX_LINES_PER_SENTENCE 1000
#include ".\SentenceAr.h"
#include ".\SentenceList.h"
#include <string>
using namespace std;
void main ()
{
char strOutput[MAX_LINES_PER_SENTENCE + 1] = {""};
char strFileToRead[MAX_LINES_PER_SENTENCE + 1] = {"C:\\temp\\testfile.txt"};
int x = NULL;
fstream file_op(strFileToRead,ios::in);
while(!file_op.eof())
{
file_op.getline(strFileToRead,2000);
cout <<strOutput;
} file_op.close();
cout <<endl;
;
file_op.close();
}
The code does not compile even when I try to declare strOutput and strFileToRead as 'string' including the <string>.
Jon
|
|
|
|
|
You forgot to #include <fstream> at the top of your test.cpp file.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
|
Hi,
Can u please say how to get data(text) in the grid control of a property page into another property page.
Thanks in advance.
tejaswini.
|
|
|
|
|
Hey Everyone,
I am developing a application in MFC in which I have 3 CBitmapButton; 1 big BitmapButton over that other 2 BitmapButton but the problem is that when the focus is at the button which is in background, the other 2 button which are on foreground disappear. I want that the 2 button in the foreground always appear in the foreground so that user can see those everytime.
Can somebody help me out with this problem.Thanks for reading.
Vab
Vab
|
|
|
|
|
You could try to make the two buttons a child of the big button.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
hi all,
i want to develop one application in VC++.
A win32 dll can make use to call a MFC exe and to pass some argument value to that exe.At last the MFC exe can show the argument values passed by the dll.
A messagebox should be show the argument's value ...
thanks...
invoke(arguments)
Dll --------> MFC exe ---->MessageBox(arguments..)
Try again and again,
At last you will say
I don't know the meaning for impossible.,.
|
|
|
|
|
Why don't you simply return the value from a function ? You call the function from the dll and store the result so it can be displayed in a message box.
It is difficult to help you because you don't provide a lot of information about your problem.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
hi,
thanks for ur reply..
i want to call a MFC exe from another exe , so that i used shellExecute() to run another exe, at the same time ,i need to pass some parameter values to the another exe, which has to display the values in their corresponding edit box.
for e.g., if i passed "NAME","NUMBER","MARK1"
the another exe display those above information in their edit box.
Try again and again,
At last you will say
I don't know the meaning for impossible.,.
|
|
|
|
|
You can get access to the arguments that the DLL passed via m_lpCmdLine .
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi,
thanks for ur reply..
i want to call a MFC exe from another exe , so that i used shellExecute() to run another exe, at the same time ,i need to pass some parameter values to the another exe, which has to display the values in their corresponding edit box.
for e.g., if i passed "NAME","NUMBER","MARK1"
the another exe display those above information in their edit box.
Try again and again,
At last you will say
I don't know the meaning for impossible.,.
|
|
|
|
|
So what exactly is your question? I've already told you about m_lpCmdLine .
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
u may get some clue from COM(DLL) event. event interface is defined in a share file which is shared by both EXE AND DLL, DLL calls the functions defined by event interface, and exe realizes those functions.
life is like a box of chocolate,you never know what you r going to get.
|
|
|
|
|
hi,
thanks for ur reply..
i want to call a MFC exe from another exe , so that i used shellExecute() to run another exe, at the same time ,i need to pass some parameter values to the another exe, which has to display the values in their corresponding edit box.
for e.g., if i passed "NAME","NUMBER","MARK1"
the another exe display those above information in their edit box.
Try again and again,
At last you will say
I don't know the meaning for impossible.,.
|
|
|
|
|
hi all,
i want to develop one application in VC++.
A win32 dll can make use to call a MFC exe and to pass some argument value to that exe.At last the MFC exe can show the argument values passed by the dll.
A messagebox should be show the argument's value ...
thnaks...
invoke(arguments)
Dll --------> MFC exe ---->MessageBox(arguments..)
Try again and again,
At last you will say
I don't know the meaning for impossible.,.
|
|
|
|
|
Not enough information. The EXE owns the UI thread so unless the DLL starts a worker thread it can't "pass" anything to the EXE. If you just want information "back from" the DLL code then define a structure that the DLL will fill the values of and pass a reference to it into the DLL in a function from the EXE code. When the function returns the structures values are filled in. If this is not your situation then you need to explain it more specifically.
|
|
|
|
|
Hello everyone, could someone help me with this problem
i animate window containing activex flash control, and the window rollouts
but while it's animating it is gray inside, and only when it's fuly visible the activex control appears.
I tryed to catch WM_SIZING but this message won't apear until i try to resize the window by hand.
Anyone knows how to solve that problem, maybe some message that is send by AnimateWindow or any other way.
|
|
|
|
|
Query. Most people from a C background would cast using the x = (type)y; syntax - for example, to convert a long to a short (knowing it won't be truncated of course...):
long aLong = 1234L;
short aShort = (short)aLong;
No problems.
However, I have come across some C++ code that uses the following syntax:
long aLong = 1234L;
short aShort = short(aLong);
Is this alternative syntax C++ only (I assume it is, but a Google seems to come back with conflcting results)? Also, is there any real advantage to either method? Are the various C++ casts (static_cast, dynamic_cast) more useful in casting POD types like this?
I can't believe I haven't come across the x = type(y); syntax before. I asked some other C/C++ old-timers here and they hadn't seen it either. Mad. Always something new to learn!
|
|
|
|
|
Robert Edward Caldecott wrote: I can't believe I haven't come across the x = type(y); syntax before
default constructors...
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
They are syntactically the same. It's much like:
int foo( void )
{
return 12;
} vs.
int foo( void )
{
return (12);
} Some folks use parenthesis with the sizeof operator:
int x = sizeof(obj); while others do not:
int x = sizeof obj;
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
In this case it is the same thing, but in general the syntax you describe is not casting, but initialization.
On the other hand, I like to use C++ casts (static_cast, reinterpret_cast) these days. It is very easy to search for them in the code, unlike the C style casts.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|