Archive for October, 2008

Mapping of Network Drives

I just hate it, when a script simply stops working, ’cause Windows lost the mapping to a network drive. ┬áEspecially, when you have to use another userid and password, so the connection cannot be restored automatically.

Recently I found a solution to my problem.

Apparently you can use OLE Automation with the Windows Script Host (WSH)

So I’ve written the following workspace script:

| params objNetwork |
params := (Array new: 5)
 at:1 put: 'U:' ;
 at: 2 put: '\\remotemachine\Share';
 at: 3 put: false;
 at: 4 put: 'myuserid';
 at: 5 put: 'mypassword';

objNetwork := (OLEObject newLongTypeName: 'WScript.Network') dispatcher.
objNetwork call: 'MapNetworkDrive' params: params.

The WSH has several useful methods and properties. More information about the WSH can be found here.

Some other examples are:

objNetwork := (OLEObject newLongTypeName: 'WScript.Shell') dispatcher.
objNetwork at: 'CurrentDirectory'.


objNetwork := (OLEObject newLongTypeName: 'WScript.Shell') dispatcher.
objNetwork call: 'Exec' params: (Array with: 'calc').

Have fun,

Quis Custodiet Ipsos Custodes?

Cool, continued

Mark Driver’s recent post at gartner says

Smalltalk is cool again.

but we say it’s still cool. And thanks for noticing.

– posted by Mark Grinnell

Camp ObjectStudio

You may have seen photos of the recent ObjectStudio meeting in Cincinnati on James Robertson’s blog:

Everyone had a great time, although really, how many restaurant meals in a row can we all be expected to eat? ­čśë

We were working on three current projects. The Modeling Tool on OS8 was one, although that is actually in very good shape now, thanks to the efforts of Dirk Verleysen. So we spent more of our time on project #2, the Mapping Tool. We were learning about glorp, working on the mapping tool GUI and retargeting the mapping tool to use glorp as the back end. With the Modeling and Mapping tools back and better than ever, we will have gotten back to one of ObjectStudio’s traditional strengths – the ability to move very quickly and easily through design, implementation and delivery of a finished application.

Last but not least was the DLLCC GUI project. The purpose of that effort is to give a major facelift to ObjectStudio. The initial step though is to move all the behavior that lives in the many many GUI oriented primitives up to Smalltalk, using DLLCC to call the Windows API. Once complete, you’ll have the same native widgets you love (and the same class hierarchy and protocol) but with everything finally visible in the Smalltalk image. That will be our platform to move forward with adding shiny new widgets to our toolkit. This should also be of interest to VisualWorks users interested in Windows native widgets.

The other fun part of the meeting was that although it was conceived as a technical meeting only, we organized it with overviews of the current state and direction of those three projects, so we ended up getting good participation from support, marketing and STAR team as well. It felt great to get different areas of the product team all together in the same place.

– posted by Mark Grinnell