|
yes. Whats wrong with killing modals this way?
Appreciate your help,
ns
|
|
|
|
|
You wrote:
Whats wrong with killing modals this way?
That's like stopping a car by removing its key while driving.
The proper way to force a modal dialog to end itself is to post an IDOK (or IDCANCEL ) WM_COMMAND to it. That will cause the proper cleanup actions to occur. You can then delete the saved pointer to your dialog class.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
thanks.....
Appreciate your help,
ns
|
|
|
|
|
quote: That's like stopping a car by removing its key while driving.
Is this possible at all? Never tried it, lmao
/edit: how do I quote in this forum?
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Yes, but take care, if your car has assisted direction you won't be able to turn...
|
|
|
|
|
Gregor S. wrote:
/edit: how do I quote in this forum?
By marking the text in the display above the edit window and clicking 'Quote selected text'.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
There's no such button in Phoenix (Mozilla), but there is in Internet Explorer
modified 12-Sep-18 21:01pm.
|
|
|
|
|
This would surely qualify as a bug in the page?
You can at least try it ).
But isn't Phoenix a linux browser? Heretic!;P
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Hi.
I've created a CTreeCtrl with a root and some subitems,
but want to get the 'psztext' member from a TVITEM struct.
MFC already created a pointer:
void ...::OnSelchangedTreeview(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
//My Code
CString strText;
strText = (pNMTreeView->itemNew).pszText;
AfxMessageBox(strText);
}
I seem to get really weird ascii code while displaying the CString. Any1 knows what seems to be the problem?
Greetings
Jens
|
|
|
|
|
|
yes i have done that:
strPrevDate = strDate.Right(4);
tvItem.mask = TVIF_TEXT;
tvItem.pszText = strPrevDate.GetBuffer(3);
tvItem.cchTextMax = 32;
tvInsert.hParent = hRoot;
tvInsert.hInsertAfter = TVI_LAST;
tvInsert.item = tvItem;
hYearItem = m_treeCtrl.InsertItem(&tvInsert);
|
|
|
|
|
Forget about that crap, and try this instead:
CTreeCtrl& tree = GetTreeCtrl();
HTREEITEM hItem = tree.GetSelectedItem();
CString strText = tree.GetItemText(hItem);
Regards,
Alvaro
When birds fly in the right formation, they need only exert half the effort. Even in nature, teamwork results in collective laziness. -- despair.com
|
|
|
|
|
Hi Alvaro
GetTreeCtrl() didn't work for me, i tried it out like this:
CTreeCtrl* pTreeCtrl = (CTreeCtrl*) GetDlgItem(IDC_TREEVIEW);
HTREEITEM hItem = pTreeCtrl->GetSelectedItem();
CString strText = pTreeCtrl->GetItemText(hItem);
I now get the text correctly, thanks
But now, i want to know with which kind of 'level' we are talking about: root, child or 'child of child'
Any1 any idea?
|
|
|
|
|
I have an application that is getting NULL returned from GlobalAlloc, the error code says "not enough storage avaliable" but that does not make sence.
The application has a working set of 450Mb and a virtual set of 790Mb, my machine has 1Gb of physical ram and 2.5Gb total (including virtual memory).
This error does not happen on a machine with 2Gb of ram.
The request is only for 100Mb.
Any ideas why GlobalAlloc should fail?
Could it be address space?
Are there any compiler/linker flags I can change for MSVC 6?
|
|
|
|
|
Justin Hallet wrote:
Any ideas why GlobalAlloc should fail?
try calling GetLastError .
what are you using for uFlags on the GlobalAlloc call?
-c
Image tools: ThumbNailer, Bobber, TIFFAssembler
|
|
|
|
|
I have, GetLastError, returns ERROR_NOT_ENOUGH_MEMORY, "Not enough storage is available to process this command."
Call is - GlobalAlloc ( GMEM_MOVEABLE | GMEM_ZEROINIT, aSize ), where size is about, 1048576.
|
|
|
|
|
could be you've fragmented the memory so bad that it can't find 100MB of continuous memory. (unlikely).
do you do a lot of little allocations elsewhere?
-c
Image tools: ThumbNailer, Bobber, TIFFAssembler
|
|
|
|
|
Just a few, actually, I think you may be right here, I think it is fragmentation, I will check the size, I had assumed it was 100Mb, it could be more like 700Mb in which case fragmentation will be the problem.
|
|
|
|
|
MSDN has no information these constants!!! The web didnt either. Also looked in windows.h. I was wanting to pass this into a function...myFunc(SW_HIDE) or SW_SHOW, and wanted to see what type it is...is it an int? Where can I find this info?
Appreciate your help,
ns
|
|
|
|
|
did you try "Find in Files" for SW_HIDE, in your Vc98\Include folder ?
from WinUser.h:
// begin_r_winuser
/*
* ShowWindow() Commands
*/
#define SW_HIDE 0
#define SW_SHOWNORMAL 1
#define SW_NORMAL 1
#define SW_SHOWMINIMIZED 2
#define SW_SHOWMAXIMIZED 3
#define SW_MAXIMIZE 3
#define SW_SHOWNOACTIVATE 4
#define SW_SHOW 5
#define SW_MINIMIZE 6
#define SW_SHOWMINNOACTIVE 7
#define SW_SHOWNA 8
#define SW_RESTORE 9
#define SW_SHOWDEFAULT 10
#define SW_FORCEMINIMIZE 11
#define SW_MAX 11
-c
Image tools: ThumbNailer, Bobber, TIFFAssembler
|
|
|
|
|
I must have misspelt it I can find it now. Sorry for the bother. I actually searched first in the vc98 folder, then in the whole c drive!!! I must have misspelt it both times (rather odd) but now I type it in and viola! Thanks
Appreciate your help,
ns
|
|
|
|
|
:I want to Create a Frame/view/doc structure On a ActiveX Control,but It will be Found Memory leak! And I Found that the reasons is :
CDocManager* CDocManager::pStaticDocManager;
CPtrList* CDocManager::pStaticList;
How Can I avoid Memroy leak?
the Following is My Code :
BOOL Create()
{
if( m_pFrameWnd )
{
if( IsWindow(m_pFrameWnd->m_hWnd) ) return TRUE;
}
CSingleDocTemplate * pDocTemplate;
pDocTemplate = new CSingleDocTemplate(IDR_MAPTYPE,
RUNTIME_CLASS(CMapDoc),
RUNTIME_CLASS(CMapFrame),
RUNTIME_CLASS(CMapView));
CMapDoc * pDoc = new CMapDoc;
CCreateContext Context;
Context.m_pCurrentDoc = pDoc;
Context.m_pNewDocTemplate = pDocTemplate;
Context.m_pNewViewClass = RUNTIME_CLASS(CMapView);
Context.m_pLastView = NULL;
Context.m_pCurrentFrame = NULL;
CMapFrame * pFrameWnd = new CMapFrame;
m_pDoc = pDoc;
m_pFrameWnd = pFrameWnd;
m_pDocTemplate = pDocTemplate;
CRect rcMap;
GetClientRect(&rcMap);
BOOL ret = m_pFrameWnd->Create(AfxRegisterWndClass(CS_DBLCLKS), NULL, WS_CHILD|WS_VISIBLE, rcMap,this,NULL,&Context);
m_pFrameWnd->ShowWindow(SW_SHOW);
return ret;
}
ZHANGYIFEI
|
|
|
|
|
MFC only deletes the CDocManager class if it(MFC) created it. It looks like you are creating your own doc manager and therefore need to delete on exit.
|
|
|
|
|
I have not created CDocManager ,I don't want MFC create it too!but In fact ,MFC Create it,and leak happened! the reason is two CDocManager's static
data member!
ZHANGYIFEI
|
|
|
|
|
How to hooking api calls before the window receive a message?
I have install a CBT before creating a new process and change the child process' import table for hooking some APIs when it attached to my dll, but it doesn't work before InitInstance() completed its works.
CreateRemoteThread() maybe could help me for saving my job, but Richter said that's not implemented CreateRemoteThread() under Win98...
Thanks a lot for any suggestion.
|
|
|
|