Accessing COM reference in Wix version

This forum is for discussing Mailtraq's Scripting features. Get help with Mailtraq scripts, templates and external ActiveX scripting.

Re: Accessing COM reference in Wix version

Postby hottroc » Tue May 21st, 2013 3:26pm

Elric Pedder wrote:That DebugFlag was necessary before the WiX edition was released and now it isn't used any more.

Oh, I thought I was onto something then. Never mind.

Port 7889 is Mailtraq's Remote control port (which is built into Mailtraq and isn't a service).

OK.
Can you run another test? Try a telnet connection to the server on port 7889 and see if you get anything at all.

Nothing at all.
Yet strangely it doesn't give an error message like it does if I use a random port like 7444.
It just sits there.

I've now opened port 7889 in my router and firewall if you wish to try, but let me know when you have finished.
hottroc
Expert User
 
Posts: 106
Joined: Tue Jul 24th, 2007 4:23pm

Re: Accessing COM reference in Wix version

Postby Elric Pedder » Tue May 21st, 2013 4:16pm

So when you telnet it just sits there and eventually returns a message? Or does the screen blank? In fact can you use the Mailtraq Console from that machine?

Can you send me the credentials and server name via PM and I'll test the script from here.
Mailtraq Development and Escalation Support
Novitraq Incorporated
User avatar
Elric Pedder
Mailtraq Escalation Support
 
Posts: 2675
Joined: Tue Nov 23rd, 2004 1:16pm
Location: Montreal, Canada

Re: Accessing COM reference in Wix version

Postby Elric Pedder » Tue May 21st, 2013 4:21pm

I had another idea: what if you replace "localhost" with "127.0.0.1" ?
Mailtraq Development and Escalation Support
Novitraq Incorporated
User avatar
Elric Pedder
Mailtraq Escalation Support
 
Posts: 2675
Joined: Tue Nov 23rd, 2004 1:16pm
Location: Montreal, Canada

Re: Accessing COM reference in Wix version

Postby hottroc » Tue May 21st, 2013 5:10pm

Elric Pedder wrote:So when you telnet it just sits there and eventually returns a message? Or does the screen blank? In fact can you use the Mailtraq Console from that machine?

No message, the screen blanks, then nothing happens....until I press a key then it seems to return to the command prompt.
Yes, no problem using the Mailtraq Console from the machine.

Can you send me the credentials and server name via PM and I'll test the script from here.

OK, will do.
I had another idea: what if you replace "localhost" with "127.0.0.1" ?

You mean replace "127.0.0.1" with "localhost". You mean in the telnet command? Or the cscript command? Either way no difference.

BTW, I just tried with a deliberately incorrect password to see what would happen....I get a message:
"Unable to login to 127.0.0.1 with account user, Code -9" then it returns to the prompt. Does that help?
Last edited by hottroc on Wed May 22nd, 2013 3:26am, edited 1 time in total.
hottroc
Expert User
 
Posts: 106
Joined: Tue Jul 24th, 2007 4:23pm

Re: Accessing COM reference in Wix version

Postby hottroc » Wed May 22nd, 2013 3:16am

Elric, PM sent.

Also my previous comment about the deliberately incorrect password might be a red herring. Doing the same thing today doesn't produce the same results. Not sure why.

Also, just a query related to port 7889....using TCPView I can see that the MailtraqTray seems to have a permanently established connection to the Mailtraq service on this port....is that normal?

MailtraqService.exe 14588 TCP server 7889 localhost 10453 ESTABLISHED 158 45,955 158 32,336 375 819 2 4
MailtraqTray.exe 5192 TCP server 10453 localhost 7889 ESTABLISHED 316 64,613 345 95,510 226 2

If not normal, could that be causing problems (ie because the port is already in use) ? (EDIT - testing with TCPView running seems to show the connection from cscript is being ESTABLISHED so I guess not).
hottroc
Expert User
 
Posts: 106
Joined: Tue Jul 24th, 2007 4:23pm

Re: Accessing COM reference in Wix version

Postby hottroc » Wed May 22nd, 2013 10:57am

Oh Elric, your the man. The PM you sent me has solved the problem. Not only does the test.js script now work, but my add-in, the subject of the topic, is now working again also.

For those reading apart from me and Elric, the solution was that I needed to update the MailtraqRemote API to take account of a change that MS had made to the handling of COM references , or something like that. Now that is done, all working.
Mind you, slightly surprised that it wasn't updated as part of the update of Mailtraq.

Many thanks again.
hottroc
Expert User
 
Posts: 106
Joined: Tue Jul 24th, 2007 4:23pm

Re: Accessing COM reference in Wix version

Postby Elric Pedder » Wed May 22nd, 2013 12:45pm

Thanks for confirming. I believe the version you are using has been the standard download (http://resources.mailtraq.com/files/Mai ... eSetup.exe) for quite a long time so the change to accommodate Microsoft's security patch was mostly forgotten.

Being a separate download it isn't updated with Mailtraq itself, but perhaps it would be a good idea to integrate it in the future.
Mailtraq Development and Escalation Support
Novitraq Incorporated
User avatar
Elric Pedder
Mailtraq Escalation Support
 
Posts: 2675
Joined: Tue Nov 23rd, 2004 1:16pm
Location: Montreal, Canada

Re: Accessing COM reference in Wix version

Postby Martin Clayton » Tue Apr 01st, 2014 6:56am

Hi hottroc & Elric

hottroc wrote:I needed to update the MailtraqRemote API

Thanks for posting the script and eventual fix. I'm keen to get ActiveX going here (ideally via perl but js will do fine) and I'm possibly seeing the same issue. Having searched the forums, I've tried various incantations like:

Code: Select all
var mailtraq = new ActiveXObject("MailtraqRemote.Connection");
var mailtraq = new ActiveXObject("Mailtraq.Control").Server;

... which fail at the first hurdle. It may be that the Remote COM Server I've tried is obsolete, etc. MailtraqRemote.dll shows 2.17.2.3136 which I'm trying on Win 8.1 64bit (post 'regsvr32 MailtraqRemote.dll'). Is there a more recent dll I should be trying?

Thanks for any pointers,
Martin
User avatar
Martin Clayton
Expert User
 
Posts: 529
Joined: Sat Jan 15th, 2005 8:20am
Location: London, UK

Re: Accessing COM reference in Wix version

Postby hottroc » Tue Apr 01st, 2014 12:41pm

My MailtraqRemote.dll version is 2.17.2.3138. It's working fine with Mailtraq 2.17.6.3398 on Win 7 64-bit. Don't know about Win 8 or 8.1 though.

The only comment I would suggest about your code is that your second line might be better with a different variable name?

EG:
Code: Select all
var mailtraq = new ActiveXObject("MailtraqRemote.Connection");
var mailtraqsvr = new ActiveXObject("mailtraq.Control").Server;


Let us know if that helps.
hottroc
Expert User
 
Posts: 106
Joined: Tue Jul 24th, 2007 4:23pm

Re: Accessing COM reference in Wix version

Postby Martin Clayton » Tue Apr 01st, 2014 1:23pm

Hi hottroc

Many thanks for looking.

Trying wscript on win 8.1 with a one-line script:
Code: Select all
var mailtraq = new ActiveXObject("MailtraqRemote.Connection");
// var hr = mailtraq.Login("192.168.1.1", "admin", "password");
// if (hr == 0) {
//  // login succeeded
// }

... I get a Windows Script Host dialog:

Error: Automation server can't create object
Code: 800A01AD
Source: Microsoft JScript runtime error

I wonder if your newer dll will make any odds. Meanwhile, I'll try the script on another version of windows...

Ah, so win2k looks OK (which is where I need it, for now), win8.1 not so.

Thanks for the help.
User avatar
Martin Clayton
Expert User
 
Posts: 529
Joined: Sat Jan 15th, 2005 8:20am
Location: London, UK

Re: Accessing COM reference in Wix version

Postby Elric Pedder » Wed Apr 02nd, 2014 8:42am

As you are using 64bit Windows remember to use the 32bit version of cscript.exe (It isn't \Windows\system32\cscript.exe as you would think but \Windows\SysWOW64\cscript.exe I believe). Does that help?
Mailtraq Development and Escalation Support
Novitraq Incorporated
User avatar
Elric Pedder
Mailtraq Escalation Support
 
Posts: 2675
Joined: Tue Nov 23rd, 2004 1:16pm
Location: Montreal, Canada

Re: Accessing COM reference in Wix version

Postby Martin Clayton » Wed Apr 02nd, 2014 9:16am

Hi Elric
Elric Pedder wrote:\Windows\SysWOW64\cscript.exe I believe). Does that help?

Beggar me, yes. I'm in. :)
User avatar
Martin Clayton
Expert User
 
Posts: 529
Joined: Sat Jan 15th, 2005 8:20am
Location: London, UK

Previous

Return to Mailtraq Scripting

Who is online

Users browsing this forum: No registered users and 1 guest

cron