|
Wicked, wicked, wicked.
He's going to blame you when Windows won't work anymore.
|
|
|
|
|
normanS wrote: He's going to blame you when Windows won't work anymore
Mmm, feels like giving the five-year-old matches to play with....
It might go well, but then again, it might not...
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
Hello
I've got problem with blinking window. My application is multi-doc one. One of my view is simple CView with drawing code in OnPaint. This view is repainting every second (when new data is arriving). From this view I'm creating new window which is a child to my current view's frame. Class of this "child" window is inherited by CWnd class. Unfortunately whan my CView is repainting the top window (child window) is blinking. I've used double-buffering technique - and nothing - still the same problem. Here is my code's samples:
1. Making window:
void CBigValueEdit::setVisible( bool b ) {
if ( b == true ) {
if (this->Create( NULL, _T("Test;"), WS_CHILDWINDOW | WS_VISIBLE | WS_BORDER | WS_CAPTION , rect, parent, IDW_BIG_VALUE ) != 0 ) {
this->ShowWindow( SW_SHOW );
this->SetFocus();
visible = true;
calcRects();
setDigitVal();
}
} else {
// wyłącz okienko
visible = false;
this->ShowWindow( SW_HIDE );
this->DestroyWindow();
}
}
2. Double-buffering:
if ( bmpCreated == false ) {
bmpBufor.CreateCompatibleBitmap( dc, rect.Width(), rect.Height() );
vdc.CreateCompatibleDC( dc );
vdc.SelectObject( bmpBufor );
bmpCreated = true;
}
[...]
dc->BitBlt( 0, 0, rect.Width(), rect.Height(), &vdc, 0, 0, SRCCOPY );
3. Making window from main CView class:
ed.setTitle("Set high alarm :");
ed.setRectangle( rect );
ed.setFormat(4,2);
ed.setValue( selectedCounter->getAlarmLowValue() );
ed.setVisible( true );
ed - my class inherited by CWnd...
What;s wrong Where's the catch?
Please - help me...
-=AragornX=-
modified 4-Apr-13 4:07am.
|
|
|
|
|
Have you responded to WM_ERASEBKGND? If you are using double buffering you should respond to this message ans return TRUE, to tell Windows that the background has been erased, otherwise Windows will erase the background with the default brush defined in the windows class.
|
|
|
|
|
It didn't help... The unwanted effect is that the background window(parent) is in one moment drawn over the child window...
|
|
|
|
|
hi guys this is rocky...
i got stuck in a problem........
i want to convert the char* into LPWSTR......
Plz help me and thnx in advance
Best Regards Rocky
Rocky
|
|
|
|
|
Rocky Marrone wrote: want to convert the char* into LPWSTR......
use MultiByteToWideChar
nave
|
|
|
|
|
<br />
char *m_char;<br />
m_char=new (char);<br />
m_char="this is test";<br />
USES_CONVERSION;<br />
LPWSTR lpw;<br />
lpw=A2W(m_char);<br />
<br />
whitesky
|
|
|
|
|
If you are using VC7.0 or later then you have access to the ATL7.0 conversion macros which are much better then the ATL3.0 conversion macros you introduced here. The new versions use the heap instead of the stack for memory allocation so they will not cause stack overflows if used in loops or recursive functions. Read about them in MSDN.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Thank you for information Mr PJ Arends
whitesky
|
|
|
|
|
if u r using MFC libraby, u can do this using
char * pName = new char[5];
strcpy(pName,"test");
CString strText(pName);
u can do different conversion using CString e.g: LPSTR, LPCTSTR, LPWSTR
LPWSTR pWstr = (LPWSTR)strText;
SaRath
"D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"
|
|
|
|
|
I am having a VC++/MFC application it is receiving 10,000 paramaters per second (4 bytes per paramater)
from remote side.I want to insert this data into Oracle server using
ODBC .But any database is having maximum fieldsize of 8000 chars or Maximum 1000
field in one table.
So how do I insert this type of data into oracle or MS SQL server.
I want to retrive this data for further stasstics.Please help
Thanks in Advance
-- modified at 8:01 Tuesday 30th May, 2006
|
|
|
|
|
Assuming that you mean the remote side is sending you 40,000 bytes of data per second, and you want to store that data as a distinct row, then you probably need what's known as a BLOB field (Binary Long OBject). If memory serves, then you can only have one of these per row.
Steve S
Developer for hire
|
|
|
|
|
How to find the number of lines compiled in C/C++?
Its expected to write/display the numper of line compiled in some std output device or a file at the end of compilation.
Is there any compiler option for it?
Balachander.P
|
|
|
|
|
|
Project Line Counter[^] is a powerful open source visual studio add-in.
it's main advantage is that it doesn't count the written code line but the generated code lines...
for instance
printf("Hello World");
and
printf(
"Hello "
"World");
produces the same number of code lines...
they also provide they sources[^] on codeproject...
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
<br />
#include<stdio.h><br />
<br />
typedef struct A<br />
{<br />
int a;<br />
char c;<br />
}A;<br />
<br />
typedef struct B:A<br />
{<br />
int bb;<br />
}B;<br />
<br />
int main()<br />
{<br />
printf("%d",sizeof(A),sizeof(B));<br />
}
Hi frends, I tried the above program.
Can any of u tell me the reason y it is not working??
It is simply a C program..
How can v support Inheritance in C??
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
|
<br />
typedef struct A<br />
{<br />
int a;<br />
char c;<br />
}A;<br />
<br />
typedef struct B:A<br />
{<br />
int bb;<br />
}B;<br />
<br />
int main()<br />
{<br />
printf("%d%d",sizeof(A),sizeof(B));
}
and the output as:
8 12
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
toxcct wrote: this is certainly not C !!!
How true....
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
|
|
Thanks buddies,
When i ran the above as .c ,I got the error C2059: syntax error : ':' ,
But when i ran the above file as .cpp, still i am getting the same error, what is wrong in it??
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
Even if i save the file as.cpp and run the program i am getting the error C2059: syntax error : ':'
Why so ??
Appu..
"If you judge people, you have no time to love them."
|
|
|
|