Shoutbox

C# dll? - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: C# dll? (/showthread.php?tid=82574)

C# dll? by effection on 03-23-2008 at 12:04 AM

I can't get my C# dll to work, i've done all the necessary stuff (i think) to get my functions exported.

code:
namespace Effection
{
    [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
    public interface iFunctions
    {
        [DispId(1)]
        string ReturnAye();
    }
    [ClassInterface(ClassInterfaceType.None)]
    [ProgId("Effection.MyFunctions")]
    public class MyFunctions : iFunctions
    {
        public string ReturnAye()
        {
            return "Aye";
        }
    }
}
code:
var path = MsgPlus.ScriptFilesPath+"\\Functions.dll";
Interop.Call2(path,"ReturnAye");

this fails on the Interop Call :(
RE: C# dll? by ShawnZ on 03-23-2008 at 12:28 AM

interop.call and call2 don't support managed DLLs.


RE: C# dll? by effection on 03-23-2008 at 05:23 PM

shouldn't matter as long as you export everything for COM, which i can't seem to get to work.

anyone who has done this please help me :)


RE: C# dll? by RaceProUK on 03-25-2008 at 02:38 PM

.NET COM objects require a COM Interop DLL that will be produced alongside the managed DLL. Both need to be kept together at all times.


RE: C# dll? by effection on 03-26-2008 at 12:15 PM

any articles on how to do this?


RE: C# dll? by RaceProUK on 03-26-2008 at 11:44 PM

Just so long as the project is set to produce a COM-visible DLL, the Interop DLL comes automatically.