WebGadget DocumentComplete event
I too would like too know what the WebGadget is up to sometimes, and I feel like I've been to some of the places y'all have, trying to find out.
For what it's worth, with reference strictly to (Word) "Documents", I had some luck with the following code:
***********************************************************
;Sorry, I don't know how this code will show up if copied to your system.
If OpenWindow(0, 0, 0, 1000,1000, #PB_Window_SystemMenu|#PB_Window_Screencentered, "View Word document(s)...")
If CreateGadgetList(WindowID())
File$ = OpenFileRequester("Choose file(s)", "C:\", "MS Word Documents (*.doc)|*.doc", 0,#PB_Requester_MultiSelection)
WebGadget(1, 0,0, 1000, 1000, "File://"+File$) ;maybe "File://" tells browser not to look for connection
Repeat
Event = WaitWindowEvent()
Debug event
If Event=#PB_EventRepaint
Delay(3000)
SetGadgetText(1,NextSelectedFileName())
EndIf
Until Event = #PB_EventCloseWindow ;THIS (by going to End) will close WinWord, Debugger/Quit will not
EndIf
EndIf
FreeGadget(1)
End
;Note: (Per Freak) on the first run, the file might take a little time before displaying,
;because the webgadget needs to load the MS-word file display thingy first.
;Subsequent displays should be faster, then.
*************************************************************
The key point here is "simply" Repaint, which (simply) refers to a mixture of my naive understanding of the issues with the ideosyncracies of Microsoft's Webbrowser.
In some way, though, I think, this and the Web Browser threads are related to a thread (maybe mis)titled "Message 275 (1792 on similar projects)": viewtopic.php?t=10802&highlight=messages
I thank you recent posters for confirming that the problem was not, solely, with my feeble mind; and again, I thank the respondents, especialy fweil,to my earlier questions.
For what it's worth, with reference strictly to (Word) "Documents", I had some luck with the following code:
***********************************************************
;Sorry, I don't know how this code will show up if copied to your system.
If OpenWindow(0, 0, 0, 1000,1000, #PB_Window_SystemMenu|#PB_Window_Screencentered, "View Word document(s)...")
If CreateGadgetList(WindowID())
File$ = OpenFileRequester("Choose file(s)", "C:\", "MS Word Documents (*.doc)|*.doc", 0,#PB_Requester_MultiSelection)
WebGadget(1, 0,0, 1000, 1000, "File://"+File$) ;maybe "File://" tells browser not to look for connection
Repeat
Event = WaitWindowEvent()
Debug event
If Event=#PB_EventRepaint
Delay(3000)
SetGadgetText(1,NextSelectedFileName())
EndIf
Until Event = #PB_EventCloseWindow ;THIS (by going to End) will close WinWord, Debugger/Quit will not
EndIf
EndIf
FreeGadget(1)
End
;Note: (Per Freak) on the first run, the file might take a little time before displaying,
;because the webgadget needs to load the MS-word file display thingy first.
;Subsequent displays should be faster, then.
*************************************************************
The key point here is "simply" Repaint, which (simply) refers to a mixture of my naive understanding of the issues with the ideosyncracies of Microsoft's Webbrowser.
In some way, though, I think, this and the Web Browser threads are related to a thread (maybe mis)titled "Message 275 (1792 on similar projects)": viewtopic.php?t=10802&highlight=messages
I thank you recent posters for confirming that the problem was not, solely, with my feeble mind; and again, I thank the respondents, especialy fweil,to my earlier questions.
Sparkie, I posted a function here:
viewtopic.php?t=11292
that might help you figure out which events you are receiving, although, most likely not, if they are some specially defined ones..
I'm looking very much forward to see how you get these events.
I did try to look at the code you linked to but I really cannot stand looking at c++-code anymore since I discovered the beauty that is PureBasic..! (fx why are there so many files in these packages....?!?)
ern, I'm sorry but I don't get what you are trying to say..
viewtopic.php?t=11292
that might help you figure out which events you are receiving, although, most likely not, if they are some specially defined ones..
I'm looking very much forward to see how you get these events.
I did try to look at the code you linked to but I really cannot stand looking at c++-code anymore since I discovered the beauty that is PureBasic..! (fx why are there so many files in these packages....?!?)
ern, I'm sorry but I don't get what you are trying to say..
Sorry to say soerenkj, that your function does us no good here. (Nice work by the way
)
Here's where I'm stuck...
I think _variant_t varID() converted to PB is
pElemColl->item( varID, varIdx, &pElemDisp ) converted to PB
Just can't get the variant's to cooperate 

Here's where I'm stuck...
Code: Select all
_variant_t varID( "myID", VT_BSTR );
_variant_t varIdx( 0, VT_I4 );
hr = pElemColl->item( varID, varIdx, &pElemDisp )
Code: Select all
varId.Variant
Code: Select all
pElemColl\item(varID, varIdx, @pElemDisp.IDispatch)

What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
PB 5.21 LTS (x86) - Windows 8.1
hi Sparkie, there is no Variant structure defined in my PureBasic..!?
did you just yourself define it like the microsoft VARIANT structure? :
http://msdn.microsoft.com/library/defau ... 6_7zdz.asp
but according to msdn _variant_t is a *class* that incapsulates this VARIANT structure. And they are saying that the VARIANT structure cannot be passed by reference (I don't know if that is enforced in VC++? but I guess not in PB..)
I don't know how we can make something equivalent to the class constructions in PB.. especially when the _variant_t doesn't even have any constructor that takes a string (char pointer?) as it's first arguement, according to http://msdn.microsoft.com/library/defau ... iant_t.asp
did you just yourself define it like the microsoft VARIANT structure? :
http://msdn.microsoft.com/library/defau ... 6_7zdz.asp
but according to msdn _variant_t is a *class* that incapsulates this VARIANT structure. And they are saying that the VARIANT structure cannot be passed by reference (I don't know if that is enforced in VC++? but I guess not in PB..)
I don't know how we can make something equivalent to the class constructions in PB.. especially when the _variant_t doesn't even have any constructor that takes a string (char pointer?) as it's first arguement, according to http://msdn.microsoft.com/library/defau ... iant_t.asp
- NoahPhense
- Addict
- Posts: 1999
- Joined: Thu Oct 16, 2003 8:30 pm
- Location: North Florida
..
@sparkie
There are a couple usages of the variant here on the forums. You might
search around.. The variant structures that I have looked at on here are
VERY scary..
But someone has already created em.
- np
There are a couple usages of the variant here on the forums. You might
search around.. The variant structures that I have looked at on here are
VERY scary..

- np
Ignoring all other issues about the WebBrowser, I meant that if the "document" (a nebulous term in MSspeak- see http://msdn.microsoft.com/workshop/brow ... cument.asp? ) in question is an MSWord document; a #PB_EventRepaint message seems to come back to the PureBasic program when the document is complete.
By complete, I mean a "done deal" such that I can see it on the screen, and my program can proceed smoothly to another (multi)selected "document" without any intervention on my part.
On another hand; if the "document" is a JPEG image, a WM_Timer message(#275, I think) seems to come back to PureBasic.
Admittedly, I didn't get far enough in my investigations to understand what Microsoft defines or supposes "DocumentComplete" to mean.
By complete, I mean a "done deal" such that I can see it on the screen, and my program can proceed smoothly to another (multi)selected "document" without any intervention on my part.
On another hand; if the "document" is a JPEG image, a WM_Timer message(#275, I think) seems to come back to PureBasic.
Admittedly, I didn't get far enough in my investigations to understand what Microsoft defines or supposes "DocumentComplete" to mean.
-
- User
- Posts: 39
- Joined: Fri Mar 26, 2004 1:47 pm
- Location: London, UK
- Contact:
What, no updates?
Any more progress Sparkie?
I'm interested to see how this goes....
I'm interested to see how this goes....
Progress report:
1. Was able to lose about 4 to 5 more hours of my life while reading about Variants
2. Was able to burn and destroy about 3 more brain cells 8O
3. Discovered I still have room for more gray hairs
4. Learned that our cat doesn't know anything about Variants either :roll:
Not to worry though, I am persistant with loads of patience. It's only a matter of time until we overcome this beast knows as the Variant.
1. Was able to lose about 4 to 5 more hours of my life while reading about Variants

2. Was able to burn and destroy about 3 more brain cells 8O
3. Discovered I still have room for more gray hairs

4. Learned that our cat doesn't know anything about Variants either :roll:
Not to worry though, I am persistant with loads of patience. It's only a matter of time until we overcome this beast knows as the Variant.

What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
PB 5.21 LTS (x86) - Windows 8.1
hi, I just returned from my holiday in Barcelona... sorry to see, that no solution has been found yet..
but anyway, Sparkie, could you post the code you made until now - you were saying you were able to see events coming from the 'IWebBrowser2-object'..? (I guess it should be possible to figure out which events they are..)
but anyway, Sparkie, could you post the code you made until now - you were saying you were able to see events coming from the 'IWebBrowser2-object'..? (I guess it should be possible to figure out which events they are..)
Welcome back soerenkj 
I'm not sure I still have that code intact. I have about 30 different variations of code that I was working on. I'll go back in time and see if I can dig that one out.
If I remember correctly, the events I was seeing were not actually webgadget related. That's what led me to the point where I am now, stuck on VARIANTS.

I'm not sure I still have that code intact. I have about 30 different variations of code that I was working on. I'll go back in time and see if I can dig that one out.
If I remember correctly, the events I was seeing were not actually webgadget related. That's what led me to the point where I am now, stuck on VARIANTS.

What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
PB 5.21 LTS (x86) - Windows 8.1
- NoahPhense
- Addict
- Posts: 1999
- Joined: Thu Oct 16, 2003 8:30 pm
- Location: North Florida
I knew we were in trouble after I saw this post from freak. 
I haven't given up on this but right now most of my time is being spent on another project.

I haven't given up on this but right now most of my time is being spent on another project.

What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
PB 5.21 LTS (x86) - Windows 8.1
Sparkie, did you see this post:
viewtopic.php?t=11031&highlight=interface+generator
looks like aXend understands that variant stuff..!
viewtopic.php?t=11031&highlight=interface+generator
looks like aXend understands that variant stuff..!