What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [?] C#.net dll and ActiveXObject

Pages: (2): « First [ 1 ] 2 » Last »
[?] C#.net dll and ActiveXObject
Author: Message:
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
29 / Male / Flag
Joined: Apr 2006
Status: Away
O.P. [?] C#.net dll and ActiveXObject
I made a dll in C#.net with MS Visual C# 2005 Express Edition. When i declare the ActiveXObject it gives either of the two errors.
code:
Error: unknown.
       Line: 4. Code: -2147024894.
or
code:
Error: Automation server can't create object.
       Line: 4. Code: -2146827859.

-The dll is COM Visible
-The dll is registered with ResAsm utility and is also placed in <DotNetFiles> in the ScriptInfo.xml
-A GUID is registered.

I've read other threads on the forum, some of them having the same problem. But none have a working solution :sad:.

Any help is appreciated :wink:

This post was edited on 12-14-2006 at 01:46 PM by Felu.
12-14-2006 12:39 PM
Profile E-Mail PM Web Find Quote Report
Deco
Full Member
***


Posts: 188
Reputation: 4
41 / Male / Flag
Joined: Aug 2006
RE: [?] C#.net dll and ActiveXObject
Great thread. Same problem here.

Would you send me some c# code so I see if I'm doing something wrong there? I'm not even sure my dll is COM visible.

12-14-2006 12:57 PM
Profile E-Mail PM Web Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
29 / Male / Flag
Joined: Apr 2006
Status: Away
O.P. RE: [?] C#.net dll and ActiveXObject
Sample code i'm using
code:
public string Return(string strString)
        {
            return strString;
        }
And to make an assembly COM visible in Visual C# 2005. Projects > Application > Assembly Information > Make Assembly COM Visible.
12-14-2006 01:06 PM
Profile E-Mail PM Web Find Quote Report
Deco
Full Member
***


Posts: 188
Reputation: 4
41 / Male / Flag
Joined: Aug 2006
RE: [?] C#.net dll and ActiveXObject
Thanks :) I'm trying some things here if I succeed I'll make sure to let you know
12-14-2006 01:07 PM
Profile E-Mail PM Web Find Quote Report
Chestah
Veteran Member
*****

Avatar

Posts: 1658
Reputation: 34
35 / Male / –
Joined: Jun 2004
RE: [?] C#.net dll and ActiveXObject
I can't exactly remember how i got my C# dlls to work, but theres another process you have to do to the actual code itself to get it "visible" and able to be registered. I'm fairly sure i learnt how to do it from a tutorial on the codeproject website.

Sorry, but i hope this helps :).

Edit: Heres a .dll i made to use with Plus! live, having a look at the format you may beable to copy it and make your dll accessible.

The project name was "MPL".

code:
using System;
using System.Collections;
using System.Text;
using System.Runtime.InteropServices;

namespace CS
{
    [Guid("D6F88E95-8A27-4ae6-B6DE-0542A0FC7039")]
    [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]

    public interface _Functions
    {
        [DispId(1)]
        string DoSearch(string query, int resultsnum);
    }



    [Guid("13FE32AD-4BF8-495f-AB4D-6C61BD463EA4")]
    [ClassInterface(ClassInterfaceType.None)]
    [ProgId("MPL.Functions")]
    public class Functions : _Functions
    {
        public string DoSearch(string query, int resultsnum)
        {
            //example code
        }
    }
}

I'd personally recommend staying away from ActiveX dlls and use as much Jscript as you can.

This post was edited on 12-14-2006 at 01:23 PM by Chestah.
Segosa is newb.
12-14-2006 01:16 PM
Profile E-Mail PM Web Find Quote Report
Deco
Full Member
***


Posts: 188
Reputation: 4
41 / Male / Flag
Joined: Aug 2006
RE: [?] C#.net dll and ActiveXObject
If I make a dll out of that..

var msg = Interop.Call("c:\\Projects\\sendMsg\\teste.dll","DoSearch","feio",2);

Calling it like that...

Interop.Call failed to locate function "DoSearch"

is what I get.

12-14-2006 01:34 PM
Profile E-Mail PM Web Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
35 / Male / Flag
Joined: Mar 2004
RE: [?] C#.net dll and ActiveXObject
quote:
Originally posted by Deco
If I make a dll out of that..

var msg = Interop.Call("c:\\Projects\\sendMsg\\teste.dll","DoSearch","feio",2);

Calling it like that...

Interop.Call failed to locate function "DoSearch"

is what I get.

:-/ thats for a COM dll though, Interop.Call is for dlls which export their functions.

you use the following for COM

code:
var obj = new ActiveXObject("name.id");

[Image: dt2.0v2.png]      Happy Birthday, WDZ
12-14-2006 01:44 PM
Profile PM Web Find Quote Report
Deco
Full Member
***


Posts: 188
Reputation: 4
41 / Male / Flag
Joined: Aug 2006
RE: [?] C#.net dll and ActiveXObject
Ok that was it...
Thanks
12-14-2006 02:00 PM
Profile E-Mail PM Web Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
29 / Male / Flag
Joined: Apr 2006
Status: Away
O.P. RE: [?] C#.net dll and ActiveXObject
Read many articles on The Code Project, none of them could help me to get rid of the unknown error [Image: xso_sad.gif].
12-16-2006 05:00 AM
Profile E-Mail PM Web Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: [?] C#.net dll and ActiveXObject
quote:
Originally posted by -!Felu!-
Read many articles on The Code Project, none of them could help me to get rid of the unknown error [Image: xso_sad.gif].

* ShawnZ sighs

why are you searching so specifically? why not search for something like "C# COM ActiveX Expose" or sometihng :-/
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
12-16-2006 05:05 AM
Profile PM Web Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On