mIRC Home    About    Download    Register    News    Help

Print Thread
#83071 15/05/04 03:46 PM
Joined: May 2004
Posts: 10
P
Pingh Offline OP
Pikka bird
OP Offline
Pikka bird
P
Joined: May 2004
Posts: 10
I created a really quick dll in .net to go into the registry and grab a binary key value and convert it into usable data.

(It basically got the current DU-Meter stats)

This was my first attempt at creating a Mirc compatible dll, and I quickly realized it was malformed.

I scoured the net for a bit in hopes to find an example of a .net dll compatible with mirc, and I haven’t been able to find one yet.

Currently Mirc maintains it’s “$dll: no such routine ‘test’” no matter what I’ve tried.

To my understanding the functions within the dll have to be of the form:
Code:
 int __stdcall procname(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause 


granted this form isn't exactly native to .net, I took some liberties with it and came up with the following:

Code:
 public unsafe int version(IntPtr mWnd, IntPtr aWnd,char *data,char *parms, bool show, bool nopause) 


I wasn’t able to determine what data type HWND was in, but from what I gather it’s an IntPtr.
Because of the way .net handles pointers, I first tried to pass in the data and param variables by reference, but had no luck. I then tried to handle them as normal pointers, but the compiler wouldn’t let me touch them directly as they were “unsafe” so I had to flag the entire method as unsafe, and force the compiler to compile unsafe segments with the /unsafe compiler argument.
I converted the BOOL’s to bool’s as necessary.

Now at this point the function still wasn’t accessible, so I am wondering if I am completely off on the wrong tangent.

Has anybody successfully created a .net dll compatible with mirc? Or is there any help available?

Thanks very much for your time.

-pingh

#83072 15/05/04 03:53 PM
Joined: Dec 2002
Posts: 397
A
Fjord artisan
Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
goto mircscripts.net and goto their dll section most of their dlls come w/ source code grin grin

note i didnt read whole post ;/ just scanned it kinda

Last edited by ATMA; 15/05/04 03:54 PM.

Need amazing web design for low price: http://www.matrixn3t.net
#83073 15/05/04 07:15 PM
Joined: May 2004
Posts: 10
P
Pingh Offline OP
Pikka bird
OP Offline
Pikka bird
P
Joined: May 2004
Posts: 10
I tried the site listed in your post in hopes to find one that was created in .net, but I haven't been able to find any. I posted on their forums as well.

The issue I am dealing with is trying to code a .net dll that's compatible with mirc.

I suppose I could recode the dll in C++ but that's just added work that's really not worth the effort.


#83074 15/05/04 08:42 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
I'm sorry that I'm unable to help, but you may find this thread useful.

If you want to contact the poster, see his user details.

#83075 16/05/04 12:50 PM
Joined: May 2004
Posts: 10
P
Pingh Offline OP
Pikka bird
OP Offline
Pikka bird
P
Joined: May 2004
Posts: 10
That example basically shows someone creating a C++ DLL that references the .net api.

It's an interesting read, but wasn't really what I was trying to do.

I was hoping to create the dll in C#, and have it directly accessible from mirc.

I guess there are several things I can do, create a buffer dll written in C++ that then makes calls to the .net dll.

Granted I could just rewrite the thing in C++. I just find it odd that nobody has really written a .net dll for mirc yet.

#83076 16/07/04 08:10 PM
Joined: Sep 2003
Posts: 12
A
Pikka bird
Offline
Pikka bird
A
Joined: Sep 2003
Posts: 12
Actually theres no way to do it in standard C# class librarys you have to do it from $com instead of $dll which requires the dll to be registered the the GAC if you would like i could show an example and give some tips on doing this just drop me a pm or hit me up on IRC irc.us.gamesurge.net #script
ive built many dlls that worked this way just 1 problem though the /comclose method in mIRC doesnt fully work on them for development it holds the object in memory and wont let you replace with a new version till mirc is restarted.


Link Copied to Clipboard