ATL Composite Control - "Out of Memory" error 
Author Message
 ATL Composite Control - "Out of Memory" error

When I try to use a custom ATL composite control in a VB form at runtime, I get
an "Out of Memory" error.  Trying to use the custom ATL composite control on a
dialog based MFC application, the dialog is destroyed before it is even shown.  I
cannot even see the constituent controls on the dialog during design time.  The
control works fine in the ActiveX Test Container.

I would appreciate any help with this problem.



Mon, 27 Oct 2003 01:40:24 GMT  
 ATL Composite Control - "Out of Memory" error
HI Kevin,
  Put the following in the stdafx.h of the control. ATL_DEBUG_INTERFACES  
and ATL_DEBUG_QI. Then use one of your apps as your client app and try to
load the control. Look in the output window to look for any interesting
failures.
When hosting it MFC dialog did you call AfxOleInit() in the InitInstance.
When running your app from the IDE see the last messages in the output
window it might show some failure HRESULT.

Regards
Chetan N Parmar
Microsoft Developer Support



Mon, 27 Oct 2003 05:41:19 GMT  
 ATL Composite Control - "Out of Memory" error
Chetan,

AfxOleInit in the ATL control (with MFC suppport) was failing.  Replacing
AfxOleInit() with ::CoInitialize() helped.

Thanks,

Kevin

Quote:
-----Original Message-----

HI Kevin,
  Put the following in the stdafx.h of the control. ATL_DEBUG_INTERFACES  
and ATL_DEBUG_QI. Then use one of your apps as your client app and try to
load the control. Look in the output window to look for any interesting
failures.
When hosting it MFC dialog did you call AfxOleInit() in the InitInstance.
When running your app from the IDE see the last messages in the output
window it might show some failure HRESULT.

Regards
Chetan N Parmar
Microsoft Developer Support

.



Sat, 01 Nov 2003 00:53:13 GMT  
 ATL Composite Control - "Out of Memory" error
HI Kevin,
   Since your control is a dll AfxOleInit checks that and does not call
OleInitialize(). Expecting it to be called by the container app. In any
case calling CoInitialize fixed your problem.

Regards
Chetan N Parmar
Microsoft Developer Support



Sat, 01 Nov 2003 03:05:37 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Error "free"-ing "malloc"-ed memory

2. ATL Wizard "Internet Explorer Object" error

3. "Invalid access to memory location" error

4. ERROR: memory cannot be "read"

5. memory "read" error

6. ERROR: memory could not be "read"

7. Need help with "memory check error"

8. Handling "insufficient memory" errors

9. "No memory" while plenty of memory

10. Compile error "Internal error during SetupPhase"

11. Instruction at "0x00000000" referenced memory at "0x00000000" error

12. Error - "The memory could not be "read""

 

 
Powered by phpBB® Forum Software