Console application with activex
Hello
I'm trying to combine VC6 console application with activex.
I have bought activex that work fine with VC6 dialog based application.
I add the activex to the dialog based application - and its work fine
I need an example code of how to do it.
Here is the code of the main CPP file:
// ApaxTest.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "ApaxTest.h"
// "apax.h" is the header file of the active x
#include "apax.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// The one and only application object
CWinApp theApp;
using namespace std;
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;
// initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: change error code to suit your needs
cerr << _T("Fatal Error: MFC initialization failed") << endl;
nRetCode = 1;
}
else
{
// CApax is the activex class
CApax Apax;
Apax.SetCommPort(1);
Apax.SetBaud(9600);
Apax.PutString("atdt266\r");
}
return nRetCode;
}
Best Regards
Nachum
:confused: