|
Instead of the code that you are writing try this.
void CMyButton::OnSize(...)
{
CButton::OnSize(...);
CRect rect(10,10,30,30);
m_rgn.DeleteObject();
SetWindowRgn(NULL, FALSE);
m_rgn.CreateEllipticRgnIndirect(rect);
SetWindowRgn(m_rgn, TRUE);
}
I hope this helps
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Its not good
<br />
CRect rect;<br />
GetClientRect(rect);<br />
ScreenToClient(rect);<br />
whitesky
|
|
|
|
|
question still exist.
if in non-child windows have not this question, but in button happen.
|
|
|
|
|
Hi ,
HOW WHAT wrote: CRect rect;
GetClientRect(rect);
I'm not sure , but according to MSDN , GetClientRect()
gets as parameter the pointer to the rect , and not the rect
itself :
CWnd::GetClientRect
void GetClientRect( LPRECT lpRect ) const;
So try the following instead :
CRect rect;
GetClientRect(&rect);
Hopes this helps ,
Eli
|
|
|
|
|
CRect::operator LPRECT
CRect rect;GetClientRect(rect);
==
RECT rect;GetClientRect(&rect);
|
|
|
|
|
Hi all,
I created combo box with control variable. I like to set the no of characters to be keyed in in the combobox(editable).
In brief, set the text limit to the Combobox control variable. Can anyone help me in this problem?
Thanks in Advance.
Regards,
Ram
|
|
|
|
|
BOOL LimitText( int nMaxChars );
Regards,
FarPointer
Blog:FARPOINTER
|
|
|
|
|
Use LimitText( long lLimit )
ComboBox m_Combobox;
m_Combobox.LimitText( 64 );
"Dream bigger...Do bigger...Expect smaller"
aji
|
|
|
|
|
hello all,
I want to serially transmit float variables/data types between the PC and the serial device (RABBIT 3000 -an 8bit microcontroller).
I am transmitting with databits as 8 for serial transmission as my microcontroller is an 8bit one.
I convert float to long and bitshift to assign it to a buffer of type char.
But if I do this, then say,
I want to transmit 3.4,then I can transmit only 3 and not the .4
as I convert form float to long before transmitting.
How can I transmit a float data variable from PC to microcontroller or the vice-versa serially.?
|
|
|
|
|
Use...
typedef union
{
float fFloatVar;
UCHAR ucFloatByteArray;
}FloatConverter;
FloatConverter fc;
fc.fFloatVar = 23.456f;
Now just send the bytes in FloatConverter.ucFloatByteArray one by one.
Now while receiving store each byte into the byte array FloatConverter.ucFloatByteArray and then
float fFloatNumber = FloatConverter.fFloatVar;
I guess this should help you.
Thanks to toxcct ...
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
thanks very much.
It works perfectly.
thanks for ur help.
|
|
|
|
|
Or how about:
unsigned char* byteptr = (unsigned char*)&floatVal;
for(int i = 0; i < sizeof(float); ++i)
Send(byteptr[i]); You can use this technique for any struct/basic type, without having to create a "converter" union for each type.
--
For External Use Only
|
|
|
|
|
I need to use a ccontrol list to show data, after pressing button 'showdata'.....in a old project(DIALOG BASED).....the problem is that..... in this project i can't use class wizard.
kamalesh
|
|
|
|
|
Have you removed the wizard comments from source?
AFAIK we can use class wizard, only if we created the project by classwizard.
When pressing the Ctrl+W it will ask for the list of files. I think it appears only for the projects created through class wizard
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
I set a treeview toolbar in my MDI project.
just like the VC++ 6.0 workspace toolbar,Click the item/filename of the fileview, the related file opens and become active. and insert/delete item of the tree, it will new/close the related doc/file .
1.>how to create a new file for the new item ?
2.>when DbclickTree() happens, how to active the related file?
3.>does the files can searched/sort by filename as the treeview item sort?
thanks for ur kind help!
|
|
|
|
|
Hey Guys,
does anybody know a good implementation of the Sorenson H.263 Codec ? I couldn't find a nice on. Well I found some links but they were dead
I appreciate any help.
Thanks,
Ben
|
|
|
|
|
Hi all,
I created combo box with control variable. I like to set the no of characters to be keyed in in the combobox(editable).
In brief, set the text limit to the Combobox control variable. Can anyone help me in this problem?
Thanks in Advance.
Regards,
Ram
|
|
|
|
|
Follow these steps:
1) From View menu, bring up the MFC ClassWizard
2) Add a member variable of CString type for the ComboBox
3) Set maximum characters to a number of your choice
4) Recompile the project
Best,
Jun
|
|
|
|
|
I already set member variable type CComboBox type to the combobox.
And now i have created one more member variable CString type as u hv specified. still i couldnt able to set the text limit to the combo box. advice on this.
Thanks.
Regards,
Ram
|
|
|
|
|
On the "Member Variable" panel, select the variable you just created. As it's a CString type, an edit box named "Maximum characters" will appear at the bottom.
Best,
Jun
|
|
|
|
|
class RTI_EXPORT RTIambassador {<br />
public:<br />
#include "RTIambServices.hh"<br />
RTIambPrivateData* privateData;<br />
private:<br />
RTIambPrivateRefs* privateRefs;<br />
};<br />
<br />
class RTI_EXPORT FederateAmbassador {<br />
public:<br />
#include "federateAmbServices.hh"<br />
};
WHOAA!! What is this suppose to mean
How come we have two names for this class
class RTI_EXPORT RTIambassador {<br />
<br />
.....<br />
<br />
};
Does this mean you can refer to this class by two different names
|
|
|
|
|
|
i need to know how to get the width of a string of text
.GetLength("string"); will return 6
.GetLength("String"); also returns 6
but
.GetStringWidth("string"); returns 22
.GetStringWidth("String"); returns 27 which is what i need but .GetStringWidth is part of a listctrl and i may not always use a listctrl with my class so i need a work around for it.
i hope this is clear on what i need.
|
|
|
|
|
from the MSDN:
CListCtrl::GetStringWidth : The width, in pixels, of the string pointed to by lpsz.
CString::GetLength: A count of the bytes in the string.
bytes != pixels
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
i know that i need the width in pixels just dont know how to get it.
|
|
|
|