Click here to Skip to main content
16,004,991 members
Home / Discussions / COM
   

COM

 
AnswerRe: Namespace in IDL Pin
Steve S22-Aug-06 21:56
Steve S22-Aug-06 21:56 
GeneralRe: Namespace in IDL Pin
Andre xxxxxxx23-Aug-06 2:30
Andre xxxxxxx23-Aug-06 2:30 
GeneralRe: Namespace in IDL Pin
Steve S23-Aug-06 3:07
Steve S23-Aug-06 3:07 
QuestionCreate a Thread in COM dll but thread "HANG the whole COM DLL"~ Pin
rockryan21-Aug-06 8:19
rockryan21-Aug-06 8:19 
AnswerRe: Create a Thread in COM dll but thread "HANG the whole COM DLL"~ Pin
Mike Dimmick22-Aug-06 2:34
Mike Dimmick22-Aug-06 2:34 
GeneralRe: Create a Thread in COM dll but thread "HANG the whole COM DLL"~ Pin
rockryan27-Aug-06 3:05
rockryan27-Aug-06 3:05 
Question....> Graduation Project <..... Pin
amalemam19-Aug-06 13:23
amalemam19-Aug-06 13:23 
QuestionDCOM Memory not being Released Pin
cyoung3518-Aug-06 8:35
cyoung3518-Aug-06 8:35 
I am having some difficulty in my C++ app with memory management. Currently the client app sets up a struct **pPointer that is passed to the COM+ method on the server. The server then reads a database and creates a record set. This record set is processed and the server then CoTaskMemAlloc’s space for each of the processed records. The array of pointers is then passed back to the client.

The pointers all seem to be marshaled fine. The data is processed, and then I CoTaskMemFree the pointers, and release the Access Object to decrement the object reference count. Even though the object seems to have no more references to it (ie the object is no longer spinning in Component Services), the server (dllhost.exe) is still holding on to the memory that was allocated on the server. After about 30 minutes the memory is eventually free’d. However the memory use is very large and multiple clients are utilizing the system. It does not take long to run out of resources and the server crashes with a ‘COM Surrogate error’ . My guess is that when the server runs out of memory, it errors and returns a NULL pointer. As Windows is trying to marshal the null pointer, the error situation occurs (but this is just a guess, it could be a bad uninitialized pointer).

I need to figure out how to free the memory on the COM server after I am done with it, so that it can be released. Any help would be greatly appreciated.

Client Side Code Snippit:
<br />
	hr = CoCreateInstance(	CLSID_ValuesAccessObject,<br />
				0,<br />
				CLSCTX_ALL,<br />
				IID_IValuesAccessObject,<br />
				(void**)&m_pidsrtval );<br />
<br />
	...<other processing>...<br />
<br />
	hr = m_pidsrtval->GetAllValues(	GetDbConnectionString(),<br />
					&nValues,<br />
					&pspdcrtbv );<br />
<br />
<br />
	...<other processing>...<br />
<br />
	for( int i=0; i<nValues; i++ )<br />
	{<br />
		SPDCRTBV *paspdcrtbv = &((*ppsptbvValues)[i]);<br />
<br />
		CoTaskMemFree(paspdcrtbv->pdvQualifiers);<br />
		paspdcrtbv->pdvQualifiers = NULL;<br />
<br />
		CoTaskMemFree(paspdcrtbv->pdvFacts);<br />
		paspdcrtbv->pdvFacts = NULL;<br />
<br />
	}<br />
	<br />
	CoTaskMemFree(pspdcrtbv);<br />
	m_pidsrtval->Release();	<br />



Chris
QuestionActivex control not able move in the form Pin
rahul_7718-Aug-06 3:33
rahul_7718-Aug-06 3:33 
QuestionHow to generate strong key name for an interop? Pin
Shilpa117-Aug-06 14:02
Shilpa117-Aug-06 14:02 
AnswerRe: How to generate strong key name for an interop? Pin
Mike Dimmick19-Aug-06 13:35
Mike Dimmick19-Aug-06 13:35 
QuestionXPCOM component registration Pin
Ayesha Farheen17-Aug-06 0:20
Ayesha Farheen17-Aug-06 0:20 
AnswerRe: XPCOM component registration Pin
User 21559717-Aug-06 21:01
User 21559717-Aug-06 21:01 
Questionwhich book is good for COM Pin
sarojkumarjena16-Aug-06 23:53
sarojkumarjena16-Aug-06 23:53 
AnswerRe: which book is good for COM Pin
Kevin McFarlane17-Aug-06 0:35
Kevin McFarlane17-Aug-06 0:35 
GeneralRe: which book is good for COM Pin
Rory Solley17-Aug-06 23:12
Rory Solley17-Aug-06 23:12 
AnswerRe: which book is good for COM Pin
odiesback24-Aug-06 11:01
odiesback24-Aug-06 11:01 
QuestionBasics About COM..... Pin
Prabs frm PGP16-Aug-06 19:04
Prabs frm PGP16-Aug-06 19:04 
AnswerRe: Basics About COM..... Pin
With_problem16-Aug-06 19:39
With_problem16-Aug-06 19:39 
GeneralRe: Basics About COM..... Pin
Prabs frm PGP16-Aug-06 21:10
Prabs frm PGP16-Aug-06 21:10 
QuestionActive x fire events how?? [modified] Pin
With_problem16-Aug-06 18:32
With_problem16-Aug-06 18:32 
AnswerRe: Active x fire events how?? Pin
kumarprabhakar7422-Aug-06 19:37
kumarprabhakar7422-Aug-06 19:37 
QuestionHow to access html tag param in a component control? Pin
Wolfgang Jia15-Aug-06 18:57
Wolfgang Jia15-Aug-06 18:57 
QuestionC++ Server - VB Client - Passing Structures Pin
Tiramisu215-Aug-06 11:28
Tiramisu215-Aug-06 11:28 
AnswerRe: C++ Server - VB Client - Passing Structures Pin
Mike Dimmick16-Aug-06 17:22
Mike Dimmick16-Aug-06 17:22 

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.