Devstudio 5/6 cant create shell object in macro 
Author Message
 Devstudio 5/6 cant create shell object in macro

Why doesnt this work?

I should be able to do this from a VC5.0 or 6.0 macro...

dim shell
Set shell = CreateObject("Wscript.Shell.1")      <or "wscript.shell">
shell.Run ("notepad")

The devstudio environment complains that it cant createobject!



Mon, 19 Feb 2001 03:00:00 GMT  
 Devstudio 5/6 cant create shell object in macro
DevStudio will only create objects that are marked as "safe for scripting".
(Annoying, eh?)  Obviously, the shell is not safe for scripting, but if you
need a workaround, you can always mark it that way.  Check out the docs to
find the necessary registry entries.

-- KDJ

Quote:

>Why doesnt this work?

>I should be able to do this from a VC5.0 or 6.0 macro...

>dim shell
>Set shell = CreateObject("Wscript.Shell.1")      <or "wscript.shell">
>shell.Run ("notepad")

>The devstudio environment complains that it cant createobject!



Mon, 19 Feb 2001 03:00:00 GMT  
 Devstudio 5/6 cant create shell object in macro
I not 100% sure, but I don't believe the macro language has access to
outside objects.  I tried to create file system object and got the same
result.  I believe it says it somewhere in the documentation.  That's
why I'm creating an add-in.

Tom

Quote:

> Why doesnt this work?

> I should be able to do this from a VC5.0 or 6.0 macro...

> dim shell
> Set shell = CreateObject("Wscript.Shell.1")      <or "wscript.shell">
> shell.Run ("notepad")

> The devstudio environment complains that it cant createobject!



Tue, 20 Feb 2001 03:00:00 GMT  
 Devstudio 5/6 cant create shell object in macro
Thank you, I got this to work by doing....

[HKEY_CLASSES_ROOT\CLSID\{F935DC22-1CF0-11D0-ADB9-00C04FD58A0B}\Implemented
Categories\{7DD95801-9882-11CF-9FA9-00AA006C42C4}]

Where F935DC...etc is the CLSID of the wscript.shell object.
You can do the same with any other object that you wish to allow to be
scripted.

Quote:

>DevStudio will only create objects that are marked as "safe for scripting".
>(Annoying, eh?)  Obviously, the shell is not safe for scripting, but if you
>need a workaround, you can always mark it that way.  Check out the docs to
>find the necessary registry entries.

>-- KDJ


>>Why doesnt this work?

>>I should be able to do this from a VC5.0 or 6.0 macro...

>>dim shell
>>Set shell = CreateObject("Wscript.Shell.1")      <or "wscript.shell">
>>shell.Run ("notepad")

>>The devstudio environment complains that it cant createobject!



Tue, 20 Feb 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Creating complicated DevStudio macros

2. DevStudio Macro Terminator: msdev.exe - Application Error

3. Why CreateObject() fails in DevStudio Macro?

4. VC6 DevStudio Macro files have Incorrect Icon Association

5. Can I do CreateObject from inside DevStudio macro files

6. DevStudio Macros

7. Retrieving build output from an executed DevStudio Macro

8. Why CreateObject() fails in DevStudio Macro?

9. I need vc ide macro help, trying to create a move to end of word macro

10. I need vc ide macro help, trying to create a move to end of word macro

11. CArray of objects - cant "Add" new objects - cant convert from class CMyClass to class CMyClass

12. cant add ref to remote object

 

 
Powered by phpBB® Forum Software