Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot create Object error

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
I have been trying to launch a tool such as Notepad from a broswer. I found this little snippet of code on the web:

<input type=button valued=notepad onclick=&quot;launchNotepad()&quot;>
<script language=&quot;javascript&quot;>
function launchNotepad() {
var wshell = new ActiveXObject(&quot;Wscript.shell&quot;)
wshell.run(&quot;notepad.exe&quot;,1)
}
</script>

My current error message from Internet Explorer Script Debugger is &quot;Automation Server cannot create objet.&quot; I don't know if it is worth mentioning but I am using Microsoft's IIS. I tried qualifying the path to notepad: &quot;C:||WINNT||notepad.exe&quot;. Note: I am using &quot;\\&quot; because the html is created inside my perl scripts.

So is it possible to create an ActiveXObject or what?? There must be some other underlying error because it hardly seems feasible that you cannot create active x objects.

Thanks
 
Hi QuakeNutz,

FWIW, a 'Cannot create object' error generally implies that the PEM is not a member of the specified object. From your snippet above, it would mean that the run method isnt a method of the wshell object.

I assume the Windows Scripting Host is installed or else a 'Object class does not exist' error should be triggered when you attempt to instantiate the Shell object with var wshell = new ActiveXObject(&quot;Wscript.shell&quot;).

Here's some VB code that accomplishes what you are attempting:

Dim oShell As Object
Dim lnvar As Integer
Set oShell = CreateObject(&quot;Wscript.Shell&quot;)
lnvar = oShell.Run(&quot;NotePad.exe&quot;, 1)

OR

Dim oWscript As New IWshShell_Class
lnvar = oWscript.Run(&quot;NotePad.exe&quot;, 1)

For additional info, check out the Run method of the Shell object of the Windows Scripting Host in the MSDN. Good luck.
[sig]<p>Jon Hawkins<br><a href=mailto: jonscott8@yahoo.com> jonscott8@yahoo.com</a><br><a href= > </a><br>Focus on the solution....Not the problem.[/sig]
 
sir
here i am using mycrosoft technologies
thing is,, iam calling autocad 2000 object in vb activex dll and i write code of autocad 2000 in vb dll for draw line in autocad 2000.
calling that dll in asp but iam getting error &quot;activeX component cann't create object&quot;

actually my aim is to open autocad and get the line using vb dll and asp.
iam writing the code in vb dll like this
dim autoApp as AcadApplication
set autoApp=createobject(&quot;AutoCAD.Application&quot;)
//here the code for auto cad for drawline
set autoApp=nothing


calling this in asp like this
<%
dim objTest
set objTest=server.createobject(&quot;progID&quot;)
%>
one more thing is it's working in windows'95 not working in windows NT why???
please give the solution if possible

thanking you

suresh bhadra
programmer analyst
regench infotech pvt ltd


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top