Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ VBscript ➜ ActiveX plugin in MUSHClient

ActiveX plugin in MUSHClient

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Sentinel   (5 posts)  Bio
Date Tue 10 Sep 2002 11:02 AM (UTC)
Message
Hi

I try to use an ActiveX plugin in USHClient, but it doesn't seeem to work.

I can use the plugin from Word just fine, but the same code from mushclient gives me an error.
The code is very simple:

Sub loadhud()
Dim HUD
Set HUD = CreateObject("XPERTHUD.XPERTHUD")
HUD.AboutBox
End Sub


MUSHClient produces the following error in the "HUD.AboutBox" line

Error number: -2147418113
Event: Execution of line 5 column 1
Description:
Called by: Immediate execution


but the same Method is callable from VBS from Word. Or from within a VB application


Any ideas ?


Sentinel
Top

Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 10 Sep 2002 08:57 PM (UTC)
Message
Sounds like the CreateObject is failing. I think you can test for something like:


  if HUD is nothing then
    world.note "Could not create COM object"
    exit sub
  end if
 


Does the message occur during compilation, or execution? ie. do you have to type:

/loadhud

for the message to occur?

Does the "about" box appear?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Sentinel   (5 posts)  Bio
Date Reply #2 on Wed 11 Sep 2002 08:31 AM (UTC)
Message
I have to call /loadhud to execute it, and the error comes during execution in the 'HUD.AboutBox' line before the Box is displayed. I now added the test code, but it seems I get a object back. at leat something != 'nothing'. for testing purposes I inserted an invalid Object name, and the script broke off right in the CreateObject line.



Peter
Top

Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Reply #3 on Wed 11 Sep 2002 10:59 PM (UTC)
Message
It is quite difficult to say without seeing the COM object. I presume it is a small VB program? If you email it to me I'll try to work out what is going on (the project source, not the .exe).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Sentinel   (5 posts)  Bio
Date Reply #4 on Thu 12 Sep 2002 07:36 AM (UTC)
Message
Well, I dont think it would help you.
a) its a C++ programm
b) after having problems with my code, I just tried the stuff with the basic, nothing-else ActiveX code, that Is autogenerated by VC++ 6.0. THen only thing I changed from Default is the name at which it registeres, and I also checked the 'invisible at runtime' button, but thats all.

Peter
Top

Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Reply #5 on Thu 12 Sep 2002 08:26 AM (UTC)
Message
I understand C++, MUSHclient is written in it, after all.

If you don't want to send the whole source send a test program that reproduces the problem (eg. just has the about box).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Sentinel   (5 posts)  Bio
Date Reply #6 on Fri 13 Sep 2002 06:34 PM (UTC)
Message
I mailed you the code.

Would e cool if you finf the time to check it.


Peter
Top

Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Reply #7 on Fri 13 Sep 2002 10:02 PM (UTC)
Message
As I said in my email, I can't get it to work, however since I am not an expert in writing COM controls that can be called from script engines (or from anywhere for that matter), I can't say for sure where the problem is. It might be:


  • A problem in the control, that doesn't show up when it is called from Word
  • A problem in MUSHclient, however I note that I can call other COM objects (like ODBC database calls) OK
  • A problem in the scripting engine (eg. VBscript) because the control is really being called from VBscript


I don't know enough about COM and how it interacts with VBscript etc. to say for sure how to fix it.

I did a post a while back about how to make a VB project (COM object) that could be called from the script engine - that is the best I can do.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Sentinel   (5 posts)  Bio
Date Reply #8 on Sun 15 Sep 2002 12:35 AM (UTC)
Message
I got it under control now.
I changed from an ActiveX control to a simple ATL Object, which now loads just fine in MUSHClient.

THna you for your time anyways


Peter
Top

Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Reply #9 on Sun 15 Sep 2002 12:59 AM (UTC)
Message
Can you email it to me so I can post it as a "how to make a COM object" tutorial?

Preferably say what options you set and what changes you made to make it.

I tried using ATL without success.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


23,445 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.