|
-
Aug 22nd, 2000, 06:15 AM
#1
Thread Starter
New Member
i found a quite strange behaviour of visual basic, is that normal...?
if i set an object property to a value and read it out right after that i get an automation error.
Code:
' will cause an error
object.property = "..."
x = object.property
but if i put a message box between the lines everything works fine...
Code:
' works fine but bugs the user
object.property = "..."
msgbox ":-)"
x = object.property
why is that??? can i fix this problem without bugging the user with a message box? - ya know, a really often need to write and right after that read an objects property...
matthias path
-
Aug 22nd, 2000, 06:22 AM
#2
Frenzied Member
Try putting a DoeEvents instead of an MsgBox.
-
Aug 22nd, 2000, 06:23 AM
#3
Addicted Member
Hi,
I just tried:
Code:
Command1.Caption = "text"
x = Command1.Caption
and it worked fine!
what properties are you setting that are causing this problem? (and with which object?)
Shaun
Web/Application Developer
VB6 Ent (SP5), Win 2000,SQL Server 2000
-
Aug 22nd, 2000, 08:31 AM
#4
Thread Starter
New Member
the dhtmledit control
i's using the dhtmledit control with the following command:
Code:
DHTMLEdit1.DocumentHTML = "..."
x = DHTMLEdit1.DocumentHTML
by the way: another interesting thing is this command is working a first time but from then on it does not.
strange, huh?
-
Aug 22nd, 2000, 08:40 AM
#5
Addicted Member
Hi,
I know whats happening now.. You are trying to read it's property before the DHTML page is ready. Try putting this in your code:
Code:
DHTMLEdit1.DocumentHTML = "..."
Do While DHTMLEdit1.Busy = True
DoEvents
Loop
x = DHTMLEdit1.DocumentHTML
that should do the trick..
hope that helps,
Shaun
Web/Application Developer
VB6 Ent (SP5), Win 2000,SQL Server 2000
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|