|
Are these controls created as part of a dialog (from a resource) or are you creating them yourself?
If creating them yourself, from where in the code?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark,
I am creating the controls as a part of a dialog.
Let me know if you need any further information!
Thanks!!
|
|
|
|
|
hi
please check the visibilty property of each control
|
|
|
|
|
Do the controls overlap each other?
Or are you doing any painting (or drawing) in the dialog?
- NS -
|
|
|
|
|
Yes, the controls overlap each other. I have a list control which resides in a property page and the propertypage is display in a tab of a tab control.
|
|
|
|
|
Property pages should be in a property sheet, not a tab control.
For a dialog, if the controls are part of the dialog resource, you
shouldn't have to do anything to make controls appear unless they
are not created with the WS_VISIBLE style.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
Let suppose, there is an exe file and it has a certain output at console. Is it possible to read that console output anyway?
I would appreciate the suggestions.
Wali
|
|
|
|
|
Is it your code or some other exe? If it's some other EXE, why can't you read the console ouput?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Let me explain what I am trying to do. I have one executable file that shows the tracking data at console as 0utput. I want to write a c++ code that can read the tracking data in loop from console. I want to use that tracking data in my own application.
I hope now the question is clear.
Wali
|
|
|
|
|
Perhaps it would be easier to understand your question if you told us exactly what you are trying to do.
Are you trying to determine how the application derives the output before it is actually written to the console?
|
|
|
|
|
Wajid Ali wrote: Is it possible to read that console output anyway?
Certainly. Read here and here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks! I will try it soon.
|
|
|
|
|
Use > operator at command prompt. For ex. if the file name is hello.exe use
c:\hello.exe>output.txt and all the console output will be stored in output.txt file.
Now you can use this file.
|
|
|
|
|
Hi, I've got 17 error codes to #define with some "context" for them and I'm searching for a quick way to do so.
Besides writing them out "longhand" I decided to try the paste (##) operator by doing this:
<br />
<br />
#define ERROR_CONTEXT_CODE(context,code) \<br />
#define ERR_##context (code+00) \<br />
#define ERR_##context##_ERROR1 (code+01) \<br />
#define ERR_##context##_ERROR2 (code+02) \<br />
#define ERR_##context##_ERROR3 (code+03)<br />
<br />
I expect to have about 8 contexts and 17 error codes per context. The context is important because when there is an error I'd like to trace it back to the (code+0x) value so I'd be able to pinpoint the error to, say, file access vs HTTP access (or whatever the context is).
I intend to this code
ERROR_CONTEXT_CODE(FILE,7100)
ERROR_CONTEXT_CODE(HTTP,7200)
to output:
<br />
#define ERR_FILE (7100+00) \<br />
#define ERR_FILE_ERROR1 (7100+01) \<br />
#define ERR_FILE_ERROR2 (7100+02) \<br />
#define ERR_FILE_ERROR3 (7100+03)<br />
<br />
#define ERR_HTTP (7200+00) \<br />
#define ERR_HTTP_ERROR1 (7200+01) \<br />
#define ERR_HTTP_ERROR2 (7200+02) \<br />
#define ERR_HTTP_ERROR3 (7200+03)<br />
I *think* I've made my intention clear at this point.
How can I accomplish this? I was thinking of incorporating the stringize(#) and paste(##) operators to do this.
(ed-Fixed a copy/paste error in second code block)
|
|
|
|
|
How would I go about using a windows style of WS_EX_COMPOSITED with an MFC View window? (I don't want to know about other methods of double buffering, just how to set this style.)
Thanks!
|
|
|
|
|
I would recommend reading the docs for CreateWindowEx() -
specifically anything there related to WS_EX_COMPOSITED.
To use the style in MFC, specify the WS_EX_COMPOSITED extended style
when calling CreateEx() to create a window.
This style can also be set in a window class' PreCreateWindow() override.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
Thanks. Actually, I have already read up on that, and have no problem with WS_EX_COMPOSITED when not using MFC. However, I am not seeing the expected results when I use WS_EX_COMPOSITED with MFC. I am overriding the PreCreateWindow method for a View in a MDI Doc/View application:
BOOL CMyProgView::PreCreateWindow(CREATESTRUCT& cs)
{
cs.dwExStyle &= WS_EX_COMPOSITED;
return CScrollView::PreCreateWindow(cs);
}
but I still get flickering when I draw the window by overriding the OnDraw method. In OnDraw, I'm using a GDI+ Graphics object, and I use the Graphics::Clear method before doing my drawing. There is no flickering when NOT using MFC, even using Graphics::Clear, if the WS_EX_COMPOSITED window style is used.
I thought maybe MFC was using some conflicting window styles, but don't know. Just wondered if something more was required, such as changing some other window style(s) to be compatible with WS_EX_COMPOSITED, or something like that.
Thanks again.
|
|
|
|
|
Californian2 wrote: cs.dwExStyle &= WS_EX_COMPOSITED;
Maybe try
cs.dwExStyle |= WS_EX_COMPOSITED;
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Oops. Nevertheless,
cs.dwExStyle |= WS_EX_COMPOSITED;
does not work. There does seem to be some window style conflict.
|
|
|
|
|
Hmmm that should work.
Maybe try forcing styles identical to your non-MFC version by calling
the base class PreCreateWindow() FIRST, then overwrite the style and exstyle
with your values, something like:
BOOL CMyProgView::PreCreateWindow(CREATESTRUCT& cs)
{
if (CScrollView::PreCreateWindow(cs))
{
cs.style <font color="Red">=</font> WS_CHILD;
cs.dwExStyle <font color="Red">=</font> WS_EX_COMPOSITED;
return TRUE;
}
return FALSE;
}
How are you forcing it to draw so you see flicker? During resizing? With a timer?
If that doesn't work, note that the default CScrollView window class style has CS_HREDRAW | CS_VREDRAW
set...I don't know if that effects this at all.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
Sorry to take so long to get back on this. The problem does indeed seem to be related to scrolling. Mostly I have problems with Graphics::DrawImage with large bitmaps. Everything is fine (except for flickering when resizing by dragging the lower right corner of the window, and some other times), until I add cs.dwExStyle |= WS_EX_COMPOSITED in a PreCreateWindow override. Then, my image flickers and sometimes completely disappears when it is scrolled. It comes back if the window is resized, but is lost again when the window is scrolled.
I'm not having much luck overriding the base class PreCreateWindow with other styles, but I'll double check whether I'm doing that correctly.
Thanks for any help you can give.
-- modified at 12:23 Wednesday 19th September, 2007
|
|
|
|
|
Hello 2 everyone interested!
I am looking for a function to convert data from DWORD, float,double and SYSTEMTIME (if possible, this last one) into string.
In fact, I want to dump variables of those data types into a log file. I am using MFC, with CFile and <filename>.Write() function, which expects a string as a parameter.
If I try using filename.Write(LPWSTR(var))(LPCWSTR, or any other string types...) i get conversion errors (sometimes that it requires 'explicit cast').
Any ideas ?
|
|
|
|
|
have you tired sprintf_s( )
---
Yours Truly, The One and Only!
devmentor.org
Design, Code, Test, Debug
|
|
|
|
|
I have, now. It doesn`t work, although I include stdio.h. It accepts the header (I mean, it finds it to include it), but when encountering sprintf_s() in sais "undeclared identifier".
I have also tried _itoa_s()
Link provided: http://msdn2.microsoft.com/en-us/library/0we9x30h(VS.80).aspx
When compiling, it seems ok, but when the application comes to using that part of the code, I get an application error code, and Windows asking me to send the info to microsoft.
I think that perhaps because I try to convert an unsigned int (DWORD - 64-bit unsigned integer.), using an int-converting function, might result in some buffer overflows. Can anyone suggest an alternative to _itoa_s (for using with unsigned int vars)? I can`t figure it out which is the one...
I think I should mention that I`m writing code for a Smart Device (pocket pc) using WM5.
|
|
|
|
|
sprintf_s will do the trick, I use it all the time... you are doing something wrong in the code?
can you try sprintf, maybe the api i provided earlier is not supported for smart device development?
---
Yours Truly, The One and Only!
devmentor.org
Design, Code, Test, Debug
|
|
|
|