experchange > vc.* > vc.atl

Senthilvel Samatharman (04-15-04, 07:22 PM)
Hi,
I have a out-of-process COM server designed with ATL
and I have also declared DECLARE_CLASSFACTORY_SINGLETON.

The problem is when creating the object.
The call to CoCreateInstance succeeds the first time and
when i try to call it again I get the error
ERROR_OUTOFMEMORY
"Not enough storage is available to complete this operation"

Does this error happen because i eat up memory(which is not very likely coz
I have 1 GB RAM) or is it something else??

Thanks and Best Regards,
Senthilvel.
AG (04-16-04, 12:20 AM)
Senthilvel Samatharman wrote:

[..]
> I have 1 GB RAM) or is it something else??
> Thanks and Best Regards,
> Senthilvel.

I guess you have to call CoGetClassObject() if you want to create
several object based on the same CLSID, instead of CoCreateInstance() :

Alexander Nickolov (04-16-04, 07:34 AM)
Can you post the server class' declaration?

The likeliest reason for E_OUTOFMEMORY is an exception
in the constructor of your ATL COM object. The class factory
creates it in a try/catch block and any exception is assumed
to come from new (hence out of memory) - your class is
prohibited from returning exceptions. This said, however,
if your object is indeed a singleton, it shouldn't get created
anew...
s.senthilvel (09-10-19, 03:53 AM)
<snip>
Thanks Alexander..Its a bit late..like 15 years, but still did not want to just go away without thanking you.
Similar Threads