Page 1 of 1
message 275 (1792 on similar projects)
Posted: Sun May 09, 2004 2:23 am
by ern
Hi y'all
I got PureBasic 0n 3/9/04, and I'm amazed by IT, but dismayed by Microsoft/Windows. In the 80's I used COBOL and have been playing catch-up ever since. I've enjoyed running some of your(s) code, and have done some things myself. One of my approaches has been to take your examples down to the minimum of what I'd like to do, and here's an example.
I have commented my specific questions; but of course there are others, such as 1)as far as I know, atl.dll is not in the same directory;
2)is this machine or environment(or machine/environment-whatever that is) specific; 3)who knows????- As for (3),Bluenz is aware of 275; Fred' of course, would know; and whoever else except me knows. Thanks to Freak, I wish I was able to use IsBusy.......
This is the first time I've posted to any forum whatsoever(don't even know how to use emoticons or if this is a new topic ), so please excuse whatever whatever, and I look forward to any assistance.
If OpenWindow(0, 0, 0, 600, 600, #PB_Window_Screencentered|#PB_Window_SystemMenu, "Web(Image)Browser")
If CreateGadgetList(WindowID())
File$ = OpenFileRequester("Choose some JPEGs", "", "JPEG Formats|*.jpg;*.jpeg", 0, #PB_Requester_MultiSelection)
WebGadget(0, 0,0, 1000, 1000, "File://"+File$) ;maybe "File://" tells browser not to look for connection????????
CallDebugger
Repeat
Event = WaitWindowEvent()
Debug event
If Event = 275; This works on my Win 98 machine, anyone know why?????????????????
Delay(2000)
SetGadgetText(0,NextSelectedFileName())
EndIf
Until Event = #PB_EventCloseWindow
EndIf
EndIf
Regards,
Ern
Posted: Sun May 09, 2004 2:53 am
by fweil
Ern,
First about 275 message you get, AFAIK only three values correspond to :
#ERROR_EAS_DIDNT_FIT
#MCIERR_FILE_NOT_FOUND
#WM_TIMER
In your case, I guess this is #WM_TIMER which is sent because of no message in the queue. I am not sure, but I guess so.
Well, if this is the case, you don't have to care about. This is underground messaging from Windows OS.
Then, indeed File:// means to search for a local resource file instead of browsing over the net when using http://
As it seems you have long experience in software programming and computing, welcome for questions and shared code.
Rgrds
Back to the drawing board
Posted: Sun May 09, 2004 2:21 pm
by ern
Well; I see this morning that my code works fine in the debugger, but not in an executable, so my questions may be academic-but I'm stuck with them.
Sometimes, with Windows, I feel like The Blind Men and the Elephant. Microsoft suggests using the webbrowser control for uses other than Web browsing, but they only make this easy? for users of their C++ and VB products. PureBasic has made it very easy to access the control (thumbs up); and, for all of its problems, my little piece of code is far less bewildering than the MSN documentation. Perhaps it only needs a little fix here and there, but....perhaps not. I'll keep my fingers crossed.
Thanks for the previous reply and any others which may come along.
Posted: Sun May 09, 2004 2:34 pm
by fweil
Ern,
You say
Well; I see this morning that my code works fine in the debugger, but not in an executable, so my questions may be academic-but I'm stuck with them.
... you mean the code posted here ?
It works after compiling and excuting the .exe file to me.
Let me know if this is another part of code or post it if you want some more help.
Rgrds
P.S.
Posted: Sun May 09, 2004 3:51 pm
by ern
I didn't mean to get so minimal as to forget an End statement
Posted: Sun May 09, 2004 4:03 pm
by thefool
It also works fine on my computer. Also after compiling.
I have windows XP, maybe its because you use win98.
If someone that have win98 sees this topic, could you please try the code?
I belive fweil is right when he says its a #WM_TIMER message.
Maybe this is a windows bug not a pb bug.
Posted: Sun May 09, 2004 4:51 pm
by fweil
Ern,
Could you try the following and tell what it does ?
Code: Select all
If OpenWindow(0, 0, 0, 600, 600, #PB_Window_Screencentered|#PB_Window_SystemMenu, "Web(Image)Browser")
If CreateGadgetList(WindowID())
File$ = OpenFileRequester("Choose some JPEGs", "", "JPEG Formats|*.jpg;*.jpeg", 0, #PB_Requester_MultiSelection)
WebGadget(0, 0,0, 1000, 1000, "File://"+File$)
SetWindowTitle(0, "Web(Image)Browser : " + File$)
EndIf
Repeat
Wevent = WaitWindowEvent()
If Wevent = #PB_Event_CloseWindow
Quit = #TRUE
ElseIf WEvent = 275
Delay(2000)
File$ = NextSelectedFileName()
SetGadgetText(0,File$)
EndIf
Until Quit
EndIf
CloseWindow(0)
End
Posted: Sun May 09, 2004 5:45 pm
by freak
Yes, the WebGadget() does post lots of misterious #WM_TIMER messages
to the main queue. I have no idea why.
They do not end up in the calback though, so if anybody needs a WebGadget
and a timer, he should check for the #WM_TIMER message in the callback.
Timo
Posted: Sun May 09, 2004 5:58 pm
by fweil
...,
Maybe by doing some tests call directly IwebBrowser2 functions you should discover that timers are launched to check the ready state or something like that. And probably some lacks exists in the Atl.dll file about such timers.
Anyway, I suppose it does not really affect other timers you may run or am I wrong ?
Posted: Sun May 09, 2004 6:09 pm
by ern
While my original code worked consistently in my debugger and failed consistently as an executable; fweil's variation works inconsistently in both(for me); yet I can't see much difference in the logic.
I guess it was sort of reckless using something when I didn't know what it was, much less what it meant or whether it really really worked.
Anyway, I'm glad it worked all-around for some, and you're welcome to use it, being aware it's not very robust.
And, as I am writing this message, I think that freak has just summed up the situation.
Thanks so much to all, it's been fun, and I consider my questions (except for 32770 and 1792-which are, perhaps, the "underground messages") answered.
Good day
Posted: Sun May 09, 2004 6:19 pm
by fweil
...,
32770 is a #XTYP_ERROR : A dynamic data exchange (DDE) callback function receives the XTYP_ERROR transaction when a critical error occurs (WINAPI32 says)
1792 is a #EN_MSGFILTER : The EN_MSGFILTER notification message notifies a rich edit control's parent window of a keyboard or mouse event in the control. A rich edit control sends this notification message in the form of a WM_NOTIFY message (same WINAPI32 source of information).
This has effectively something to do with Atl.dll and IWebbrowser2 technologies.
Rgrds