How to find whether VB6 project runs as standalone EXE or as COM component

In one project we are using old VB6 application which is referenced also as COM component to communicate with it from .NET. I needed a way to find out whether VB6 application runs as standalone EXE or ActiveX.

If App.StartMode = vbSModeStandalone Then

  ‘ Started as standalone EXE

End If

If App.StartMode = vbSModeAutomation Then

  ‘ Started as COM component

End If

 

That is

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s