March 01, 2005
"Carlos Santander B." <csantander619@gmail.com> wrote in message news:d02lek$qka$1@digitaldaemon.com...
> DMDScript has been broken: "Error: circular initialization dependency with module value". I think it's caused between dmdscript.value (obviously) and dmdscript.protoerror (the only other static constructor is in dmdscript.lexer). The dependency seems to be: value -> dobject -> protoerror -> value. I only tested it on Windows.

I know. The dependency stuff got tightened up in 0.114. I have DMDScript fixed, I just haven't uploaded it yet.


> OT: DMDScript source
> Walter, don't you think the imports in DMDScript should all be private?
> Could you change that, please?

Probably a good idea.


March 01, 2005
Walter wrote:
> "Carlos Santander B." <csantander619@gmail.com> wrote in message
> news:d02lek$qka$1@digitaldaemon.com...
> 
>>DMDScript has been broken: "Error: circular initialization dependency
>>with module value". I think it's caused between dmdscript.value
>>(obviously) and dmdscript.protoerror (the only other static constructor
>>is in dmdscript.lexer). The dependency seems to be: value -> dobject ->
>>protoerror -> value. I only tested it on Windows.
> 
> 
> I know. The dependency stuff got tightened up in 0.114. I have DMDScript
> fixed, I just haven't uploaded it yet.
> 
> 

Thanks.

> 
>>OT: DMDScript source
>>Walter, don't you think the imports in DMDScript should all be private?
>>Could you change that, please?
> 
> 
> Probably a good idea.
> 
> 

I would remove the "probably" ;)

_______________________
Carlos Santander Bernal
March 02, 2005
Greetings!

I have a bunch of JScript programs that I want to move to ds, but I need to know if ds works well with COM objects as Word, Excel, IExplorer, etc.  For example, I have this JScript program that opens a web browser with this function:

function GetIEWindow()
{
var Title = "DAE Log Report Creator - Get Values";  // Title of IE window
var intCount = 0;                      // Counter used during AppActivate
//Create reference to objIE.  This will be used for
//the user messages. Also set IE display attributes
//var objIE = new ActiveXObject("InternetExplorer.Application");
var objIE = WScript.CreateObject("InternetExplorer.Application");
objIE.Navigate("about:blank");
objIE.ToolBar   = 0;
objIE.Menubar   = 0;
objIE.StatusBar = 0;
objIE.Width     = 850;
objIE.Height    = 710;
objIE.Left      = 10;
objIE.Top       = 10;
//Set some formating
objIE.document.writeln ("<!doctype html public>");
objIE.document.writeln ("<head>");
objIE.document.writeln ("<title>" + Title + "</title>");
objIE.document.writeln ("<style type=\"text/css\">");
objIE.document.writeln
("body {text-align: left; font-family: courier; font-size: 9pt}");
objIE.document.writeln ("</style>");
objIE.document.writeln ("</head>");
objIE.document.bgColor = "ddffdd";
objIE.document.writeln (
"<script type=\"text/javascript\">" +
"function submitform() " +
"{ " +
"  document.title = \"DAE Log Report Creator - Process Values\";"  +
"  alert(\"Values Accepted.\"); " +
"} " +
"</script>" );
objIE.document.writeln ('<form name="GetVals" method="post">');
//Wait for IE to finish
while (objIE.busy) { w.Sleep( 200); }
//Show IE
objIE.Visible = 1;
return(objIE);
}

How well does DMDScript plays with Windows COM objects?

thanks,

jic


March 02, 2005
"jicman" <jicman_member@pathlink.com> wrote in message news:d03kek$1tra$1@digitaldaemon.com...
> How well does DMDScript plays with Windows COM objects?

The C++ one does, but the D version does not.


March 02, 2005
Walter says...
>
>"jicman" <jicman_member@pathlink.com> wrote in message news:d03kek$1tra$1@digitaldaemon.com...
>> How well does DMDScript plays with Windows COM objects?
>
>The C++ one does, but the D version does not.

Is it ever going to provide it?



March 02, 2005
"jicman" <jicman_member@pathlink.com> wrote in message news:d052ih$h4o$1@digitaldaemon.com...
> Walter says...
> >
> >"jicman" <jicman_member@pathlink.com> wrote in message news:d03kek$1tra$1@digitaldaemon.com...
> >> How well does DMDScript plays with Windows COM objects?
> >
> >The C++ one does, but the D version does not.
>
> Is it ever going to provide it?

Unlikely, given the lack of interest in the C++ version that does it.


March 09, 2005
Walter wrote:
> "jicman" <jicman_member@pathlink.com> wrote in message
> news:d03kek$1tra$1@digitaldaemon.com...
> 
>>How well does DMDScript plays with Windows COM objects?
> 
> 
> The C++ one does, but the D version does not.

The C++ might play, but I wouldn't say that it plays well.

For example, this code (similar to what jicman suggested),

    var objIE = new ActiveXObject("InternetExplorer.Application");
    objIE.Navigate("about:blank");
    objIE.ToolBar   = 0;
    objIE.Menubar   = 0;
    objIE.StatusBar = 0;
    objIE.Width     = 850;
    objIE.Height    = 710;
    objIE.Left      = 10;
    objIE.Top       = 10;
    objIE.Visible = 1;

works fine as JScript (save it as a .js file and see for yourself). A blank Internet Explorer window is opened. That was the expected result.

On the other hand, DMDScript 1.02 (the last C++ version) won't touch this code:

    Digital Mars DMDScript 1.02
    www.digitalmars.com
    Compiled by Digital Mars C/C++ 8.32.3
    written by Walter Bright
    1 source files
    Exception: primitive Undefined has no Construct method

And no IE window is opened. (Too bad there isn't a line number on the error message, but that's another issue and it might be better in the latest version.)

I'd be able to use DMDScript for many things if it allows us to create ActiveX/COM objects. Without ActiveX, it's not very useful to me. Am I just using the wrong syntax?

(Sorry for cross-posting, but the rest of this thread is cross-posted and who am I to break with precedent.)

-- 
Justin (a/k/a jcc7)
http://jcc_7.tripod.com/d/
March 09, 2005
J C Calvarese wrote:
> 
> The C++ might play, but I wouldn't say that it plays well.
> 
> For example, this code (similar to what jicman suggested),
> 
>     var objIE = new ActiveXObject("InternetExplorer.Application");
>     objIE.Navigate("about:blank");
>     objIE.ToolBar   = 0;
>     objIE.Menubar   = 0;
>     objIE.StatusBar = 0;
>     objIE.Width     = 850;
>     objIE.Height    = 710;
>     objIE.Left      = 10;
>     objIE.Top       = 10;
>     objIE.Visible = 1;
> 
> works fine as JScript (save it as a .js file and see for yourself). A blank Internet Explorer window is opened. That was the expected result.
> 
> On the other hand, DMDScript 1.02 (the last C++ version) won't touch this code:
> 
>     Digital Mars DMDScript 1.02
>     www.digitalmars.com
>     Compiled by Digital Mars C/C++ 8.32.3
>     written by Walter Bright
>     1 source files
>     Exception: primitive Undefined has no Construct method
> 
> And no IE window is opened. (Too bad there isn't a line number on the error message, but that's another issue and it might be better in the latest version.)
> 
> I'd be able to use DMDScript for many things if it allows us to create ActiveX/COM objects. Without ActiveX, it's not very useful to me. Am I just using the wrong syntax?
> 

How is that JS code that you posted written in D? I could try to implement it in Walnut, but I have no experience with ActiveX besides what Visual Basic does for you, so I could use a lot of help. The samples I've seen so far load COM objects using a GUID (is it the same with ActiveX?) but I see you load by name. Also, there's always an interface declared, but I think properties and methods are called dynamically, so another option is needed.

I was thinking about doing this before, but there's a doubt I have: I've tried to keep Walnut as platform independent as possible (that's why I've used MinWin), but ActiveX is clearly a Windows-only feature. Does it make sense to add ActiveX support?

> (Sorry for cross-posting, but the rest of this thread is cross-posted and who am I to break with precedent.)
> 

I think any of us can break with precedent, as you put it.

_______________________
Carlos Santander Bernal
March 09, 2005
Justin,

I also tried it after that reply from Walter, but it didn't work, and having no documentation about COM anywhere, I gave up.  I would use DMDScript instead of JScript, but it needs to have the COM communication capabilities that JScript has.  Otherwise, it's just another basic language, except that it's faster. Scripting usage, for most folks, is based in being be able to connect to a drive or a server or a printer; sometimes basic server login features and grouping features; emailing after a task is done or when an error is encountered, etc. All of these need Windows COM communications.

Walter, if you know of a way of doing it, please post it here and I'll give it a try.

Anyway, I feel your pain, Justin. :-)

josé

J C Calvarese says...
>
>Walter wrote:
>> "jicman" <jicman_member@pathlink.com> wrote in message news:d03kek$1tra$1@digitaldaemon.com...
>> 
>>>How well does DMDScript plays with Windows COM objects?
>> 
>> 
>> The C++ one does, but the D version does not.
>
>The C++ might play, but I wouldn't say that it plays well.
>
>For example, this code (similar to what jicman suggested),
>
>     var objIE = new ActiveXObject("InternetExplorer.Application");
>     objIE.Navigate("about:blank");
>     objIE.ToolBar   = 0;
>     objIE.Menubar   = 0;
>     objIE.StatusBar = 0;
>     objIE.Width     = 850;
>     objIE.Height    = 710;
>     objIE.Left      = 10;
>     objIE.Top       = 10;
>     objIE.Visible = 1;
>
>works fine as JScript (save it as a .js file and see for yourself). A blank Internet Explorer window is opened. That was the expected result.
>
>On the other hand, DMDScript 1.02 (the last C++ version) won't touch this code:
>
>     Digital Mars DMDScript 1.02
>     www.digitalmars.com
>     Compiled by Digital Mars C/C++ 8.32.3
>     written by Walter Bright
>     1 source files
>     Exception: primitive Undefined has no Construct method
>
>And no IE window is opened. (Too bad there isn't a line number on the error message, but that's another issue and it might be better in the latest version.)
>
>I'd be able to use DMDScript for many things if it allows us to create ActiveX/COM objects. Without ActiveX, it's not very useful to me. Am I just using the wrong syntax?
>
>(Sorry for cross-posting, but the rest of this thread is cross-posted and who am I to break with precedent.)
>
>-- 
>Justin (a/k/a jcc7)
>http://jcc_7.tripod.com/d/


March 09, 2005
Carlos Santander B. wrote:
> J C Calvarese wrote:
...
> 
> How is that JS code that you posted written in D? I could try to 

Actually, I wish I knew.

My point was that JScript can do it. DMDScript can't (apparently). I'm pretty sure that D can do stuff like this if the programmer knows what he's doing, but that's not me (yet). But I don't see any reason to use DMDScript if can't do ActiveX. (The only thing I ever use JScript/VBScript for is ADO.)

> implement it in Walnut, but I have no experience with ActiveX besides 

Oh, yeah. I forgot about Walnut.  Yay for open source!

> what Visual Basic does for you, so I could use a lot of help. The samples I've seen so far load COM objects using a GUID (is it the same with ActiveX?) but I see you load by name. Also, there's always an interface declared, but I think properties and methods are called dynamically, so another option is needed.

Somebody must know how to do this!

A while back, I found some C code (written by someone else) that uses IScriptControl to accomplish to start Microsoft's VBScript engine, but I couldn't get it converted into D. When I finally got something to compile it gives me an "Access Violation". Even if it had worked, it would've been a little messy, but I coudln't even get it to work!

I think the C method was based on one of these pages:
http://www.aleax.it/TutWin32/s39.htm
http://www.aleax.it/TutWin32/r35.htm

> I was thinking about doing this before, but there's a doubt I have: I've tried to keep Walnut as platform independent as possible (that's why I've used MinWin), but ActiveX is clearly a Windows-only feature. Does it make sense to add ActiveX support?

I think it makes a lot of sense to add ActiveX support. Some Linux diehards might snicker, but I'd think most Windows programmers would applaud.

> 
>> (Sorry for cross-posting, but the rest of this thread is cross-posted and who am I to break with precedent.)
>>
> 
> I think any of us can break with precedent, as you put it.

Yeah, I guess I should have used an emoticon of some sort to indicate humor. ;)

> _______________________
> Carlos Santander Bernal


-- 
Justin (a/k/a jcc7)
http://jcc_7.tripod.com/d/
1 2 3 4 5
Top | Discussion index | About this forum | D home