|
AlexEvans wrote: with ATLASSERT() inside CstringData
What's the code at the assertion? Seems you have a CString getting
messed up somewhere.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi MArk,
Really apprecite you taking the time to try help me out here.
As I step through the code - in the last stage of exisiting, inside my "OnDestroy"
void CMainFrame::OnDestroy()
{
CFrameWnd::OnDestroy();
}
The debuger stops on the following "ATLASSERT()", obviously it expects nRefs to equal zero, and it is not so, but what does it refer to, I have no idea, or how do I find out either. This is inside "ATLSIMPSTR.H", ad I suspect it was there before, but VS 2003 was more forgiving...
void Release() throw()
{
ATLASSERT( nRefs != 0 );
if( _AtlInterlockedDecrement( &nRefs ) <= 0 )
{
pStringMgr->Free( this );
}
}
My application's name is MDPD.EXE - here is the call stack dump at the point of the crash...
mfc80d.dll!ATL::CStringData::Release() Line 107 + 0x3 bytes
mfc80d.dll!ATL::CSimpleStringT<wchar_t,1>::~CSimpleStringT<wchar_t,1>() Line 287
mfc80d.dll!ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >::~CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >() Line 1260 + 0x8 bytes MDPd.exe!`dynamic atexit destructor for 'RL7''() + 0x2b bytes
msvcr80d.dll!doexit(int code=0, int quick=0, int retcaller=0) Line 553
msvcr80d.dll!exit(int code=0) Line 398 + 0xd bytes
MDPd.exe!__tmainCRTStartup() Line 610
MDPd.exe!WinMainCRTStartup() Line 414
|
|
|
|
|
There's a CString being destructed twice.
AlexEvans wrote: destructor for 'RL7''() + 0x2b bytes
What is "RL7"? Is that possibly the name of the CString object?
If so, that's the one you want to look through your code for and
make sure it's only destroyed once.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark,
Vieny Vidi Vici … I came, I saw, I concurred… You were right, this was the problem...
It was defined in a header as static... and conditional on MSS_VER > 12 and that was wrong, I moved it into the cpp that is using it and the problem is gone...
Thanks for your help
Cheers
Alex
|
|
|
|
|
Cool!
Thanks for the update.
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Is the DLL going to have the code that implements the dialogs
or just the dialog resources?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You can make your dialog boxes on the dll files,what do you need exactly?
|
|
|
|
|
Hi all,
I want to get name of my drives(Logical drive). Like if i give c: dive name as Softwares then which api should i use to get its name??
Thanks in advance
|
|
|
|
|
|
Also you can use WMI function Win32_DiskDrive
|
|
|
|
|
|
Hi all,
In property window of application,in project deafult section og General,
i want to set Use of MFC as Use MFC in a Static Library
and in Common Language Runtime Support use Common Language Runtime Support, Old Syntax (/clr:oldSyntax).
Now a error comes.
Command line error D8016 : '/MT' and '/clr:oldsyntax' command-line options are incompatible
Is it not possible to use both property at same time.
Please tell me how can i remove this error ,both property are necessary to use.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
I think this link give you some idea This link[^]
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
When right click my tray icon, show the menu, And there is a menu item "Restore window".
When click this menu item, it should restore window.
My code implement "Restore window" below:
void CWinSearchDlg::OnTrayRestoreWnd()
{
DestroyTray();
ShowWindow(SW_SHOW);
<font color="blue">
if (CWnd::GetActiveWindow() != this)
{
SetActiveWindow();
AfxMessageBox(_T("SetActiveWindow"));
}
else
{
AfxMessageBox(_T("no SetActiveWindow")); <font color="red">
}
BOOL bRet = FALSE;
bRet = SetWindowPos(&wndTop, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
if (bRet)
AfxMessageBox(_T("SetWindowPos true"));<font color="red">
else
AfxMessageBox(_T("SetWindowPos false"));
bRet = FALSE;
bRet = SetForegroundWindow();
if (bRet)
AfxMessageBox(_T("true SetForegroundWindow"));<font color="red">
else
AfxMessageBox(_T("false SetForegroundWindow"));
bRet = FALSE;
bRet = ::BringWindowToTop(this->GetSafeHwnd());
if (bRet)
AfxMessageBox(_T("BringWindowToTop true"));<font color="red">
else
AfxMessageBox(_T("BringWindowToTop false"));
</font>
}
I've tried the code in blue font, but when restore the window, It doesn't bring to the top.
Please give me a sign!
|
|
|
|
|
Without digging through that (I'm lazy), I don't see any ShowWindow command. How did you hide the dialog in the first place? There are tray program examples aplenty on CP, so you may be able to see how they did it.
Iain.
|
|
|
|
|
if i use any activex control then which class or dll should part of my setup?
|
|
|
|
|
What do you mean exactly ? Are you asking what to provide with your application when you distribute it ? If yes, you need to include the ActiveX file (an .ocx file) of the control. You will also need to register it on the target machine.
|
|
|
|
|
i have an activex control of "microsoft from 2.0 label" i want to change its font size on runtime according to some values
for example if variable font have value 14 then label font size should set 14 and if font variable is 10 then font size of this label should 10
how can i do this?
|
|
|
|
|
how to set font size of static text...?
|
|
|
|
|
Use SetFont function.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
you can use.
CFont *m_Font1 = new CFont;
m_Font1->CreatePointFont(100,_T("Arial"));
m_staticsite.SetFont(m_Font1);
|
|
|
|
|
Win32 ) Use WM_SETFONT [^] message.
MFC ) Use SetFont [^] method.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
How can Explorer.exe start loading my YC.DLL.
Or
I YC.DLL production in the operating system starts, inject Explorer.exe.
I do not want to amend regedit to achieve this function.
HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ Windows
thanks
zhq_0_0_0_1@163.com
|
|
|
|
|
Hi,
I am calling the below piece of code in DocumentComplete Event from IE.
<br />
CComPtr<IDispatch> spDisp;<br />
RESULT hr = m_spWebBrowser2->get_Document(&spDisp);<br />
if (SUCCEEDED(hr) && spDisp)<br />
{<br />
CComQIPtr<ICustomDoc, &IID_ICustomDoc> spCustomDoc(spDisp);<br />
}<br />
The spCustomDoc Object is invalid.
I am catching events from IE, and not from any webbrowser control in application.
Any idea whats going wrong?I am not sure whether we can use SetUIHandler for browsers.
Thanks in Advance.
Abhi Lahare.
|
|
|
|