Hejsa alle.
Jeg er helt ny i Delphi og besluttede at dette skulle være mit første rigtige projekt i delphi.
Jeg er ikke helt grøn og har styr på en del i sproget.
Okay, nå men jeg har den her service til at køre.
Denne service har en masse events hvor jeg kan sætte den til at eksekvere forskellige scripts og kommandoer.
Det jeg ønsker er at sende en tekst fra servicen direkte ind i mirc.
Jeg er dog ikke sikker på hvordan dette kan gøres?
Har noget DLL hjælp til mirc her: http://www.udvikleren.dk/article.php?aid=108
Problemet er bare at det er når mirc requester en dll + funktion.
Jeg skal have det den anden vej rundt. Sende en commando/tekst til mirc.
Havde tænkt mig noget ala:
SendCommand(phWnd, chWnd: hWnd, command: string)
phWnd -> mIRC window handle
chWnd -> channel window handle
command -> den commando der skal sendes til kanalen
Men så sidder jeg så lige fast her. Hvordan får man den lige til at gøre dette?
Har noget jeg har fundet på nettet som du måske kan bruge?
/////////////// PAST ////////////////////
For an example I'm just going to show you how to create the dll and make it report the dll version to mirc.
First off you create a dll as per normal then you can start by adding a function.
The function is setup as below because of the method required for mirc.
function versionreply( mWnd: hWnd; aWnd: hWnd; Data: PChar; Parms: PChar;
Show: Boolean; NoPause: Boolean ): Integer; export; stdcall;
var blah,blah2:pansichar;
begin
blah2 := pchar(GetProgramVersion('zirc.dll'));
// above line well get the version of zirc.dll which is What I decided to
// call the current dll.
blah := pchar('7[14 Zirc.DLL version ' + blah2 + ' 7][14 by Zoomer 7]');
// above line is basic layouf and design of teh output.
strcopy(data, blah );
Result := 3; // when result = 3 it will send back the content of data.
end;
Then in teh exports you put the function you have created and then compile.
eg.
exports
versionreply;
You should now have a dll that you can place in the mirc directory, once you have done this open up mirc and click the green icon with /a writen on it or goto the action screen.
in this section you are going to need to make an action to access the dll it will looke like this;
mydllversion {
say $dll(zirc.dll,versionreply,_)
}
Then on one of the irc channels when connected if you type
/mydllversion
Now you should have on the screen what you want. (ie. the version reply message)
you can also send vars to to the dll using the $dll (in mirc) but changing the _ for what you want to send, in the function you then use Parms as the value of the sent var.
////////////////////////////////////////////////
SkypeR That\\\\\\'s ME
----------------------------------------------
%49%66%20%79%6F%75%27%76%65%20%74%72%61%
6E%73%6C%61%74%65%64%20%
74%68%69%73%2C%20%79%6F%75%20%6D%75%73%
74%20%62%65%20%62% 6F%72%65%64%2E%2E%2E
[Redigeret d. 10/01-05 17:07:06 af SkypeR]