本人vb,asp程序员,最近公司买了某其他公司的sdk去开发,web server运行的多媒体功能。但是sdk里面的例程都是C++的,也有vc++的。我对此实在是一窍不通,过去都是拿来COM或ActiveX Component建立instant就行,调用其函数就行了。可是这个sdk不提供,也没有dll。但是在c++里就可以生成应用程序,我就一点都不明白了。请问怎样生成COM或ActiveX Component用于asp.net web application.谢谢
调试欢乐多
// LoquendoASRDemo.cpp : Defines the class behaviors for the application.
//#include "stdafx.h"
#include <direct.h>
#include "LoquendoASRDemo.h"
#include "AsrDlg.h"
#include "Splash.h"#include "HtmlHelpDlg.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
// CLoquendoASRDemoAppBEGIN_MESSAGE_MAP(CLoquendoASRDemoApp, CWinApp)
//{{AFX_MSG_MAP(CLoquendoASRDemoApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
// CLoquendoASRDemoApp constructionCLoquendoASRDemoApp::CLoquendoASRDemoApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}/////////////////////////////////////////////////////////////////////////////
// The one and only CLoquendoASRDemoApp objectCLoquendoASRDemoApp theApp;/////////////////////////////////////////////////////////////////////////////
// CLoquendoASRDemoApp initializationBOOL CLoquendoASRDemoApp::InitInstance()
{
AfxEnableControlContainer();
// Enable Rich Edit
AfxInitRichEdit(); // Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif // Get the Application Path Name
TCHAR Buffer[2*_MAX_PATH];
GetModuleFileName(GetModuleHandle(NULL), Buffer, sizeof(Buffer)); CString ExePath(Buffer);
int i = ExePath.ReverseFind('\\');
if (i) ExePath = ExePath.Left(i); // Set the current work directory
_tchdir((LPCTSTR)ExePath); // Check the ASR License
//CServiceInterf *pServiceInterf = new CServiceInterf();
/*
BOOL bLicenseOK = pServiceInterf->CheckLicense();
delete pServiceInterf; if (! bLicenseOK) {
int res = AfxMessageBox(_T("Your ASR License is missing or it has expired \n"
"Whould you like a new license ?\n\n"
"Press Yes to run the License Manager\n"
"Press No to exit "), MB_ICONSTOP | MB_YESNO);
if (res == IDYES) { STARTUPINFO si;
PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) ); // Start the child process.
CreateProcess( NULL, // No module name (use command line).
"LoquendoASRLicense.exe", // Command line.
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
FALSE, // Set handle inheritance to FALSE.
0, // No creation flags.
NULL, // Use parent's environment block.
NULL, // Use parent's starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi ); // Pointer to PROCESS_INFORMATION structure.
} return FALSE;
}
*/ // Get the ReadMe seen flag
HKEY hKey;
char szBuffer[10];
DWORD dwBufLen = 10;
LONG lRet; if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,
_T("SOFTWARE\\loquendo\\Loquendo ASR & SV Demo"), 0, KEY_ALL_ACCESS, &hKey) == ERROR_SUCCESS) { lRet = RegQueryValueEx(hKey, _T("ReadmeSeen"), NULL, NULL, (LPBYTE)szBuffer, &dwBufLen);
if (lRet == ERROR_SUCCESS) {
if (szBuffer[0] == '0') {
lRet = RegSetValueEx(hKey, _T("ReadmeSeen"), 0, REG_SZ, (LPBYTE)"1", 2); // Run the ReadMe.txt
STARTUPINFO si;
PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) ); // Start the child process.
CreateProcess(NULL, "notepad readme.txt", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
}
}
RegCloseKey(hKey);
} CSplashWnd::EnableSplashScreen(TRUE); //SetDialogBkColor(RGB(255, 255, 255), RGB(255, 0, 0)); CHtmlHelpDlg *HelpDlg = new CHtmlHelpDlg();
HelpDlg->Create(IDD_HTMLHELP, NULL); CAsrDlg dlg;
dlg.m_HtmlHelpDlg = HelpDlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal(); if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
} HelpDlg->DestroyWindow();
delete HelpDlg; // Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}
--------------------------------------------------------------------------------// LoquendoASRDemo.h : main header file for the LOQUENDOASRDEMO application
//#if !defined(AFX_LOQUENDOASRDEMO_H__8FEA29EB_8092_4D19_8D24_778FB3DDB5C5__INCLUDED_)
#define AFX_LOQUENDOASRDEMO_H__8FEA29EB_8092_4D19_8D24_778FB3DDB5C5__INCLUDED_#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif#include "resource.h" // main symbols/////////////////////////////////////////////////////////////////////////////
// CLoquendoASRDemoApp:
// See LoquendoASRDemo.cpp for the implementation of this class
//class CLoquendoASRDemoApp : public CWinApp
{
public:
CLoquendoASRDemoApp();// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CLoquendoASRDemoApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL// Implementation //{{AFX_MSG(CLoquendoASRDemoApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
///////////////////////////////////////////////////////////////////////////////{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_LOQUENDOASRDEMO_H__8FEA29EB_8092_4D19_8D24_778FB3DDB5C5__INCLUDED_)还有好几个cpp文件,不过我不懂哪个有用。先贴这一个cpp和他同名的h
MICROSOFT FOUNDATION CLASS LIBRARY : LoquendoASRDemo
========================================================================
AppWizard has created this LoquendoASRDemo application for you. This application
not only demonstrates the basics of using the Microsoft Foundation classes
but is also a starting point for writing your application.This file contains a summary of what you will find in each of the files that
make up your LoquendoASRDemo application.LoquendoASRDemo.dsp
This file (the project file) contains information at the project level and
is used to build a single project or subproject. Other users can share the
project (.dsp) file, but they should export the makefiles locally.LoquendoASRDemo.h
This is the main header file for the application. It includes other
project specific headers (including Resource.h) and declares the
CLoquendoASRDemoApp application class.LoquendoASRDemo.cpp
This is the main application source file that contains the application
class CLoquendoASRDemoApp.LoquendoASRDemo.rc
This is a listing of all of the Microsoft Windows resources that the
program uses. It includes the icons, bitmaps, and cursors that are stored
in the RES subdirectory. This file can be directly edited in Microsoft
Visual C++.LoquendoASRDemo.clw
This file contains information used by ClassWizard to edit existing
classes or add new classes. ClassWizard also uses this file to store
information needed to create and edit message maps and dialog data
maps and to create prototype member functions.res\LoquendoASRDemo.ico
This is an icon file, which is used as the application's icon. This
icon is included by the main resource file LoquendoASRDemo.rc.res\LoquendoASRDemo.rc2
This file contains resources that are not edited by Microsoft
Visual C++. You should place all resources not editable by
the resource editor in this file.
/////////////////////////////////////////////////////////////////////////////AppWizard creates one dialog class:LoquendoASRDemoDlg.h, LoquendoASRDemoDlg.cpp - the dialog
These files contain your CLoquendoASRDemoDlg class. This class defines
the behavior of your application's main dialog. The dialog's
template is in LoquendoASRDemo.rc, which can be edited in Microsoft
Visual C++.
/////////////////////////////////////////////////////////////////////////////
Other standard files:StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named LoquendoASRDemo.pch and a precompiled types file named StdAfx.obj.Resource.h
This is the standard header file, which defines new resource IDs.
Microsoft Visual C++ reads and updates this file./////////////////////////////////////////////////////////////////////////////
Other notes:AppWizard uses "TODO:" to indicate parts of the source code you
should add to or customize.If your application uses MFC in a shared DLL, and your application is
in a language other than the operating system's current language, you
will need to copy the corresponding localized resources MFC42XXX.DLL
from the Microsoft Visual C++ CD-ROM onto the system or system32 directory,
and rename it to be MFCLOC.DLL. ("XXX" stands for the language abbreviation.
For example, MFC42DEU.DLL contains resources translated to German.) If you
don't do this, some of the UI elements of your application will remain in the
language of the operating system./////////////////////////////////////////////////////////////////////////////