From: Ajay Kalra on
>
> What exactly do you mean by regular DLL?
>
> I got the examples of how to add OLE automation to an MFC app off a
> tutorial.
>
> http://www.codeproject.com/com/mfc_autom.asp
>
> Its examples included the above without an explanation.

That article appears to be about making an app expose the functionality
thru Automation. There does not appear to be any DLL there. I dont
understand your setup. Why do you think you need to use
AFX_MANAGE_STATE? This should be used only a MFC Regular DLL. If you
have an exe or a MFC Extension DLL, you shouldnt be using this macro.

---
Ajay

From: Herby on
That macro call gets added automatically by the 'Add method' wizard
within VS against the IDL file....

I originally created the COM component in a DLL project.
I then linked the same source files in a exe project...

The same COM component is included in a COM DLL project and COM exe
project for clients who wish to run it in-process or out-process
respectively...

Does this make sense?

From: Ajay Kalra on

Herby wrote:
> That macro call gets added automatically by the 'Add method' wizard
> within VS against the IDL file....
>
> I originally created the COM component in a DLL project.
> I then linked the same source files in a exe project...
>
> The same COM component is included in a COM DLL project and COM exe
> project for clients who wish to run it in-process or out-process
> respectively...
>
> Does this make sense?

It appears you have a Regular DLL (as wizard is putting this macro) (A
COM component can be create in a Regular or MFC Extension DLL and that
is orthogonal to the issue). So it should be OK to use it. I dont know
what the state is at the point when you have this problem. Perhaps you
can try using the appmodulestate instead of static module state in your
macro. This is just guess work as I dont know the details of your
setup.

---
Ajay

From: Herby on
>
> It appears you have a Regular DLL (as wizard is putting this macro) (A
> COM component can be create in a Regular or MFC Extension DLL and that
> is orthogonal to the issue). So it should be OK to use it. I dont know
> what the state is at the point when you have this problem. Perhaps you
> can try using the appmodulestate instead of static module state in your
> macro. This is just guess work as I dont know the details of your
> setup.
>
> ---
> Ajay


Is there an article that explains these states ?
I dont really understand their purpose.

From: Ajay Kalra on

Herby wrote:
> >
> > It appears you have a Regular DLL (as wizard is putting this macro) (A
> > COM component can be create in a Regular or MFC Extension DLL and that
> > is orthogonal to the issue). So it should be OK to use it. I dont know
> > what the state is at the point when you have this problem. Perhaps you
> > can try using the appmodulestate instead of static module state in your
> > macro. This is just guess work as I dont know the details of your
> > setup.
> >
> > ---
> > Ajay
>
>
> Is there an article that explains these states ?
> I dont really understand their purpose.

Technical Note 58 has something on it. I am not sure how much of it is
helpful though:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfcnotes_tn058.asp

---
Ajay