Hi there,

I am having a problem in GroupWise 7 SP1 with DMS, I am wandering if
anyone has same experience? The problem is when a user open a word
document and then try to save as a new document, Groupwise doesn't return
to the new document, but stay in the old one instead. So I have to close
the current old document and go to Groupwise and choose the new document
to open for editing. This is not happening in GroupWise 6 and it works
well.

Here is the code we are using:

----------------------------------------------------------------------
int WINAPI ImportODMADocument(LPTPH_RETURNVAL lpTokenData, HWND hLinkWnd) {
char szDocExt[128];
char szErrMsg[128];
CString szDocID;
LPMAC_RETURNVAL lpTknReturn = (LPMAC_RETURNVAL)NULL;

sprintf(szDocExt, "%s", lpTokenData->lpToken->rgParam[0].uData.lpvPtr);

// tell GroupWise to reserve memory for the return data
lpTknReturn = (LPMAC_RETURNVAL)SendMessage(hLinkWnd, WPLM_ALLOC_MEM, 0,
(LPARAM)(sizeof(MAC_RETURNVAL) + strlen(szDocID)));

if (FAILED(CoInitialize(NULL))) {
MessageBox(NULL, "Failed to Initialize COM Library", 0, MB_OK);
return DLL_HAN_NO_ERROR;
}
else {

DMProfile *MyObject;

MyObject = new DMProfile;
MyObject->CreateDispatch(_T("Metastorm.DMProfile"));
szDocID = MyObject->DocumentODMAImport(szDocExt);
delete MyObject;
CoUninitialize();
}

// check that a DocumentID has been returned
if (szDocID == "")
return DLL_HAN_NO_ERROR;

// check for valid pointer
if (lpTknReturn == NULL) {
MessageBox(NULL, "Error allocating memory for return data", 0,
MB_OK);
return DLL_HAN_NO_ERROR;
}

// fill structure members
lpTknReturn->rv.eType = eValStringOem;
lpTknReturn->rv.uValue.stData.wStrLen = strlen(szDocID);
strcpy(lpTknReturn->rv.uValue.stData.uStr.azData, szDocID);

// assign return data structure to token data structure
*lpTokenData->lplpmacRetVal = lpTknReturn;

return DLL_HAN_NO_ERROR;

} // end ImportODMADocument
----------------------------------------------------------------------


I am sure the new document ID is created and return correctly and when
debug, there is no exception occurs.

if anyone can shed me some light, much appreciated!

Thanks,

Philip