Click here to Skip to main content
15,921,905 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to change the access properties of a drive Pin
Richard Andrew x6415-Jul-09 6:07
professionalRichard Andrew x6415-Jul-09 6:07 
GeneralRe: How to change the access properties of a drive Pin
David Crow15-Jul-09 6:14
David Crow15-Jul-09 6:14 
QuestionNot able to get curosr position in the child window ,after hooking to it. Pin
gadag15-Jul-09 2:58
gadag15-Jul-09 2:58 
AnswerRe: Not able to get curosr position in the child window ,after hooking to it. Pin
«_Superman_»15-Jul-09 5:54
professional«_Superman_»15-Jul-09 5:54 
QuestionHow to create static library in C++ .net 2008 and call it from VC6 Pin
stefanidou15-Jul-09 2:12
stefanidou15-Jul-09 2:12 
AnswerRe: How to create static library in C++ .net 2008 and call it from VC6 Pin
Chris Losinger15-Jul-09 4:02
professionalChris Losinger15-Jul-09 4:02 
Questiontoolbar problem Pin
Rakesh515-Jul-09 2:06
Rakesh515-Jul-09 2:06 
AnswerRe: toolbar problem Pin
Cedric Moonen15-Jul-09 2:13
Cedric Moonen15-Jul-09 2:13 
GeneralRe: toolbar problem Pin
David Crow15-Jul-09 2:59
David Crow15-Jul-09 2:59 
GeneralRe: toolbar problem Pin
Rakesh515-Jul-09 3:19
Rakesh515-Jul-09 3:19 
GeneralRe: toolbar problem Pin
David Crow15-Jul-09 3:23
David Crow15-Jul-09 3:23 
QuestionConverto long to char [] Pin
shpid3r15-Jul-09 2:01
shpid3r15-Jul-09 2:01 
AnswerRe: Converto long to char [] Pin
Chris Losinger15-Jul-09 2:03
professionalChris Losinger15-Jul-09 2:03 
AnswerRe: Converto long to char [] Pin
«_Superman_»15-Jul-09 2:10
professional«_Superman_»15-Jul-09 2:10 
AnswerRe: Converto long to char [] Pin
Cedric Moonen15-Jul-09 2:11
Cedric Moonen15-Jul-09 2:11 
GeneralRe: Converto long to char [] Pin
shpid3r15-Jul-09 2:20
shpid3r15-Jul-09 2:20 
GeneralRe: Converto long to char [] Pin
Stuart Dootson15-Jul-09 4:16
professionalStuart Dootson15-Jul-09 4:16 
QuestionToolbar problem Pin
Rakesh515-Jul-09 1:34
Rakesh515-Jul-09 1:34 
QuestionCOM Object Released But DLL Still In Memory Pin
Crazy Joe Devola15-Jul-09 0:41
Crazy Joe Devola15-Jul-09 0:41 
Hi,

I have a program that uses a COM object. At somepoint I try to release the object. After I do the release process, I can see using Process Explorer that the ActiveX DLL is still in memory.

My code is below. Am I doing something wrong? Why is the DLL still in memory?
ComReleaseTest.DLL is a test VB ActiveX DLL I wrote to debug this problem. It does nothing - all it has is one test sub which I am not even calling.

<br />
#include "stdafx.h"<br />
<br />
#import "..\ProductTree\winpos\drv32\ComReleaseTest.dll" no_namespace<br />
<br />
_CComReleaseTestPtr m_Srv;<br />
<br />
int Close();<br />
void ReleaseObject();<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
	HRESULT hResult;<br />
<br />
	try<br />
	{	<br />
		if ( TRUE )<br />
		{<br />
			hResult = CoInitialize( NULL );<br />
<br />
			if ( hResult != S_OK )<br />
			{<br />
				return 1;<br />
			}<br />
		}<br />
<br />
		HRESULT hr = m_Srv.CreateInstance(__uuidof( CComReleaseTest ), NULL, CLSCTX_ALL);<br />
		if (FAILED(hr))<br />
			_com_issue_error(hr);<br />
    }<br />
	catch(_com_error& e)<br />
	{<br />
		return (1);<br />
    }<br />
<br />
	Close();<br />
<br />
	return (0);<br />
<br />
}<br />
<br />
int Close()<br />
{<br />
	long Result = 0;<br />
<br />
	if ( m_Srv != NULL )<br />
    {<br />
		TRY<br />
		{<br />
			ReleaseObject();<br />
		}<br />
		CATCH_ALL(e)<br />
		{<br />
			TCHAR sError[255];<br />
			e->GetErrorMessage(sError,255);<br />
		}<br />
		END_CATCH_ALL<br />
	}<br />
<br />
	return ( (short)Result );<br />
}<br />
<br />
<br />
<br />
void ReleaseObject()<br />
{<br />
<br />
	// Disconnect from VB ActiveX<br />
	try<br />
	{<br />
		m_Srv.Release();<br />
	}<br />
	catch(_com_error& e)<br />
	{<br />
	   //<br />
	}<br />
<br />
	free(m_Srv);<br />
	m_Srv.Detach();<br />
	<br />
<br />
	m_Srv = NULL;<br />
<br />
}<br />
<br />
<br />


The reason I am trying to track this is that I have anotehr program that at somepoint calls an InstallShield 5.5 setup. This setup.exe hangs at 99% and I found that if my program does not call a certain ActiveX then there is no problem with the setup.exe. So I am trying to release that ActiveX before calling setup.exe, but the COM DLL just stays in memory!
AnswerRe: COM Object Released But DLL Still In Memory Pin
Stuart Dootson15-Jul-09 0:49
professionalStuart Dootson15-Jul-09 0:49 
GeneralRe: COM Object Released But DLL Still In Memory Pin
Crazy Joe Devola15-Jul-09 0:55
Crazy Joe Devola15-Jul-09 0:55 
Questionadding an item into control panel context menu Pin
emmmatty114-Jul-09 22:56
emmmatty114-Jul-09 22:56 
AnswerRe: adding an item into control panel context menu Pin
«_Superman_»15-Jul-09 2:04
professional«_Superman_»15-Jul-09 2:04 
Questionunicode equivalent of Readfile() function.. Pin
Rakesh514-Jul-09 22:42
Rakesh514-Jul-09 22:42 
AnswerRe: unicode equivalent of Readfile() function.. Pin
Naveen14-Jul-09 22:55
Naveen14-Jul-09 22:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.