can i use Activex control in non-dialog class ?

I downloaded an Activex control that deals with Serial ports ( open the port , receive data from the port, sens data through the port ).

i'm trying to use this Activex in a project without dialogs , and i want to use it inside one of the classes ( not a dialog class or a Form class - just a simple class ).

My question is not for this specific Activex control , but to All Activex controls. Can they work inside a Non-dialog/Form classes ? or they only ment for dialogs and forms ? or it depends on the Activex ?
[536 byte] By [asafaa] at [2007-11-19 2:03:26]
# 1 Re: can i use Activex control in non-dialog class ?
Not absolutelly necessary a dialog/form view. Just...

Choose "Project/Add To Project/Components & Controls" menu item.
In "Components and Controls Gallery" dialog choose "Registerd ActiveX Controls"
Select the desired control, e.g. "Microsoft Communication Control" and click <Insert>

The corresponding wrapper class(es) will be added to your project (CMSComm in our case).
Now just call CMSComm::Create.

See next example:

// MyView.h
#include "MSComm.h"
// ...
class CMyView : public CView
{
// ...
// Attributes
protected:
CMSComm m_comm;
// ...
};
// MyView.cpp
// ...
int CMyView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if(CView::OnCreate(lpCreateStruct) == -1)
return -1;

BOOL bCreated = m_comm.Create(NULL, WS_CHILD, CRect(0,0,0,0), this, 12345);
// ...
return 0;
}
ovidiucucu at 2007-11-11 0:49:29 >