> i have an activex control for Word. i want to send Printing command to
> my Container(Word) to print itself at specific location from within my
> ActiveX (My be on clicking some context menu item.) is it possible to
> do that. if so then plz help me.
Try IOleClientSite::GetContainer, then query for Word's document object
interface (whatever that might be, I'm not familiar with Word's object
model).

Signature
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
Ahmad - 08 Apr 2005 12:17 GMT
Thanks Igor!
i have done following:
IOleClientSite *pClientSite = NULL;
this->GetClientSite(&pClientSite);
CComPtr<IOleContainer> pContainer;
HRESULT hr = pClientSite->GetContainer(&pContainer);
if (hr == S_OK)
{
CComQIPtr<MSWord::_Application> spApp(pContainer);
ATLASSERT(spApp);
}
hr is S_OK, so my if condition executes. but when i QI for interface
pointer of _Application, spApp gets nothing.
i think i m somewhere wrong. might be at QI. so Plz give me hand to
overcome this problem.
Thanks.
Ahmad Jalil Qarshi
> > i have an activex control for Word. i want to send Printing command to
> > my Container(Word) to print itself at specific location from within my
[quoted text clipped - 12 lines]
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
Igor Tandetnik - 08 Apr 2005 14:45 GMT
> Thanks Igor!
> i have done following:
[quoted text clipped - 8 lines]
> ATLASSERT(spApp);
> }
Try with the document interface, not application interface. _Document
perhaps?

Signature
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
Ahmad - 08 Apr 2005 15:55 GMT
Thanks Igor!
you are Guru. Thanks a lot.
Ahmad Jalil Qarshi
Ahmad - 11 Apr 2005 07:22 GMT
Isn't it possible to get the _Application pointer of MS Word using this
_Document Pointer which i have gotten in my ActiveX control.
I have tried this one.
CComQIPtr<MSWord::_Document> spDoc(pContainer);
ATLASSERT(spDoc);
MSWord::_ApplicationPtr spApp = spDoc->GetApplication();
but not able to get the _ApplicationPtr.
Thanks
Ahmad Jalil Qarshi
Igor Tandetnik - 11 Apr 2005 15:02 GMT
> Isn't it possible to get the _Application pointer of MS Word using
> this _Document Pointer which i have gotten in my ActiveX control.
[quoted text clipped - 6 lines]
>
> but not able to get the _ApplicationPtr.
Like I said, I am not specifically familiar with Word's object model.
I'm afraid I cannot help you any further, sorry.

Signature
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
Hello,
Could you tell me how can I learn ActiveX, OLE to understand clearly all of them ?
What books should I learn ?
Looking forward for your help.
Thanking you in advance for positive responses.
Brian Muth - 21 Apr 2005 16:30 GMT
You can bet a question like this has been asked and answered innumerable
times. That's why it is nice to simply search the archives first, before
posting a repeat question.
Might I suggest you use Google Groups and search for "books" in
microsoft.public.vc.atl (or wherever) to get the information you need.
e.g.;
http://www.google.ca/groups?hl=en&lr=&threadm=OzVPINlsEHA.2196%40TK2MSFTNGP14.ph
x.gbl&rnum=1&prev=/groups%3Fas_q%3Dbooks%26safe%3Dimages%26as_ugroup%3Dmicrosoft
.public.vc.atl%26lr%3D%26hl%3Den
Best regards,
Brian
> Hello,
>
[quoted text clipped - 5 lines]
>
> Thanking you in advance for positive responses.