|
My program has some property settings and so i make a dialog box with some textboxes and checkboxes to display all those settings. I allow the user to change the settings and save them. I want to update the Dialog view when the user click the checkbox. For example, there are 8 checkboxes represent 8 bit binary number and there is a textbox to represent this 8-bit binary in hex number. I want the textbox display the most updated binary information from those 8 checkboxes.
So, I send message to the dialog when the user "click" the checkbox. However, i don't know how to update the Dialog box so that it can update the textbox.....
Can anyone help me?
|
|
|
|
|
Invalidate(false) redraws a window ( which both the text box and dialog box are ) without erasing the background first, thus avoiding flicker. Invalidate(true) erases the background first.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
I think you want CWnd::UpdateData().
|
|
|
|
|
Dear all,
How can I pass the string in a char array or CString array in this Speak() function?
e.g. char chararray[5][5];
chararray[0] = "Hello";
or
CString cstringarray[5][5];
cstringarray[0] = "How are you";
HRESULT Speak (PCWSTR pszSpeak);
Since the parameter should be a pointer of WCHAR, do anyone know how to convert the string to the suitable parameter?
Looking forward to your sincere reply. Thanks a lot!
|
|
|
|
|
Vickie,
usually when I write applications I decide to either use wide characters (Unicode) strings everywhere or to use normal characters thus avoiding problems like yours. But I have had the same problem you are having numerous times. There are two ways that I have used to convert plain old char arrays to wide characters:
1. Windows provides two API calls to help things along:
WideCharToMultiByte and MultiByteToWideChar these functions take quite a few parameters and can be quite cumbersome to use.
2. Use wcstombs and mbstowcs (this is the method I prefere). Look them up in your doco but this will give you an idea:
char mBuf[255];
wchar_t wBuf[255];
i = mbstowcs( bBuf, mBuf, 255 );
hope this helps
Accept that some days you are the pigeon and some days the statue.
|
|
|
|
|
ummm
is the app a unicode (or wide char) app? if so all your strings will be wide char so passing a string ptr is as easy as Speak(szString) or Speak ((LPCTSTR)csString)
if the app isnt unicode then u have to use the conversion macros
USES_CONVERSION;
W2A(blah blah blah)
A2W(blee blee blee)
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
<<< In the name of GOD >>>
Hi.
I want to display icon inside the text in ListBox
in VC++, but i don't know how can i use of WM_DRAWITEM
message and DRAWITEMSTRUCT structure.
Please help me ...
Thanks.
Hadi Rezaie
|
|
|
|
|
Take a look at CComboBoxEx. Just define an image list using SetImageList() and then select the desired image when you add an entry. Voila.
|
|
|
|
|
I compile my (any) WTL Project with following settings:
Project/Settings/C++/Calling Convension: __stdcall.
In release configuration I'm forcedly compile with Debug Run-time library (instead release lib; Project/Settings/C++/Use run-time library),
else : "The instruction at ... referenced memory at ... . Memory could not be read" - with any release lib - single threaded, multithreaded, multithreaded DLL.
Thanx for any help.
|
|
|
|
|
Hi,
I've got to develop a snap-in for the Microsoft Management Console (mmc). I dont have documentation to do that. If someone have a link or an example to help me it would be very apreciate. I usually seen the msdn documentation but it's not very clear in my head and I have trouble with the example.
Thanx for helping me !!!
|
|
|
|
|
I've wrote one...
If it's still actuelle, write me - reznitskiy@softlab.ru
|
|
|
|
|
The Microsoft Platform SDK has numerous code samples for Snap-ins.
|
|
|
|
|
The context menu is simply popup by right clicking the mouse. That's the system default that I don't want it.
|
|
|
|
|
subclass it and trap the right mouse click event and do nothing in it
seems the easiest way to me
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
As we all know, forward declarations are necesary to implement circular references, like below:
struct A;
struct B
{
A * a;
};
struct A
{
B * b
};
My problem is, how do i deal with this using templates? The following pice of code is a syntax error in VC++ 6.0:
template<class c="">
struct A;
template<class c="">
struct B
{
A<c> * a;
};
template<class c="">
struct A
{
B<c> * b
};
Does anyone know th correct syntax?
Jonas Pettersson
|
|
|
|
|
Hmm, this discussion group does not seem to support brackets, they didn't get posted. I'll re-write the question using parenthesis as brackets...
------------------------------------------------------------------------------------------
As we all know, forward declarations are necesary to implement circular references, like below:
struct A;
struct B
{
A * a;
};
struct A
{
B * b
};
My problem is, how do i deal with this using templates? The following pice of code is a syntax error in VC++ 6.0:
template(class C)
struct A;
template(class C)
struct B
{
A(C) * a;
};
template(class C)
struct A
{
B(C) * b
};
Jonas
|
|
|
|
|
I don't get template-related syntax errors when compiling the code in VC6 after simply changing the parentheses to brackets...there is a missing semi-colon after B<c>* b in struct A, but other than that, no problems. (I'm able to create instances of the structs, too; link and running is no problem.)
Walter Gildersleeve
Freiburg, Germany
walter.gildersleeve@pe-gmbh.de
|
|
|
|
|
Hi there,
I am trying to add a small table to my MFC application. I want this to be kind
of like Excel cells, except for I don't want to use Excel. I want to be able to
draw the border lines and also be able to edit the code within each cell.
Being able to extend the width is not necessarily an issue.
Is this possible? What class should I subclass from? I tried using CRichEditView
and CEditView since they seem to be the only ones that allow editing, but drawing
on these wasn't possible, at least within my knowledge.
Could you give me some tip on this.
|
|
|
|
|
You need Chris Maunder's grid control, available on this site. ( at least I seem to recall it was Chris's )
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
or u could subclass a listview control to allow editing in any cell
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
I am trying to get some kind of multiline on my CButton. I am using this to center my text:
case vxCBMiddleCenter:
if (m_bMultiLine == TRUE)
{
pDC->DrawText (Caption, ControlRect, DT_WORDBREAK);
}
else
{
pDC->TextOut (Window.Width() / 2 - csSize.cx / 2,
Window.Height() / 2 - csSize.cy / 2,
Caption);
}
break;
Of course I have different case's for the other alignments on my CButton. I am using TextOut to write my CString (Caption), but I can't find a way to break to another line if I cross the Rect (Window) bounds. DT_WORDBREAK will work in my CString contains spaces (This is a test...), but how do I get this (ThisIsATest...) to break to the next line?
Thanks,
Chris
|
|
|
|
|
call DrawText with the DT_CALCRECT flag and the width of the button set ... then get the size of the bounding rect ... then figure out (using GetTextExtent) how many chars will fit on a line (u can use the average font char width to get a rough approx) ... then draw the text in 2 or more goes using what will fit on each line
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
Is it possible to split a view so it looks like this:
-----------------
|A |B |
| | |
| | |
| | |
-----------------
|C |
| |
-----------------
view a, b, c,... and can I split view B again, and so on....
if so how???
Peter Marino
|
|
|
|
|
u can split views in very twisted ways ... just check out the reuters terminal software (if you're in the financial markets) ... i've never seen so many splitter windows on one screen but surprisingly it is easy-ish to use
so how to do it? heh ... use CSplitterWnd::Create() instead of CSplitterWnd::CreateStatic() ... then use CSplitterWnd::SplitRow() or CSplitterWnd::SplitColumn() and have fun
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
it doesn't work I get an assert all the time,
SIZE s;
s.cx = 100;
s.cy = 100;
m_SplitterWnd.Create( this, 1, 2, s, pContext );
m_SplitterWnd.SplitColumn( x );
I tried using different values for x
|
|
|
|