Click here to Skip to main content
15,914,481 members
Home / Discussions / COM
   

COM

 
AnswerRe: How to get selected element ?(MSHTML) Pin
Neville Franks27-Feb-03 10:25
Neville Franks27-Feb-03 10:25 
GeneralRe: How to get selected element ?(MSHTML) Pin
jajamal27-Feb-03 17:37
jajamal27-Feb-03 17:37 
GeneralRe: How to get selected element ?(MSHTML) Pin
Stephane Rodriguez.28-Feb-03 0:54
Stephane Rodriguez.28-Feb-03 0:54 
GeneralRe: How to get selected element ?(MSHTML) Pin
jajamal28-Feb-03 3:39
jajamal28-Feb-03 3:39 
Generala problem of a ASP component creating process Pin
programmesky25-Feb-03 14:28
programmesky25-Feb-03 14:28 
GeneralRe: a problem of a ASP component creating process Pin
geo_m26-Feb-03 0:13
geo_m26-Feb-03 0:13 
GeneralRe: a problem of a ASP component creating process Pin
programmesky26-Feb-03 13:33
programmesky26-Feb-03 13:33 
GeneralWebBrowser Printing Pin
MoMad24-Feb-03 9:06
MoMad24-Feb-03 9:06 
I have been using an ActiveX control for controlling the printing of some specific pages. I followed the examples of msdn and how they use print templates and printing programmatically... but now I have one major problem that i cannot seem to fix.

I have provided a print, and preview button in the page to invoke my control's own printing, but when the user selects print from the file menu or ctrl+p, internet explorer does its own printing. What I wanted to do is that my control should take over all printing operations so long as the user is viewing that report.

I know this is possible because ScriptX has an event called user_print and user_preview and I wanted to know how such an event could be achieved.

The ideas that I had so far are the following:

1. CBT Hooking
2. Capture the necesary events from a pointer to WebBrowser2
3. Using Javascript, capture onbeforeprint and use my own

But the above 3 things all didnt work out in my experience, first, the CBT Hooking didnt exactly allow me to drill down into the webbrowser instance, it did however, allow me to capture the print dialog and replace the action of the OK button. But what about when the user presses the print icon in IE. Also, what about when the user presses the print icon from the preview window. The javascript event doesnt cancel so if I just call my own print function when that event is called, it goes into an infinite recursion and a stack overflow and it causes internet explorer to be terminated. The second one is the only one that still might have any hope. I just dont know enough about COM/ATL to be able to capture events from an interface.

So to wrap it up, I have 2 functions in the activex, Print, Preview, and PrintNoPrompt

Print first shows the print dialog and prints
Preview just previews the page
PrintNoPrompt just prints the page without showing the prompt

I was wondering if there was a way to do the following:

First, Redirect CTRL+P, File->Print, Rightclick->Print to my Print function. Second, Redirect File->Preview and Print Preview icon on toolbar to my Preview function. And finally, Redirect Print icon on toolbar to my PrintNoPrompt function.

If anyone can help me figure this out, it will be greatly appreciated.


MoMad the NoMad
GeneralRe: WebBrowser Printing Pin
MoMad24-Feb-03 12:11
MoMad24-Feb-03 12:11 
GeneralRe: WebBrowser Printing Pin
Brian Shifrin4-Mar-03 10:30
Brian Shifrin4-Mar-03 10:30 
GeneralRe: WebBrowser Printing Pin
MoMad5-Mar-03 8:36
MoMad5-Mar-03 8:36 
GeneralPointer identities Pin
Jörgen Sigvardsson24-Feb-03 4:58
Jörgen Sigvardsson24-Feb-03 4:58 
GeneralRe: Pointer identities Pin
geo_m25-Feb-03 23:17
geo_m25-Feb-03 23:17 
GeneralUsing the vTable of an ActiveX DLL with Known Interface and Unknown GUID Pin
RichB21-Feb-03 1:45
RichB21-Feb-03 1:45 
GeneralTracing DLL CreateObject calls Pin
baby.chai20-Feb-03 5:03
baby.chai20-Feb-03 5:03 
GeneralDCOM over COM Pin
Adrian Bacaianu20-Feb-03 4:46
Adrian Bacaianu20-Feb-03 4:46 
GeneralRe: DCOM over COM Pin
13-Mar-03 3:44
suss13-Mar-03 3:44 
GeneralRe: DCOM over COM Pin
Adrian Bacaianu13-Mar-03 3:53
Adrian Bacaianu13-Mar-03 3:53 
GeneralInterface - COM compatible Pin
haranath19-Feb-03 21:00
haranath19-Feb-03 21:00 
QuestionOLECHAR* in c#? Pin
kamosoft519-Feb-03 1:28
kamosoft519-Feb-03 1:28 
AnswerRe: OLECHAR* in c#? Pin
kamosoft519-Feb-03 4:04
kamosoft519-Feb-03 4:04 
GeneralRe: OLECHAR* in c#? Pin
firat kocak20-Feb-03 5:55
firat kocak20-Feb-03 5:55 
GeneralOut-of-proc COM server Pin
Shah Shehpori19-Feb-03 0:50
sussShah Shehpori19-Feb-03 0:50 
GeneralRe: Out-of-proc COM server Pin
Jörgen Sigvardsson24-Feb-03 5:01
Jörgen Sigvardsson24-Feb-03 5:01 
GeneralSecure COM DLL Pin
antoine_boillier18-Feb-03 7:45
antoine_boillier18-Feb-03 7:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.