Asi es como me va quedando la DLL. Por favor que alguien me la revise a ver que error le encuentra.
Código Delphi
[-]
library XMPPCore;
uses
SysUtils, Classes, xmldom, XMLIntf, msxmldom, XMLDoc, XMPP_Res;
{$R *.res}
function xmpp_initialization(pTo: PChar): PChar; stdcall;
begin
xmpp_res_Initialization;
Result := PChar(Format(xmpp_res_initialization, [pTo]));
end;
function xmpp_login(pUserName, pPassword, pResource: PChar): PChar; stdcall;
var
cXMLDoc: TXMLDocument;
begin
cXMLDoc := TXMLDocument.Create(nil);
try
cXMLDoc.XML.Text := xmpp_res_login;
cXMLDoc.Active := True;
cXMLDoc.DocumentElement.ChildNodes['query'].ChildNodes['username'].Text := pUserName;
cXMLDoc.DocumentElement.ChildNodes['query'].ChildNodes['password'].Text := pPassword;
cXMLDoc.DocumentElement.ChildNodes['query'].ChildNodes['resource'].Text := pResource;
Result := PChar(cXMLDoc.XML.Text);
finally
cXMLDoc.Free;
end;
end;
function xmpp_presence(pType, pMsg, pShow: PChar): PChar; stdcall;
var
cXMLDoc: TXMLDocument;
vStrUtils: String;
begin
cXMLDoc := TXMLDocument.Create(nil);
try
cXMLDoc.XML.Text := xmpp_res_presence;
cXMLDoc.Active := True;
vStrUtils := pType;
if pMsg <> '' then
cXMLDoc.DocumentElement.SetAttributeNS('type', '', vStrUtils)
else
cXMLDoc.DocumentElement.SetAttributeNS('type', '', 'avaliable');
if pMsg <> '' then
cXMLDoc.DocumentElement.ChildNodes['status'].Text := pMsg;
if pShow <> '' then
cXMLDoc.DocumentElement.ChildNodes['show'].Text := pShow;
Result := PChar(cXMLDoc.XML.Text);
finally
cXMLDoc.Free;
end;
end;
exports
xmpp_initialization, xmpp_login, xmpp_presence;
begin
end.