🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: microsoft.public.inetsdk.programming.scripting.vbscript
4 messages
4 total messages Started by Marc Lacoursiere Wed, 18 Mar 1998 00:00
Calling one instance of an automation object multiple times
#1
Author: Marc Lacoursiere
Date: Wed, 18 Mar 1998 00:00
41 lines
1974 bytes
Hello!

I made an InProc automation object using Delphi3 lately. What I want
to do with it is to create an instance of it in VBScript using
CreateObject in a sub. Then I should get a pointer to it with
GetObject in another sub. Take a look at this example:

______________________________________________________

Sub window_onLoad()
  Dim vObject
  set vObject = CreateObject("Object.Automation")
  vObject.Start
End Sub

Sub Check_OnClick()
  Dim vLObject
  set vLObject = GetObject("", "Object.Automation")

'>>> Insert some calls to vLObject's methods and properties here <<<'

  set vLObject = Nothing
End Sub
______________________________________________________


What I get when I try it in internet explorer 4 is this error message:

	"Unexpected call to method or property access."

I get prompted from this error each time I try to access a method or a
property inserted where specified in the source code written in this
message.

Is there a way to make it work? You should know that I cannot use
vObject, created with CreateObject but I want to use the same instance
that's been created in Sub window_onLoad()...

Mark
EPIX inc.
Re: Calling one instance of an automation object multiple times
#2
Author: John A. Tasler
Date: Thu, 19 Mar 1998 00:00
47 lines
2472 bytes
In my (limited) VB experience, I've found that moving the Dim vObject into
global scope works the best for me.  However, the fact that you're
attempting this from within IE may be your problem.  I don't think that
VBScript in IE allows CreateObject, for security reasons.

Marc Lacoursiere wrote in message <351018a0.12899858@news.total.net>...
>Hello!
>
>I made an InProc automation object using Delphi3 lately. What I want
>to do with it is to create an instance of it in VBScript using
>CreateObject in a sub. Then I should get a pointer to it with
>GetObject in another sub. Take a look at this example:
>
>______________________________________________________
>
>Sub window_onLoad()
>  Dim vObject
>  set vObject = CreateObject("Object.Automation")
>  vObject.Start
>End Sub
>
>Sub Check_OnClick()
>  Dim vLObject
>  set vLObject = GetObject("", "Object.Automation")
>
>'>>> Insert some calls to vLObject's methods and properties here <<<'
>
>  set vLObject = Nothing
>End Sub
>______________________________________________________
>
>
>What I get when I try it in internet explorer 4 is this error message:
>
> "Unexpected call to method or property access."
>
>I get prompted from this error each time I try to access a method or a
>property inserted where specified in the source code written in this
>message.
>
>Is there a way to make it work? You should know that I cannot use
>vObject, created with CreateObject but I want to use the same instance
>that's been created in Sub window_onLoad()...
>
>Mark
>EPIX inc.
Re: Calling one instance of an automation object multiple times
#3
Author: Marc Lacoursiere
Date: Thu, 19 Mar 1998 00:00
14 lines
1521 bytes
>In my (limited) VB experience, I've found that moving the Dim vObject into
>global scope works the best for me.  However, the fact that you're
>attempting this from within IE may be your problem.  I don't think that
>VBScript in IE allows CreateObject, for security reasons.

Firstly, my first goal is not to implement this in Internet Explorer.
I want it to be included in a source code generated by Obsydian 3. I
use Explorer 4 for tests purposes. In Obsydian, it's impossible to set
global variables in vb scopes, so, for this this reason, I'm trying to
make it work in explorer in 2 different subs with local variables.

Mark
EPIX inc.
Re: Calling one instance of an automation object multiple times
#4
Author: Andrew.J.Smith
Date: Thu, 19 Mar 1998 00:00
12 lines
1413 bytes
I found on microsoft support online that vbscript v1.0 did not support
creatobject (it now does)

John A. Tasler wrote in message
<#JpNniwU9GA.205@uppssnewspub04.moswest.msn.net>...
>In my (limited) VB experience, I've found that moving the Dim vObject into
>global scope works the best for me.  However, the fact that you're
>attempting this from within IE may be your problem.  I don't think that
>VBScript in IE allows CreateObject, for security reasons.
>
Andy Smith
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads