🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: microsoft.public.inetsdk.programming.scripting.vbscript
Article #2

Re: Calling one instance of an automation object multiple times

#2
From: 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.
Technical Details
Message-ID: <#JpNniwU9GA.205@uppssnewspub04.moswest.msn.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <351018a0.12899858@news.total.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 108cda,7f965f749ffaa0de
X-Google-Attributes: gid108cda,public
X-Google-Thread: 10b423,7f965f749ffaa0de
X-Google-Attributes: gid10b423,public
X-Google-Thread: fd196,7f965f749ffaa0de
X-Google-Attributes: gidfd196,public
X-Google-Thread: fe15c,7f965f749ffaa0de
X-Google-Attributes: gidfe15c,public
From: "John A. Tasler" <jtasler@airmail.net>
Subject: Re: Calling one instance of an automation object multiple times
Date: 1998/03/19
Message-ID: <#JpNniwU9GA.205@uppssnewspub04.moswest.msn.net>
X-Deja-AN: 335508909
References: <351018a0.12899858@news.total.net>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Organization: Tasler Computing
Newsgroups: microsoft.public.inetsdk.programming.scripting.vbscript,borland.public.delphi.oleautomation,microsoft.public.win32.programmer.ole,comp.os.ms-windows.programmer.ole