Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vista Issue with OLE?
Message
From
05/03/2010 20:16:24
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Vista Issue with OLE?
Miscellaneous
Thread ID:
01452894
Message ID:
01452894
Views:
105
I actually have a solution here i was just wondering about the cause of the problem.

I use two ways to display text content in a messagebox. The first way we have just discovered crashes one of our computers using VISTA OS. The second way does not. Anybody any thoughts on this? Is it a VISTA issue or simply a setting on the affected computer.

BTW The codes are not mine but were supplied by the good people on this site who actually know what they're doing. Sorry i cannot remember who gave them to me so i cannot credit them.

thanks
k
sample 1 - VISTA crashes:

ystr=filetostr('c:\db\prg\menu\m.txt')
oForm = Createobject('myForm',m.ystr)
Define Class myForm As Form
  Add Object myBrowser As OleControl ;
    With OleClass='shell.Explorer'
  Procedure myBrowser.Refresh
    Nodefault
  Endproc

  Procedure Init(tcStr)
    This.myBrowser.Navigate2("about:blank")
    Do While This.myBrowser.readystate # 4
    Enddo
    This.myBrowser.Object.Document.ParentWindow.alert(m.tcStr)
    Return .F.
  Endproc
Enddefine

*************************************************

sample 2- VISTA works
ystr=filetostr('c:\db\prg\menu\m.txt')
apIE=createobject("internetexplorer.application")
apIE.navigate("about:blank")
do while apIE.busy or apiE.readystate#4
ENDDO
&&always on top
declare integer BringWindowToTop in Win32API integer lnWnd
 = BringWindowToTop(apIE.hwnd ) 
apIE.document.ParentWindow.alert(ystr)
apIE.quit
Next
Reply
Map
View

Click here to load this message in the networking platform