smile_tbw
asked on
registry problem
May i know how to register the ocx and dll used for the POP and SMTP component from Delphi 3 and NetManage ActiveX.
Are they (the component, POP and SMTP) work in winsock 2? If yes, may I know how to register them as well. thank you.
Are they (the component, POP and SMTP) work in winsock 2? If yes, may I know how to register them as well. thank you.
Doesn't resrv32 works?
Regsvr32.exe I mean...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I used the install shield provided by delphi 3.0 instalation CD. It should automatically register all the DLL and OCX, right?
I have included NMSCKN.DLL, NMOCOD.DLL, NMORENU.DLL, POPCT.OCX, SMTPCT.OCX and WINSCK.OCX. Is this correct? I have checked from the help file that only these files are neccessary but I will appreciate your help to indicate that any files are missing.
Thank you
I have included NMSCKN.DLL, NMOCOD.DLL, NMORENU.DLL, POPCT.OCX, SMTPCT.OCX and WINSCK.OCX. Is this correct? I have checked from the help file that only these files are neccessary but I will appreciate your help to indicate that any files are missing.
Thank you
smile_tbw
The install shield will handle the ocx's and dll's, and as far as I can see all the files you have listed are the ones you need...
Later
BoRiS
The install shield will handle the ocx's and dll's, and as far as I can see all the files you have listed are the ones you need...
Later
BoRiS
ASKER
yes....well but it don't work. Any suggestion?
ASKER
for your information, it run well in the computer with delphi 3 that i used. BUT after Winsock 2 (from Microsoft) installed, it will through some exception and not working at all. It seems that the dll and ocx is not well compatible with winsock 2.
ASKER
The error message popup is 'Unexpected Error' during the POP.Authenticate method. Any idea?
ASKER
sorry, it is not POP.Authenticate, it is during the SendDoc() method.
smile_tbw
which meathod of senddoc are using http, ftp etc..
post the code snippet of the senddoc method and lets see...
Later
BoRiS
which meathod of senddoc are using http, ftp etc..
post the code snippet of the senddoc method and lets see...
Later
BoRiS
ASKER
here we go.......
function NoParam: Variant;
begin
TVarData(Result).VType := varError;
TVarData(Result).VError := DISP_E_PARAMNOTFOUND;
end;
procedure TForm1.SendTimerTimer(Send er: TObject);
begin
SendTimer.Interval := DisableTimer;
if (SMTP2.State = prcConnected)and(SMTP2.Pro tocolState = smtpTransaction) then
begin
mSend1.Lines.Add('Protocol state in sendtimer = '+IntToStr(SMTP2.ProtocolS tate));
try
SMTP2.Quit;
except
SendTimer.Interval := EnableTimer;
end
end
else
if SMTP2.State = prcDisconnected then
begin
SMTPError := False;
SendCycle := SendCycle + 1;
Label28.Caption := 'Count = ' + IntToStr(SendCycle);
mSend1.Lines.Add('Count = ' + IntToStr(SendCycle));
SMTP2.Connect(NoParam, NoParam);
end;
end;
procedure TForm1.SMTP2StateChanged(S ender: TObject; State: Smallint);
begin
case State of
prcConnecting:
begin
StatusBar7.SimpleText := 'Connecting to SMTP server: ' +
SMTP2.RemoteHost+'...';
mSend1.Lines.Add(StatusBar 7.SimpleTe xt)
end;
prcResolvingHost:
begin
StatusBar7.SimpleText := 'Resolving Host';
mSend1.Lines.Add(StatusBar 7.SimpleTe xt)
end;
prcHostResolved:
begin
StatusBar7.SimpleText := 'Host Resolved';
mSend1.Lines.Add(StatusBar 7.SimpleTe xt)
end;
prcConnected:
begin
StatusBar7.SimpleText := 'Connected to SMTP server: ' +SMTP2.RemoteHost;
mSend1.Lines.Add(StatusBar 7.SimpleTe xt);
end;
prcDisconnecting:
begin
StatusBar7.SimpleText := 'Disconnecting from SMTP server: ' +
SMTP2.RemoteHost+'...';
mSend1.Lines.Add(StatusBar 7.SimpleTe xt)
end;
prcDisconnected:
begin
StatusBar7.SimpleText := 'Disconnected from SMTP server: ' +
SMTP2.RemoteHost;
mSend1.Lines.Add(StatusBar 7.SimpleTe xt);
if SendASAP.Checked then
SendTimer.Interval := EnableTimer // enable Sending timer
else
SendTimer.Interval := (UDSendCycleMin.Position*6 0 +
UDSendCycleSec.Position)*1 000;
lEmailSentOn.Caption := 'Last Email Sent On ' +
DateTimeToStr(LatestSentSt amp)
end;
end;
end;
procedure TForm1.SMTP2DocInput(Sende r: TObject; const DocInput: DocInput);
begin
case DocInput.State of
icDocBegin:
begin
StatusBar7.SimpleText := 'Initiating document transfer';
mSend1.Lines.Add(StatusBar 7.SimpleTe xt)
end;
icDocHeaders:
begin
StatusBar7.SimpleText := 'Sending headers';
mSend1.Lines.Add(StatusBar 7.SimpleTe xt)
end;
icDocData:
begin
if DocInput.BytesTotal > 0 then
StatusBar7.SimpleText := Format('Sending data: %d of %d bytes (%d%%)',
[Trunc(DocInput.BytesTrans ferred), Trunc(DocInput.BytesTotal) ,
Trunc(DocInput.BytesTransf erred/DocI nput.Bytes Total*100) ])
else
StatusBar7.SimpleText := 'Sending...';
mSend1.Lines.Add(StatusBar 7.SimpleTe xt)
end;
icDocEnd:
begin
if SMTPError then
StatusBar7.SimpleText := 'Transfer aborted'
else
StatusBar7.SimpleText := Format('Mail sent to %s (%d bytes data)',
[EmailA[CLogin, ElecAccountPos], Trunc(DocInput.BytesTransf erred)]);
mSend1.Lines.Add(StatusBar 7.SimpleTe xt);
QuitSend.Interval := EnableTimer;
end;
end;
StatusBar7.Update;
end;
procedure TForm1.SMTP2Error(Sender: TObject; Number: Smallint;
var Description: WideString; Scode: Integer; const Source,
HelpFile: WideString; HelpContext: Integer; var CancelDisplay: WordBool);
var
ErrorStr: string;
begin
SMTPError := True;
CancelDisplay := True;
{Get extended error information}
mSend1.Lines.Add(Format('% d - %s%s',[Number,Description, Trim(Error Str)]));
SMTP2.Cancel;
end;
procedure TForm1.SMTP2ProtocolStateC hanged(Sen der: TObject;
ProtocolState: Smallint);
begin
case ProtocolState of
smtpTransaction:
begin
CreateHeaders;
with SMTP2 do
SendDoc(NoParam, DocInput.Headers, '', '', '');
end;
end;
end;
procedure TForm1.QuitSendTimer(Sende r: TObject);
begin
QuitSend.Interval := DisableTimer;
mSend1.Lines.Add('Protocol state = ' + IntToStr(SMTP2.Protocolsta te));
try
SMTP2.Quit;
except
QuitSend.Interval := EnableTimer;
end;
mSend1.Lines.Add('QuitSend out'); //************************ ********** **
end;
function NoParam: Variant;
begin
TVarData(Result).VType := varError;
TVarData(Result).VError := DISP_E_PARAMNOTFOUND;
end;
procedure TForm1.SendTimerTimer(Send
begin
SendTimer.Interval := DisableTimer;
if (SMTP2.State = prcConnected)and(SMTP2.Pro
begin
mSend1.Lines.Add('Protocol
try
SMTP2.Quit;
except
SendTimer.Interval := EnableTimer;
end
end
else
if SMTP2.State = prcDisconnected then
begin
SMTPError := False;
SendCycle := SendCycle + 1;
Label28.Caption := 'Count = ' + IntToStr(SendCycle);
mSend1.Lines.Add('Count = ' + IntToStr(SendCycle));
SMTP2.Connect(NoParam, NoParam);
end;
end;
procedure TForm1.SMTP2StateChanged(S
begin
case State of
prcConnecting:
begin
StatusBar7.SimpleText := 'Connecting to SMTP server: ' +
SMTP2.RemoteHost+'...';
mSend1.Lines.Add(StatusBar
end;
prcResolvingHost:
begin
StatusBar7.SimpleText := 'Resolving Host';
mSend1.Lines.Add(StatusBar
end;
prcHostResolved:
begin
StatusBar7.SimpleText := 'Host Resolved';
mSend1.Lines.Add(StatusBar
end;
prcConnected:
begin
StatusBar7.SimpleText := 'Connected to SMTP server: ' +SMTP2.RemoteHost;
mSend1.Lines.Add(StatusBar
end;
prcDisconnecting:
begin
StatusBar7.SimpleText := 'Disconnecting from SMTP server: ' +
SMTP2.RemoteHost+'...';
mSend1.Lines.Add(StatusBar
end;
prcDisconnected:
begin
StatusBar7.SimpleText := 'Disconnected from SMTP server: ' +
SMTP2.RemoteHost;
mSend1.Lines.Add(StatusBar
if SendASAP.Checked then
SendTimer.Interval := EnableTimer // enable Sending timer
else
SendTimer.Interval := (UDSendCycleMin.Position*6
UDSendCycleSec.Position)*1
lEmailSentOn.Caption := 'Last Email Sent On ' +
DateTimeToStr(LatestSentSt
end;
end;
end;
procedure TForm1.SMTP2DocInput(Sende
begin
case DocInput.State of
icDocBegin:
begin
StatusBar7.SimpleText := 'Initiating document transfer';
mSend1.Lines.Add(StatusBar
end;
icDocHeaders:
begin
StatusBar7.SimpleText := 'Sending headers';
mSend1.Lines.Add(StatusBar
end;
icDocData:
begin
if DocInput.BytesTotal > 0 then
StatusBar7.SimpleText := Format('Sending data: %d of %d bytes (%d%%)',
[Trunc(DocInput.BytesTrans
Trunc(DocInput.BytesTransf
else
StatusBar7.SimpleText := 'Sending...';
mSend1.Lines.Add(StatusBar
end;
icDocEnd:
begin
if SMTPError then
StatusBar7.SimpleText := 'Transfer aborted'
else
StatusBar7.SimpleText := Format('Mail sent to %s (%d bytes data)',
[EmailA[CLogin, ElecAccountPos], Trunc(DocInput.BytesTransf
mSend1.Lines.Add(StatusBar
QuitSend.Interval := EnableTimer;
end;
end;
StatusBar7.Update;
end;
procedure TForm1.SMTP2Error(Sender: TObject; Number: Smallint;
var Description: WideString; Scode: Integer; const Source,
HelpFile: WideString; HelpContext: Integer; var CancelDisplay: WordBool);
var
ErrorStr: string;
begin
SMTPError := True;
CancelDisplay := True;
{Get extended error information}
mSend1.Lines.Add(Format('%
SMTP2.Cancel;
end;
procedure TForm1.SMTP2ProtocolStateC
ProtocolState: Smallint);
begin
case ProtocolState of
smtpTransaction:
begin
CreateHeaders;
with SMTP2 do
SendDoc(NoParam, DocInput.Headers, '', '', '');
end;
end;
end;
procedure TForm1.QuitSendTimer(Sende
begin
QuitSend.Interval := DisableTimer;
mSend1.Lines.Add('Protocol
try
SMTP2.Quit;
except
QuitSend.Interval := EnableTimer;
end;
mSend1.Lines.Add('QuitSend
end;
smile_tbw
Is there a reason that the SendDoc() meathod is passed in the ...
procedure TForm1.SMTP2ProtocolStateC hanged(Sen der: TObject;
ProtocolState: Smallint);
The SendDoc() meathod you have seems to need a filename example...
procedure TMainForm.SendFile(Filenam e: string);
begin
CreateHeaders;
with SMTP1 do
begin
DocInput.Filename := FileName;
SendDoc(NoParam, DocInput.Headers, NoParam, DocInput.FileName, '');
end;
Later
BoRiS
Is there a reason that the SendDoc() meathod is passed in the ...
procedure TForm1.SMTP2ProtocolStateC
ProtocolState: Smallint);
The SendDoc() meathod you have seems to need a filename example...
procedure TMainForm.SendFile(Filenam
begin
CreateHeaders;
with SMTP1 do
begin
DocInput.Filename := FileName;
SendDoc(NoParam, DocInput.Headers, NoParam, DocInput.FileName, '');
end;
Later
BoRiS
ASKER
but i have no attach file at all. so, do i need to pass a null pointer to the FileName or just DocInput.Filename := '' will do?
smile_tbw
If you aren't attachng a file the try this and see if it works
SendDoc(NoParam, DocInput.Headers, mSend1.Text, '', '');
Later
BoRiS
If you aren't attachng a file the try this and see if it works
SendDoc(NoParam, DocInput.Headers, mSend1.Text, '', '');
Later
BoRiS
See if lines in the setup script file (.ini, .inf, .ins...) include lines like "registerdll" or "registerOCX" I don't remember what exactly, but you'll see if you look at it. These lines work like regsvr32 when the installation runs.