Ok,  further to my previous problems with connecting to the net via a COM
Component.

I thought that I would create the COM Control in a small delphi app and see
if it sends the info to the debug control. But I encountered another
problem.

This is the create routine for the COM Control from the TYPE library that I
got from Project-Import Type Library.

class function CoAdrockDialInternet.Create: IAdrockDialInternet;
begin
  Result := CreateComObject(CLASS_AdrockDialInternet) as
IAdrockDialInternet;
end;

Now if I click a button on my form which has the following code, the create
occurs normally, but when I call the   DisConnectFromTheInternet method I
get a message "Catastropic Failure"

procedure TForm1.Button1Click(Sender: TObject);
Var
   DialInternet : AdrockDialInternet;
begin
  OLEInitialize(NIL);
  DialInternet  :=  CoAdrockDialInternet.Create;
  DialInternet.DisConnectFromTheInternet; { <--- Catastropic Failure }
  OLEUnInitialize;
end;

Not sure if I need the OLEInitialize(NIL) and the OLEUninitialize; but it
causes the error if they are there or not.

Does anyone know or have any ideas what would be the problem?

The Disconnect method uses this code from the COM Component

procedure TAdrockDialInternet.DisConnectFromTheInternet;
Var
  Status : Integer;
begin
  Status := WinExec('f:\componen\rascmp\RasSpeakDemo1.exe DISCONNECT',
SW_HIDE);
  m_scriptContext.Response.Write('<P><P>'+FormatDateTime('HH:MM:SS', Now)+',
Status returned from WINEXEC - '+IntTostr(Status)+'</P><P>');
end;

If I create it on a web page it is fine, well it doesn't cause an
"Catastropic Failure" message.

<%
  Dim myObject
  set myObject =
Server.CreateObject("AdrockInternetProject.AdrockDialInternet")
  myObject.Connection = "I Hug"
  myObject.DisConnectFromTheInternet
%>

Chris

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to