Re: ATL Service EXE VS .NET 2003 - Won't register method
Brian
1) I am running the ATL service under administrator id
2) I am running the ATL service under windows XP pro
3) How do you setup the security on the client side?
The client codes are following
#include "stdafx.h"
#include "TestDvrCtrl.h"
#import "C:\temp\Atl-Tutorials\DVRService\_DVRService.tlb"
#ifdef _DEBUG
#define new DEBUG_NEW
#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
_tprintf(_T("Fatal Error: MFC initialization failed\n"));
nRetCode = 1;
}
else
{
DVRService::IDVRControllerPtr m_DvrCtrl;
HRESULT hr = CoInitialize( NULL );
HRESULT hRes = m_DvrCtrl.CreateInstance("DVRService.DVRController");
if ( FAILED(hRes) )
{
_com_error err(hRes);
AfxMessageBox(err.ErrorMessage());
}
char szMessage[MAX_PATH];
ZeroMemory( szMessage, MAX_PATH );
DOUBLE dbReturnCode = 0;
strcpy( szMessage, "this is me" );
int iLen = strlen(szMessage);
m_DvrCtrl->OnStart(szMessage, (DOUBLE) iLen, &dbReturnCode );
m_DvrCtrl->OnStop();
m_DvrCtrl.Release();
CoUninitialize();
// TODO: code your application's behavior here.
}
return nRetCode;
}
"Brian Muth" wrote:
"Danh Vo" <DanhVo@discussions.microsoft.com> wrote in message
news:89C761F5-FBAF-4642-8778-7C0564D9A49C@microsoft.com...
Hi Brian
I used
CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_NONE,
RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL);
which open for everyone. I am new to ATL service EXE. Does it allow to
create method to call from Client? My goal is to send some XML data
through
function call. Any suggestion book which go in detail of how to create
ATL
service only and has a lot of examples to learn?
No, none of the books I have deal in detail with ATL services very much.
It's hard to help you if you don't answer my questions.
Brian