|
I did a destroy WIndow on a view from another view. Well, the view didnt vanish like i thought it would. But if I dragged view1 over it, it made a big white area where view2 was. I tried invalidate() but thats not it.. Shouldnt view2 have vanished? WHat should I do to make it vanish?
Thanks,
ns
|
|
|
|
|
here's the code, when i get to the GetOpenFileName line it gives me an unhandled exception, i can't figure out what's wrong, here's the code:
void OnBrowse()
{
OPENFILENAME ofn;
char szFileName[MAX_PATH+1];
const char szFilter[] = "All Files (*.*)\0" "*.*\0";
szFileName[0] = '\0';
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = ghWnd;
ofn.lpstrFilter = szFilter;
ofn.lpstrCustomFilter = (LPSTR)NULL;
ofn.nFilterIndex = 1;
ofn.lpstrFile = szFileName;
ofn.nMaxFile = sizeof(szFileName);
ofn.lpstrFileTitle = NULL;
ofn.lpstrTitle = (LPSTR)NULL;
ofn.Flags = OFN_ENABLESIZING | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST | OFN_EXPLORER;
ofn.nFileOffset = 0;
ofn.nFileExtension = 0;
ofn.lpstrDefExt = "txt";
if (GetOpenFileName(&ofn))
SetDlgItemText(ghWnd, IDC_LIST, szFileName);
}
Thanks in advance.
-Rune Svendsen
|
|
|
|
|
A couple of points I can see from looking at the documentation for GetOpenFileName() .
- What operating system are you using? There's a note in the platform SDK documentation that says:
"lStructSize Specifies the length, in bytes, of the structure.
Windows NT 4.0: In an application that is compiled with WINVER and _WIN32_WINNT >= 0x0500, use OPENFILENAME_SIZE_VERSION_400 for this member.
Windows 2000/XP: Use sizeof (OPENFILENAME) for this parameter."
- This is more likely to be the problem - you've forgotten
lpstrInitialDir . It should either be the directory you want the dialog to start in, or NULL.
Hope that helps!
"We are the knights who say Ni" (The Knights Who Say Ni)
|
|
|
|
|
Thanks, it was the lpstrInitialDir.
|
|
|
|
|
Can someone give me some clues on how I can do the following things, eg what sort of messages I need to be overriding.
- I have an MDI app. When the MDI frame is loaded, I load a modeless dialog box acting as a toolbox. Id like to be able to drag things from this toolbox onto the view.
- Once things are dragged onto the (CView derived) view, id like to be able to drag them around, and possibly be able to link them up, eg when i ricght click on one of the nodes a line is extended, and when this is released on top of another node, things happen in the document.
Ive never been able to get much use out of Spyy++.
|
|
|
|
|
Spy++ won't help you. You need to define classes to describe the objects you want to drag and drop, then you need a container in which to store them so you can draw the ones that are already there, and select them to move them.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
I want to keep all the urls to whome users navigated for this purpose I have to implement the DWebBrowserEvents2 (sinking interface) in my ATL COM based dll but I do not exactly know how to write that dll and to advice internet explorer to call that function on event firing if some one know then tell me or guid me on this problem I will be very much thankful
Waiting for your cool comments
|
|
|
|
|
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
|
|
|
|