|
i need to drop buttons on a CToolBar, but state of the CToolBar is very strange:
the tool bar has multi-buttons, i.e. 5 in 2 rows.
when drop a button (use InsertButton function) on it, an original button dispears (just can not see, but it is there) and new button is on, add one more, toolbar becomes 3 rows, and so on.
anyway, i can see only 5 buttons.
if double click, bar goes docked, all buttons apear! double click again, all buttons are still there.
it means i need to refresh tool bar after drop a button on it.
i call RecalLayout, Invalidate, RedrawWindow, AutoSize ... and all functions i can find, but no luck
please help
includeh10
|
|
|
|
|
Hi all,
According to MSDN, CDC::DrawText will not alter the width of the CRect given to it when there are multiple lines of text and DT_CALCRECT is specified, only the height. Is this information correct, and if so what is the correct way to specify multiple lines of text? I have my text in a CString object, and I'm trying to break text into lines by sticking \n in appropriate places but the width (i.e. my CRect::right ) is being altered, is this not the correct way to separate lines?
If it is the correct way, is there some magic trick I need to do with the DC to stop DrawText from playing with CDC::right ? I've done:
pDC->SetTextAlign(TA_LEFT | TA_TOP);
pDC->SelectObject(m_FontMain);
The bad code:
pDC->DrawText(strComm, rcComm, DT_CALCRECT | DT_WORDBREAK | DT_LEFT | DT_NOPREFIX);
Dylan Kenneally
London, UK
|
|
|
|
|
I think that you are on the right track, however if you look at the description for the DT_WORDBREAK flag this is what it says:
Breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the lpRect parameter. A carriage return-line feed sequence also breaks the line.
So I would try using "\r\n" to insert line breaks rather than just "\n".
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi! I'm new using CListCtrl and i've been reading some articles how to sort it's columns in the Report mode.
I've a class derived from CHeaderCtrl que does it, but i must pass two arguments, the iSubItem of the column and if i want to sort ASC or DESC, i'm doing like this:
void CExeptions::OnColumnclickCombo1(NMHDR* pNMHDR, LRESULT* pResult)
{
int iB=0;
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
LVITEM lvi;
LVCOLUMN col;
col.mask = LVM_GETCOLUMN;
ListCtrl.GetItem(&lvi);
iB=col.iSubItem;
m_headerctrl.SetSortImage(iB, true);
*pResult = 0;
}
but i can't get the value of the iSubItem.
What am i doing wrong?
Thank you for your time
|
|
|
|
|
sorry, i miscopy the line iB=col.iSubItem;, its iB=lvi.iSubItem;
unfortunally, that was not the problem
|
|
|
|
|
I just opened win32 application and this code.
char *l1;
l1=(char *)malloc(sizeof(10));
strcpy(l1,"suresh");
MessageBox(NULL,l1,"value",MB_OK);
free(l1);
When i run the program,run time error happens.
why ?
|
|
|
|
|
sizeof(10) returns actually sizeof(int). Write:
l1=(char *)malloc(10);
|
|
|
|
|
Actually, one should write l1 = (char*)malloc (10 * sizeof (char));
Best regards,
Alexandru Savescu
|
|
|
|
|
How can I use an ActiveX in My Activex control?
|
|
|
|
|
Please be more Clear.
I didnt understand ur question
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
Can gdi+ draw a line with 3d looks like?
And how?
Any suggestion?
Thanks!!
i am realfly8)
|
|
|
|
|
Be a bit more precise, what do you mean by:
realfly wrote:
with 3d looks like?
Normski. - the next bit of code is self modifying ... jmp 0xCODE
|
|
|
|
|
I mean such as a metal thead.
What I do now is get a bmp which to be the TextureBrush.
It works find when I draw a horizontal line. but when that's not the horizontal one. It looks bad.
What should i do?
i am realfly8)
|
|
|
|
|
Sure - you can draw whatever you like. Just draw with some perspective.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
How can I change a border width for frame?
|
|
|
|
|
Well, im trying to write this RC4 encryption class... but its not working properly.... And I cant find the bug.... Can you?
class CEncrypt
{
int m_sBox[256];
public:
CEncrypt() {}
~CEncrypt() {}
void SetKey(char *sKey, int iKeyLen)
{
int i, j = 0, k;
for (i = 0; i < 256; i++)
m_sBox[i] = i;
for (i = 0; i < 256; i++) {
j = (j + m_sBox[i] + sKey[i % iKeyLen]) % 256;
k = m_sBox[i];
m_sBox[i] = m_sBox[j];
m_sBox[j] = k;
}
}
void Encrypt(char *sBuffer, int iBufferLen)
{
int sBox[256], iOffset, i = 0, j = 0, k;
memcpy(sBox, m_sBox, sizeof(m_sBox));
for (iOffset = 0; iOffset < iBufferLen; iOffset++) {
i = (i + 1) % 256;
j = (j + sBox[i]) % 256;
k = sBox[i];
sBox[i] = sBox[j];
sBox[j] = k;
sBuffer[iOffset] = sBuffer[iOffset] ^ (sBox[(sBox[i] + sBox[j]) % 256]);
}
}
};
|
|
|
|
|
Not without descriptions of what the code is supposed to do, and what it actually ends up doing.
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Try to compare your source with some from here:
ftp://ftp.funet.fi/pub/crypt/cryptography/symmetric/rc4
|
|
|
|
|
Well, im trying to write this RC4 encryption class... but its not working properly.... And I cant find the bug.... Can you?
class CEncrypt
{
int m_sBox[256];
public:
CEncrypt() {}
~CEncrypt() {}
void SetKey(char *sKey, int iKeyLen)
{
int i, j = 0, k;
for (i = 0; i < 256; i++)
m_sBox[i] = i;
for (i = 0; i < 256; i++) {
j = (j + m_sBox[i] + sKey[i % iKeyLen]) % 256;
k = m_sBox[i];
m_sBox[i] = m_sBox[j];
m_sBox[j] = k;
}
}
void Encrypt(char *sBuffer, int iBufferLen)
{
int sBox[256], iOffset, i = 0, j = 0, k;
memcpy(sBox, m_sBox, sizeof(m_sBox));
for (iOffset = 0; iOffset < iBufferLen; iOffset++) {
i = (i + 1) % 256;
j = (j + sBox[i]) % 256;
k = sBox[i];
sBox[i] = sBox[j];
sBox[j] = k;
sBuffer[iOffset] = sBuffer[iOffset] ^ (sBox[(sBox[i] + sBox[j]) % 256]);
}
}
};
|
|
|
|
|
Does eMbedded Visual C++ 4.0 support ATL-OLEDB Consumer classes e.g., CCommand, CAccessor etc. Need to port a component that extensively uses these classes to Windows CE .NET platform?
Thanks in advance
|
|
|
|
|
How do you get the path/names of special folders on a computer? Like "desktop", "temp", "favorite" etc? I tried to look them in MSDN but only found ::GetSystemDirectory. Thanks.
|
|
|
|
|
SHGetSpecialFolderLocation() or SHGetSpecialFolderPath()
CPUA 0x5041
Sonork 100.11743 Chicken Little
My pet, My pet stick
Nicer than a twig
Cooler than a rock.
(Microsoft ad)
Within you lies the power for good - Use it!
|
|
|
|
|
how can i group my command buttons and perform the same function
|
|
|
|
|
How to distinguish from MO,Zip and Card reader except find out there lable. Because there are the removeable device,I have trouble of them.
Could you help me?
Thanks a lot.
mail:cshung@email.geniusnet.com.tw
|
|
|
|
|
Hi!Everybody.
The normal tree are just like this:
root
+sub1
+sub2
+subsub1
Do anybody known about a tree which is right to left construct?
like below:
root
sub2+
sub1+
subsub1+
a strange question8)
Thanks in advance!
i am realfly8)
|
|
|
|