[Windows Mobile Development and Hacking General] Honza:
:( Hi !

I testing make Out of procces server on XDA II (MDA II) in eVc++4. I have problems

with this. If i called in client this :

IComMDA m_ComMda;

COleException m_Error;

if (m_ComMda.CreateDispatch(_T("ComMDA.Document"),&m_Error))

{

AfxMessageBox(_T("CreateDispatch - TRUE"),MB_OK,0);

return TRUE;

}

else

{

AfxMessageBox(_T("CreateDispatch - FALSE"),MB_OK,0);

return FALSE;

}

the error occur

==> CreateDispatch returning scode = severity: SEVERITY_ERROR, facility:

FACILITY_WIN32 ($800700C1).

IComMDA is class created from typelibrary :

class IComMDA : public COleDispatchDriver

{

public:

IComMDA() {} // Calls COleDispatchDriver default constructor

IComMDA(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}

IComMDA(const IComMDA& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}

// Attributes

public:

// Operations

public:

BOOL InitInterface();

};

interface is declared :

[ uuid(713B5595-EF1F-4961-A179-E374E0C82903), version(1.0) ]

library ComMDA

{

importlib("stdole32.tlb");

importlib("stdole2.tlb");

// Primary dispatch interface for CComMDADoc

[ uuid(901AD61B-9974-448a-9E79-7898E0C80FFE) ]

dispinterface IComMDA

{

properties:

// NOTE - ClassWizard will maintain property information here.

// Use extreme caution when editing this section.

//{{AFX_ODL_PROP(CComMDADoc)

//}}AFX_ODL_PROP

methods:

// NOTE - ClassWizard will maintain method information here.

// Use extreme caution when editing this section.

//{{AFX_ODL_METHOD(CComMDADoc)

[id(1)] boolean InitInterface();

//}}AFX_ODL_METHOD

};

// Class information for CComMDADoc

[ uuid(E523187A-FFB7-46e9-AA64-A6CB1BEAF9BB) ]

coclass Document

{

[default] dispinterface IComMDA;

};

//{{AFX_APPEND_ODL}}

//}}AFX_APPEND_ODL}}

};

Class is registered as :

CString strServerName;

CString strLocalServerName;

CString strLocalShortName;

CString strLocalFilterName;

CString strLocalFilterExt;

if (!m_pDocTemplate->GetDocString(strServerName,

CDocTemplate::regFileTypeId) || strServerName.IsEmpty())

{

return;

}

if (!m_pDocTemplate->GetDocString(strLocalServerName,

CDocTemplate::regFileTypeName))

strLocalServerName = strServerName; // use non-localized name

if (!m_pDocTemplate->GetDocString(strLocalShortName,

CDocTemplate::fileNewName))

strLocalShortName = strLocalServerName; // use long name

if (!m_pDocTemplate->GetDocString(strLocalFilterName,

CDocTemplate::filterName))

ASSERT(nAppType != OAT_DOC_OBJECT_SERVER);

if (!m_pDocTemplate->GetDocString(strLocalFilterExt,

CDocTemplate::filterExt))

ASSERT(nAppType != OAT_DOC_OBJECT_SERVER);

ASSERT(strServerName.Find(' ') == -1); // no spaces allowed

int nIconIndex = 0;

POSITION pos = AfxGetApp()->GetFirstDocTemplatePosition();

for (int nIndex = 1; pos != NULL; nIndex++)

{

CDocTemplate* pTemplate = AfxGetApp()->GetNextDocTemplate(pos);

if (pTemplate == m_pDocTemplate)

{

nIconIndex = nIndex;

pos = NULL; // set exit condition

}

}

BOOL bResult = FALSE;

if (TRUE)

{

// call global helper to modify system registry

// progid, shortname, and long name are all equal in this case

if (!(bResult = AfxOleRegisterServerClass(m_clsid, strServerName,

strLocalShortName, strLocalServerName, nAppType,

rglpszRegister, rglpszOverwrite, nIconIndex,

strLocalFilterName, strLocalFilterExt)))

{

// not fatal (don't fail just warn)

AfxMessageBox(AFX_IDP_FAILED_TO_AUTO_REGISTER);

}

}

else

{

bResult = AfxOleUnregisterServerClass(m_clsid, m_lpszProgID, m_lpszProgID,

m_lpszProgID, OAT_DISPATCH_OBJECT);

}

return;

------------------------------------------------

type library is registered as AfxOleRegisterTypeLib(AfxGetInstanceHandle(),

clsid);

where >// {713B5595-EF1F-4961-A179-E374E0C82903}

static const GUID clsid =

{ 0x713b5595, 0xef1f, 0x4961, { 0xa1, 0x79, 0xe3, 0x74, 0xe0, 0xc8, 0x29,

0x3 } };

Thanks for your help.