|
Hello all,
I had a question regarding how to get to the View of a particular window. I created an MDI application without doc/view support. When I hit File->new, a new window appears thansk to this App Generated Code
CMainFrame* pFrame = STATIC_DOWNCAST(CMainFrame, m_pMainWnd);
// create a new MDI child window
pFrame->CreateNewChild(
RUNTIME_CLASS(CChildFrame), IDR_NICKMITYPE, m_hMDIMenu, m_hMDIAccel);
My problem is that I wish to open a DIB into this new window. Everytime I open the DIB though, it goes to the background of my application and not to this new window. I have determied that this happens due to the fact that when I call GetView(), it returns &m_wndView. m_wndView is the view of the ChildView class, and hence it always appears as the background (right?). How can I get to the View of the Child Window that was created? Please help me out, or let me know if I am going about this in the right way.
I am thinking that what I should do is write a new view class, and have the DIB open into a new window using this view class. What do you guys think?
Thanks,
NickOne
|
|
|
|
|
Hi,
I'm working on an Add-in for VS6. One of my pb is to deal with modeless dialog.
When I use a non modal window, I do not catch all the messages from the keyboard anymore. For instance, if I type some text in an edit box, everything is fine except for the DEL key (same with Escape, Ctrl-Z, etc.) which acts in the VS editor window behind...
If you have any suggestions...
Christophe
|
|
|
|
|
Hi,
how do I enable the Edit-Menu for a RichEditCtrl that I have docked in a CtrlBar ?
I thought there was an article here, but I don't find it anymore.
thanks
-widi
-
|
|
|
|
|
Hi, I've been working with Ole DB and I'd like to be in touch with people who work with it too, because there is a lack of information on this matter. What we can find on microsoft's examples is raw code..Maybe we can open a forum here...what do you think...send comments
Willie
W. Zayas
|
|
|
|
|
I am trying to wrap a text using DrawText function with DT_WORDBREAK and even DT_CALCRECT, but I am not getting correct results…..
I need clear information regarding this problem…. Thx
|
|
|
|
|
Hamzeh wrote:
I am not getting correct results…..
Need more info.
Jason Henderson start page ; articles
henderson is coming
henderson is an opponent's worst nightmare
* googlism *
|
|
|
|
|
Take a look at the code for the DrawTheText member function in Davide Calabro's CButtonST v3.7 (MFC Flat buttons)[^] article here on CP.
Roger Stewart
"I Owe, I Owe, it's off to work I go..."
|
|
|
|
|
Hi,
I´ve been using the Crypto API to sign digital messages.
Everything works fine under windows 2000, but when I try
to sign a message under windows 9x it just doesn´t work.
After I click the button the system brings nothing back as
if hasn´t found the certificate.
The code executed for retrieving the certificate is:
if(myCert.FindBySerialNumber(issuer,sn))<br />
if(m_cryptmsg.SignMessage(&myCert,m_texto,&pbData, <br />
&cbData))<br />
{<br />
blob = new CCryptoBlob( pbData, cbData );<br />
m_lpRet = (LPSTR)blob->ToBase64(); <br />
blob->Release(); <br />
}<br />
else<br />
_tcscpy(m_lpRet,_T(""));
Is there anything that should be done different for it to
work under Win 9x?
Thanks in advance
|
|
|
|
|
I have an application that has a tab-page on which some controls can be placed. These controls are created in a DLL. When I try to delete these controls from within the DLL I get an assertion failure in the CWnd::DestroyWindow of the controls at ASSERT(m_hWnd == hWndOrig); . Anyone know how to fix this? ...it is realy anoying me.
<br />
BOOL CWnd::DestroyWindow()<br />
{<br />
if (m_hWnd == NULL)<br />
return FALSE;<br />
<br />
CHandleMap* pMap = afxMapHWND();<br />
ASSERT(pMap != NULL);<br />
CWnd* pWnd = (CWnd*)pMap->LookupPermanent(m_hWnd);<br />
#ifdef _DEBUG<br />
HWND hWndOrig = m_hWnd;<br />
#endif<br />
<br />
#ifdef _AFX_NO_OCC_SUPPORT<br />
BOOL bResult = ::DestroyWindow(m_hWnd);<br />
#else //_AFX_NO_OCC_SUPPORT<br />
BOOL bResult;<br />
if (m_pCtrlSite == NULL)<br />
bResult = ::DestroyWindow(m_hWnd);<br />
else<br />
bResult = m_pCtrlSite->DestroyControl();<br />
#endif //_AFX_NO_OCC_SUPPORT<br />
<br />
if (pWnd != NULL)<br />
{<br />
#ifdef _DEBUG<br />
ASSERT(pMap->LookupPermanent(hWndOrig) == NULL);<br />
#endif<br />
}<br />
else<br />
{<br />
#ifdef _DEBUG<br />
ASSERT(m_hWnd == hWndOrig);<br />
#endif<br />
Detach();<br />
}<br />
return bResult;<br />
}<br />
|
|
|
|
|
What's the value of bResult before the assertion fails ?
~RaGE();
|
|
|
|
|
When the assertions fails:
bResult = TRUE
m_hWnd = 0x00000000
hWndOrig = 0x000408e6
|
|
|
|
|
I do not understand why it souhld _not_ cause an assertion here. You destroy the window (since bResult is true) so m_hWnd is NULL, so pWnd is NULL, so m_hWnd cannot be equal to m_hWnd since it takes the original value of hWndOrig with HWND hWndOrig = m_hWnd; . I really do not see the point in all this
~RaGE();
|
|
|
|
|
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
|
|
|
|