Logout

Alt-N Discussion Groups > Discussions > Creating a Plugin using .NET

 [F] Alt-N Discussion Groups  / Discussions  /

Creating a Plugin using .NET

[Pohlmann, Charl]
Charl Pohlmann
Newbie
Newbie
Posts: 7
Charl Pohlmann - 07:12am, May 10 2019

Good day,

I have managed to create a working (sort off) plugin using VB.NET. This was done by using a tool (a href='https://darinhiggins.com/2011/10/10/exposing-c-style-entry-points-in-a-net-assembly-revisited/' target='DLLExportVB')(/a) to create the C style exported functions. The image attached shows the Plugin loading, and also that the PreMessageFuncName works. The problem that I am having, is that no matter what I do, I cannot get any of the SMTP functions to even be called by MDaemon, yet the function signatures for the SMTP function and the Pre/PostMessageFuncName functions are exactly the same. I can even show a dialog when the ConfigFuncName function is called.

I have attached the complete .NET project for both the DLLExportVB tool as well as the project for the Plugin. Dependency Walker can be used to verify that the entry points for the exported functions do indeed exist in both MDaemonPluginVBx64.dll and MDaemonPluginVBx86.dll

The MDaemonPluginVB project contains a batch file in it's root that can be used to recreate the dlls after the project has been recompiled.

The zip file also contains the Plugins.dat that I used.

I would really appreciate it if somebody can shed some light onto why the Pre/Post functions will work but not the SMTP or even Domain/MultiPop functions, when all of their signatures are identical.

Attachments:

Capture.PNG (26 KB)

 

MDaemonPlugin.zip (162 KB)


  (older msg: 3)All MessagesOldest ItemsOlder ItemsNewer ItemsNewest Items

Arron.Caruth@mdaemon.com - May 24, 2019 7:05 am (#4 Total: 4)  

Guest User  

Photo of Author
Posts: 1

My apologies again for not responding sooner.

 

Just in case you are still following this thread, we reviewed our plugin code along with the documentation for plugins and found a mistake in the documentation.  MDPLUGIN_MSG should be used instead of WM_COPYDATA to pass log data back to MDaemon. 

 

Here is an updated example:

 

void _stdcall PreMessageFunc(HWND Parent, const char* File)

{

       COPYDATASTRUCT Packet;

 

       char Buffer[512];

       _snprintf_s(Buffer, _TRUNCATE, "Now processing: %s", File);

 

       Packet.dwData = MDPLUGIN_DISPLAY;

       Packet.cbData = strlen(Buffer);

       Packet.lpData = Buffer;

 

       SendMessage(Parent, MDPLUGIN_MSG, 0, (LPARAM)(PCOPYDATASTRUCT)&Packet);

 

       // Do some processing on File

 

       strcpy(Buffer, "----------");

       Packet.cbData = strlen(Buffer);

       Packet.lpData = Buffer;

 

       SendMessage(Parent, MDPLUGIN_MSG, 0, (LPARAM)(PCOPYDATASTRUCT)&Packet);

}

 

We also updated the documentation to include details about the WPARAM value (0 or 1) that should be passed for the InlineFuncUsesPluginLog option and optimized some of the plugin code.

 

These changes will be included in MDaemon 19.0.2.
--
Arron Caruth
Director of Product Development
o: 817-601-3222    e: arron.caruth@mdaemon.com

MDaemon Technologies
Simple Secure Email
Visit us on www.mdaemon.com | Facebook | LinkedIn | YouTube
Sent using the MDaemon Email Server

 

From: discuss@mdaemon.com [mailto:discuss@mdaemon.com] On Behalf Of Charl Pohlmann (lists-discuss@mdaemon.com)
Sent: Thursday, May 23, 2019 6:41 AM
To: discuss List Member <discuss@mdaemon.com>
Subject: [discuss] Creating a Plugin using .NET

 

And after spending time writing up the previous post, and previewing it, and making sure that everything is readable etc, only half my posting actually shows up, and ins imply truncated half way through.

This forum is therefore utterly useless and I will not waste any more of my time sharing anything here.


View/reply at Creating a Plugin using .NET

 
 
--DISCUSS--------------------------------------------------------------
This mailing list is for questions and discussion regarding Alt-N
products.  To unsubscribe from this mailing list send an email to
discuss-unsubscribe@mdaemon.com .
--DISCUSS--------------------------------------------------------------
 
 
-----------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/Support/RequestSupport/
-----------------------------------------------------------------------

--DISCUSS--------------------------------------------------------------
This mailing list is for questions and discussion regarding Alt-N
products.  To unsubscribe from this mailing list send an email to
discuss-unsubscribe@mdaemon.com .
--DISCUSS--------------------------------------------------------------


-----------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user
support and discussion.  MDaemon staff members may participate in the
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical
support please use the form here:
http://www.mdaemon.com/Support/RequestSupport/
-----------------------------------------------------------------------



  All MessagesOldest ItemsOlder ItemsNewer ItemsNewest Items



 Content:

Read New | Search

 Guest:

Email to Admin



You are visiting as a Guest user.