Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Normstorm
Newbie


Joined: 08 Jan 2001
Posts: 2

PostPosted: Mon Jun 27, 2005 4:51 am   

ZMud Programming with C#.NET
 
I'm trying to port a ZMud plugin written in VB6 to C#.NET. I've setup a reference to zmud.exe in my References folder and noticed that Visual Studio .NET 2003 creates an Interop.Zmud.dll file.

I'm able to implement the IzMudPlugin ie, using C# notation of

public class ZMudLinkDLL : IzMUDPlugin

and I have implemented all of the methods such that it compiles in Visual Studio. Including the Register method as

public void Register(ref string Name
, ref string Company
, ref string Regcode
, ref string Description
, ref string Version
, ref string HelpFile
, ref bool LoadDef)
{
Name = "Test Plugin";
Company = "Zugg Software";
Regcode = "123456789012";
Description = "Test";
HelpFile = "";
LoadDef = true;
}

However when I try to reference the DLL in ZMud, it says it is not a valid plugin. Any suggestions or has anyone created a plugin with C#.NET that I could use as reference?

Thanks in advance.
Reply with quote
Tarn
GURU


Joined: 10 Oct 2000
Posts: 873
Location: USA

PostPosted: Mon Jun 27, 2005 5:10 am   
 
You should register for the Developer's Forum.

I haven't tried to use .NET for a plugin, but I did have a similar problem with C++ under VS6. The plugin was valid and would work, but zMud's plugin manager had trouble recognizing it as valid. For details, bgunther gave the most detailed writeup a few years ago in the dev forum if you want to do a search.

Two things to try:
1) Use your plugin from another program- script, anything, just to see if the system can create and use it as a COM object.
2) If (1) works, then try registering the plugin by hand in your registry.

There's a family of keys in the registry under \HKEY_CURRENT_USER\Software, and in the following example I have a plugin named Test:
Code:

Zuggsoft\
   zMUD
      Plugins
        Test


My example is Test; you'll need five keys under it (below are name, type, Data):
(Default) REG_SZ (Value not set)
ClassName REG_SZ TestPlug.CTrialPlugin
Enabled REG_DWORD 0x00000001 (1)
FileName REG_SZ c:\plug\testplug.dll
UseCOM REG_DWORD 0x00000001 (1)

-Tarn
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net