void TOleDocWindow::RegFileName( LPSTR FileName )
{
	lstrcpy( lpszDocName , FileName );
	ret = OleRegisterClientDoc( GetApplication()->Name,
			lpszDocName ,
			0,
			&lhClientDoc );
	check ( ret );
}
void TOleDocWindow::RegisterClientDoc() {
	// Tip for using OleRegisterClientDoc:
	// if the lpszDoc parameter passed to
	// OleRegisterClientDoc is not valid, (lpszPatnName in this case),
	// one can get an OLE_ERROR_ADDRESS error, and the ClientDoc
	// handle will not be valid.

	ret = OleRegisterClientDoc(
			GetApplication()->Name,
			lpszDocName,
			0,
			&lhClientDoc );
	check( ret );
}
Example #3
0
void
IT_REGCLIENTDOC(ENV *envp,LONGPROC f)
{
    LHCLIENTDOC lhHandle;
    LPSTR lpString1,lpString2;
    LPBYTE lpStr;
    DWORD retcode;

    lpString1 = (LPSTR)GetAddress(GETWORD(SP+18),GETWORD(SP+16));
    lpString2 = (LPSTR)GetAddress(GETWORD(SP+14),GETWORD(SP+12));
    lpStr = (LPBYTE)GetAddress(GETWORD(SP+6),GETWORD(SP+4));
    retcode = OleRegisterClientDoc(lpString1,lpString2,0L,&lhHandle);
    PUTDWORD(lpStr,lhHandle);
    envp->reg.sp += 3*LP_86 + DWORD_86 + RET_86;
    envp->reg.ax = LOWORD(retcode);
    envp->reg.dx = HIWORD(retcode);
}