어떻게 선언해서 써야하는건지요? 이런것도 모르냐고 하시지 마시고 꼬옥 가르쳐주세요
COM을 만들고 있는데 그 내용은 ASP에서 넘겨받은 값을 SOCKET으로 다른서버로 넘기려고 합니다.
---------------------------------------------------------------------------
unit Usendmsg2;
interface
uses
ComObj, ActiveX, Psendmsg2_TLB, StdVcl,ScktComp;
type
Tsendmsg2 = class(TAutoObject, Isendmsg2)
clients: TClientSocket;
protected
function Msendmsg2(const msg: WideString): WideString; safecall;
{ Protected declarations }
end;
implementation
uses ComServ;
function Tsendmsg2.Msendmsg2(const msg: WideString): WideString;
begin
clients.Address := '211.117.100.142';
clients.port := 80;
clients.Active := true;
clients.Socket.SendText(msg);
end;
initialization
TAutoObjectFactory.Create(ComServer, Tsendmsg2, Class_sendmsg2,
ciMultiInstance, tmApartment);
end.
----------------------------------------------------------------------------
이렇게 선언했는데 ASP에서 이 COM을 호출하면 치명적인 오류라고 뜨는군요 TT
제생각엔 Tclientsocket을 잘못선언한것같은데.. 부탁드립니다. 꾸벅~
function Tsendmsg2.Msendmsg2(const msg: WideString): WideString;
clients := TClientSocket.Create(selef);
with Clients do
begin
try
Address := '211.117.100.142';
port := 80; //80Port면 웹포트인데. ㅡ.ㅡ; 이것때문에 에러가 나는게 아닐까 하는.
Active := true;
Socket.SendText(msg);
//Result := ?;
finally
free;
end;
end;
회사에서 필요한게 있어서 한번 만든적이 있는데 잘 돌아갑니다...^^
그때는 인디를 사용했지만 별 차이는 없을듯...즐프하세여...
sizzling wrote:
> 어떻게 선언해서 써야하는건지요? 이런것도 모르냐고 하시지 마시고 꼬옥 가르쳐주세요
> COM을 만들고 있는데 그 내용은 ASP에서 넘겨받은 값을 SOCKET으로 다른서버로 넘기려고 합니다.
> ---------------------------------------------------------------------------
> unit Usendmsg2;
>
> interface
>
> uses
> ComObj, ActiveX, Psendmsg2_TLB, StdVcl,ScktComp;
>
> type
> Tsendmsg2 = class(TAutoObject, Isendmsg2)
> clients: TClientSocket;
>
>
>
> protected
> function Msendmsg2(const msg: WideString): WideString; safecall;
> { Protected declarations }
> end;
>
>
> implementation
>
> uses ComServ;
>
> function Tsendmsg2.Msendmsg2(const msg: WideString): WideString;
>
> begin
> clients.Address := '211.117.100.142';
> clients.port := 80;
> clients.Active := true;
> clients.Socket.SendText(msg);
>
> end;
>
> initialization
> TAutoObjectFactory.Create(ComServer, Tsendmsg2, Class_sendmsg2,
> ciMultiInstance, tmApartment);
> end.
> ----------------------------------------------------------------------------
> 이렇게 선언했는데 ASP에서 이 COM을 호출하면 치명적인 오류라고 뜨는군요 TT
> 제생각엔 Tclientsocket을 잘못선언한것같은데.. 부탁드립니다. 꾸벅~
>