- Got GroupWise 6.0.2
- Write code with C++

1) Can create Commander

_COM_SMARTPTR_TYPEDEF(IGWCommander, IID_IGWCommander);
IGWCommanderPtr spGWCommander;
HRESULT hr = spGWCommander.CreateInstance(CLSID_GWCommander);

2) Can execute the token

VARIANT_BOOL bSuccess(VARIANT_FALSE);
BSTR result = 0;
TCHAR* pszCommand = "EnvVersionName()";
HRESULT hr = spGWCommander->Execute(_bstr_t(pszCommand), &result,
&bSuccess);

After the call hr is S_OK, bSuccess 1 and result "6.0.2"

3) Cannot execute

TCHAR* pszCommand = "EnvUserID(ActiveUser!; InternetEmail!)";
HRESULT hr = spGWCommander->Execute(_bstr_t(pszCommand), &result,
&bSuccess);

OR

TCHAR* pszCommand = "EnvUserID(1; 2)";
HRESULT hr = spGWCommander->Execute(_bstr_t(pszCommand), &result,
&bSuccess);

In both cases hr is S_OK, bSuccess 0 and result "Token failed execution!"

4) The above code works perfectly on GroupWise 5.5 and 6.5 !

So, what can be wrong? Im getting desperate