|
I cannot figure it out either, some source comment would have been handy. Also, I can not find anything about this problem on the whole damn internet (google search). I guess I just have to put up with it and try to restain myself from smashing my keyboard.
|
|
|
|
|
Are you using the AFX_MANAGE_STATE( ) macro at the top of the function in the dll that destroys the window?
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
That's It! I thought I already added it, but I hadn't done so in the destructor. Thanx !
|
|
|
|
|
hi, just implemented in-place editing for list control as illustrated by:S.Prabhakarreddy / CodeProject
Reference: http://www.codeproject.com/listctrl/editing_subitems_in_listcontrol.asp
QUESTION 1: How can I use arrow keys (Keyboard) to navigate around the list control?
QUESTION 2: The implementation at the moment is such that you click on a cell, type and press ENTER. But what's better is click, type and press ARROW key. But how? I tried OnKeyDown for the dialog class. But not much luck.
QUESTION 3: Seems like ListView_GetSubItemRect is not doing its job properly... the following is code in message handler for click on list control:
// this macro is used to retrieve the Rectangle
// of the selected SubItem
ListView_GetSubItemRect(
hWnd1,
temp->iItem,
temp->iSubItem,
LVIR_BOUNDS,
&rect);
//Why +13? It's just trial and error. Seems like ListView_GetSubItemRect is not doing its job properly.
::SetWindowPos(::GetDlgItem(m_hWnd,IDC_EDIT1),
HWND_TOP,
rect.left +13, //You need to compensate for the deviation u get from ListView_GetSubItemRect!?!
rect.top +13,
rect.right-rect.left,
rect.bottom-rect.top,
NULL);
Thanks!
norm
|
|
|
|
|
If you want to be able to jump between cells using arrow keys you have to intercept them in the editbox itself because the editbox receives the keydown event. I did similar things once (using the TAB key to move between cells) and the code looked something like this:
<br />
<br />
void CInPlaceEdit::OnChar( UINT nChar, UINT nRepCnt, UINT nFlags )<br />
{<br />
if ( nChar == VK_TAB )<br />
{<br />
if ( GetKeyState( VK_SHIFT ) < 0 )<br />
{<br />
m_pListCtrlParent->OnPreviousCell( );<br />
}<br />
else<br />
{<br />
m_pListCtrlParent->OnNextCell( );<br />
}<br />
}<br />
}<br />
<br />
where m_pListCtrlParent is a pointer to the parent Listctrl. It contains the method called in the code and these methods basically do this:
- grab the focus (because the edit box knows that it should disappear when it loses focus)
- calculate the next cell to be edited
- initiate the edit for that cell
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
how do i use the LogonUser and CreateProcessAsUser functions together to create processes in windows xp?
|
|
|
|
|
The solution here =)
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q180548
Simplicity is the supreme sophistication.
-------------------------------------------
http://www.borie.org/
|
|
|
|
|
Hi,
I am storing password with a database table and would like to encrypty them to a reasonable level. Is there any standard windows api function that could help me? relucltant to use a third-party library.
Can anyone offer me any advice.
Cheers
Rich
|
|
|
|
|
There is a MFC Sample for _file_ encryption, but you won't escape CryptoAPI for passwords, I think.
~RaGE();
|
|
|
|
|
Just pass the password through a suitable one way hash function
like MD5 or SHA. Store the hash value. When the user enters
password, compute the hash and check against stored value.
The algorithms are pretty easy to just include in your source
files.
example here.[^]
[edit] That assumes you just need to validate entered passwords, not use them... [edit]
|
|
|
|
|
Hi,
What I have to use to develop a stand alone application with which one can VOICE CHAT with other OVER INTERNET
I don't want to use TAPI or DirectPlay or NetMeeting SDK. What are other options with which I can develop Voice Conferencing over Internet application.
|
|
|
|
|
|
I have a CWinThread derived class CMyThread. I create modalless dialog :
BOOL CManThread::InitInstance()
{
m_dlg.Create(IDD_DIALOG);
m_dlg.ShowWindow(SW_SHOW);
return TRUE;
}
Dialog works fine, but how to notify my thread when dialog is closed, so that i could sent WM_QUIT message to end the thread ?
Thanks
rrrado
|
|
|
|
|
You may override OnOK() or OnCancel() function in your dialog class, and send a WM_QUIT at that moment.
~RaGE();
|
|
|
|
|
thanks, but I tried to call m_thread->PostThreadMessage(WM_QUIT,0,0) inside of OnCancel. But after closing of dialog some Asssertion fails and application crashes.
rrrado
|
|
|
|
|
If all your thread does is create the modeless dialog, you don't need the thread at all. Just create the dialog and presto.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
i failed to intercept WM_NOTIFY when i attempt to edit fields of my CListCtrl control in my dialog application..?
Here's my OnNotify code:
BOOL CQGenInstallDlg::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
// TODO: Add your specialized code here and/or call the base class
//<norman: 27-nov-2002="" handle="" editing="" on="" list="" view="" control="" this-="">m_lvSettingList>
UINT nNotCode = 0; //Notification code.
INT nCtrlID = 0; //wParam
LV_DISPINFO* pDispInfo = NULL; //lParam
pDispInfo = (LV_DISPINFO*) lParam;
nNotCode = pDispInfo->hdr.code;
if(nNotCode==LVN_BEGINLABELEDIT)
{
//Pre-edit processing.
}
if(nNotCode==LVN_ENDLABELEDIT)
{
//Post-edit processing.
UINT itemindex = pDispInfo->item.iItem;
CString newText = pDispInfo->item.pszText;
if(newText!="")
{
this->m_lvSettingList.SetItemText(itemindex, 1, newText);
}
}
//
return CDialog::OnNotify(wParam, lParam, pResult);
}
Hope someone can spot this for me. Thanks!
norm
|
|
|
|
|
Did you check the checkbox in the ressource editor so that your control _really_ sends a notify message ?
~RaGE();
|
|
|
|
|
sorry, what's a "resource editor"??
norm
|
|
|
|
|
In Vc++, you have usually a window on the left showing the class browser, or the files in your project or what i call the ressource editor which you can choose on the middle tab. In the properties of your control on your dialog (right click on your control to open this one) you have usually several tabs. On one of the page you might have a checkbox to check if you want your notify messages to work correctly.
Maybe you are not using ressources at all, so i must have made a complete fool of myself
~RaGE();
|
|
|
|
|
Joan,
I use the following routines to iterate all child nodes with a specific name:
<br />
typedef MSXML::IXMLDOMNodePtr NodePtr;<br />
<br />
<br />
NodePtr CXMLDocument::GetChild(NodePtr pNode, LPCTSTR pszName)<br />
{<br />
if (pNode == 0)<br />
pNode = m_pDoc;<br />
pNode = pNode->firstChild;<br />
<br />
while(pNode)<br />
{<br />
if (pNode->nodeType == MSXML::NODE_ELEMENT)<br />
{<br />
if (!pszName || _tcsicmp((TCHAR*) pNode->nodeName, pszName) == 0)<br />
return pNode;<br />
}<br />
pNode = pNode->nextSibling;<br />
}<br />
return 0;<br />
}<br />
<br />
<br />
NodePtr CXMLDocument::GetNext(NodePtr pNode, LPCTSTR pszName)<br />
{<br />
if (pNode == 0)<br />
pNode = m_pDoc;<br />
pNode = pNode->nextSibling;<br />
<br />
while(pNode)<br />
{<br />
if (pNode->nodeType == MSXML::NODE_ELEMENT)<br />
{<br />
if (!pszName || _tcsicmp((TCHAR*) pNode->nodeName, pszName) == 0)<br />
return pNode;<br />
}<br />
pNode = pNode->nextSibling;<br />
}<br />
return 0;<br />
}<br />
alternatively, you could look into XPath (there is a reference in the XML Parser DSK, which allows you to use pDoc->selectSingleNode("//result/node/buffers") to reference one or more specific elements
in your document.
Alwin
|
|
|
|
|
You can't expect a BSTR string to behave like a char*. Use this code instead.
IXMLDOMElement *p = ...;
CString szName;
BSTR bstrName;
p->get_nodeName(&bstrName);
BSTR_to_CString(bstrName,szName);
void BSTR_to_CString(BSTR bstr, CString &s)
{
s.Empty();
_bstr_t bstrTag(bstr);
UINT uLen = bstrTag.length();
if (uLen==0) return;
TCHAR *szTemp= new TCHAR[uLen+1];
memset (szTemp, 0, uLen+1);
LPOLESTR wszTag = bstrTag;
int iBytes = ::WideCharToMultiByte(CP_ACP, 0,
wszTag, uLen,
szTemp, uLen, NULL, NULL);
s = szTemp;
delete [] szTemp;
::SysFreeString(bstr);
}
|
|
|
|
|
I'm coming fom Borland OWL environement
and i would like to know How paiting my dialog background with
VC++6 in MFC ?
I'm juste a little lost with the MFC
I'm a newbie with the MFC
Thanks for u're help
ps: oops sorry my english is not perfect
Leedoriden
|
|
|
|
|
|
Hi:
I want the algorithm of arranging classes.I have thought it for many days,but the program does not work.If you have seen the algorithm,please tell me.
Thanks a lot.
Got it
|
|
|
|