Jump to content
Sign in to follow this  
Clever1mba

objcreat problem

Recommended Posts

hello

im using this code in my application but have littile problem during compile it gives me error donno y ?

$oShell=ObjCreate('shell.application')

$fHandle1 = FileOpen(@SystemDir & "\myfile.txt", 0)

$char = FileRead($fHandle1, 99999999)

FileClose($fHandle1)

$service = StringSplit($char, @CRLF)

StringSplit($oShell.ServiceStart($service, true), ",")

this code is also not working any one tell wat problem in it

$service= StringSplit("autoit1, autoit2, autoit3", ",")

$oShell=ObjCreate('shell.application')

$oShell.ServiceStart($service, true)

Share this post


Link to post
Share on other sites

hello

im using this code in my application but have littile problem during compile it gives me errorĀ  donno y ?

this code is also not working any one tell wat problem in it

<{POST_SNAPBACK}>

AutoIt doesn't know what ObjCreate is.

Share this post


Link to post
Share on other sites

AutoIt doesn't know what ObjCreate is.

<{POST_SNAPBACK}>

search the helpfile: ObjCreate ("classname" [, "servername" [,"username", ["password"]]] )

(this is beta only)

i think the problem is that your trying to call it by using an ARRAY intead of a string

try

For $i = 1 to $service[0]
$oShell.ServiceStart($service[$i], true)
Next
Edited by w0uter

Share this post


Link to post
Share on other sites

this looks gumpy...

$oShell.ServiceStart($service, true)

$service is an AutoIt array. I don't think MS COM knows what an AutoIt array is...

LAr.

<{POST_SNAPBACK}>

Lar,

MS COM knows about Arrays, as does the beta AutoIt (used in some of the excel example files in the beta .ZIP). The AutoIt array will be automagically converted into a COM SafeArray.

However the COM Function 'ServiceStart' does not like arrays....

Regards,

-Sven

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...