Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

registry problem

Posted on 1998-08-03
15
Medium Priority
?
238 Views
Last Modified: 2010-04-04
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.
0
Comment
Question by:smile_tbw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
  • 3
15 Comments
 
LVL 3

Expert Comment

by:Matvey
ID: 1359573
Doesn't resrv32 works?
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1359574
Regsvr32.exe I mean...
0
 
LVL 4

Accepted Solution

by:
BoRiS earned 140 total points
ID: 1359575
smile_tbw

You need to register the ocx in the background for the app to work...maybe on the FormCreate procedure...

use the Regsrv32.exe file with winexec or shellexecute
the usage is like this...
   
regsvr32 [/u] [/s] <DLLname or OCXname>
                            /u - if you want to unregister COMponent
                            /s - no message (silent) //use this param for behind the scenes...

As far as I know there is no problem with winsock 2 and to register the ocx for that use the same command...
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:smile_tbw
ID: 1359576
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
0
 
LVL 4

Expert Comment

by:BoRiS
ID: 1359577
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
0
 

Author Comment

by:smile_tbw
ID: 1359578
yes....well but it don't work. Any suggestion?
0
 

Author Comment

by:smile_tbw
ID: 1359579
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.
0
 

Author Comment

by:smile_tbw
ID: 1359580
The error message popup is 'Unexpected Error' during the POP.Authenticate method. Any idea?
0
 

Author Comment

by:smile_tbw
ID: 1359581
sorry, it is not POP.Authenticate, it is during the SendDoc() method.
0
 
LVL 4

Expert Comment

by:BoRiS
ID: 1359582
smile_tbw

which meathod of senddoc are using http, ftp etc..

post the code snippet of the senddoc method and lets see...

Later
BoRiS
0
 

Author Comment

by:smile_tbw
ID: 1359583
here we go.......

function NoParam: Variant;
begin
  TVarData(Result).VType := varError;
  TVarData(Result).VError := DISP_E_PARAMNOTFOUND;
end;

procedure TForm1.SendTimerTimer(Sender: TObject);
begin
  SendTimer.Interval := DisableTimer;
  if (SMTP2.State = prcConnected)and(SMTP2.ProtocolState = smtpTransaction) then
  begin
mSend1.Lines.Add('Protocol state in sendtimer = '+IntToStr(SMTP2.ProtocolState));
    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(Sender: TObject; State: Smallint);
begin
  case State of
    prcConnecting:
      begin
        StatusBar7.SimpleText := 'Connecting to SMTP server: ' +
                                                         SMTP2.RemoteHost+'...';
        mSend1.Lines.Add(StatusBar7.SimpleText)
      end;
    prcResolvingHost:
      begin
        StatusBar7.SimpleText := 'Resolving Host';
        mSend1.Lines.Add(StatusBar7.SimpleText)
      end;
    prcHostResolved:
      begin
        StatusBar7.SimpleText := 'Host Resolved';
        mSend1.Lines.Add(StatusBar7.SimpleText)
      end;
    prcConnected:
      begin
        StatusBar7.SimpleText := 'Connected to SMTP server: ' +SMTP2.RemoteHost;
        mSend1.Lines.Add(StatusBar7.SimpleText);
      end;
    prcDisconnecting:
      begin
        StatusBar7.SimpleText := 'Disconnecting from SMTP server: ' +
                                                         SMTP2.RemoteHost+'...';
        mSend1.Lines.Add(StatusBar7.SimpleText)
      end;
    prcDisconnected:
      begin
        StatusBar7.SimpleText := 'Disconnected from SMTP server: ' +
                                                               SMTP2.RemoteHost;
        mSend1.Lines.Add(StatusBar7.SimpleText);
        if SendASAP.Checked then
          SendTimer.Interval := EnableTimer // enable Sending timer
        else
          SendTimer.Interval := (UDSendCycleMin.Position*60 +
                                                  UDSendCycleSec.Position)*1000;
        lEmailSentOn.Caption := 'Last Email Sent On ' +
                                                  DateTimeToStr(LatestSentStamp)
      end;
   end;
end;

procedure TForm1.SMTP2DocInput(Sender: TObject; const DocInput: DocInput);
begin
  case DocInput.State of
    icDocBegin:
      begin
        StatusBar7.SimpleText := 'Initiating document transfer';
        mSend1.Lines.Add(StatusBar7.SimpleText)
      end;
    icDocHeaders:
      begin
        StatusBar7.SimpleText := 'Sending headers';
        mSend1.Lines.Add(StatusBar7.SimpleText)
      end;
    icDocData:
      begin
        if DocInput.BytesTotal > 0 then
          StatusBar7.SimpleText := Format('Sending data: %d of %d bytes (%d%%)',
                  [Trunc(DocInput.BytesTransferred), Trunc(DocInput.BytesTotal),
                      Trunc(DocInput.BytesTransferred/DocInput.BytesTotal*100)])
        else
          StatusBar7.SimpleText := 'Sending...';
        mSend1.Lines.Add(StatusBar7.SimpleText)
      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.BytesTransferred)]);
        mSend1.Lines.Add(StatusBar7.SimpleText);
        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(ErrorStr)]));
  SMTP2.Cancel;
end;

procedure TForm1.SMTP2ProtocolStateChanged(Sender: TObject;
  ProtocolState: Smallint);
begin
  case ProtocolState of
  smtpTransaction:
    begin
      CreateHeaders;
      with SMTP2 do
        SendDoc(NoParam, DocInput.Headers, '', '', '');
    end;
  end;
end;

procedure TForm1.QuitSendTimer(Sender: TObject);
begin
  QuitSend.Interval := DisableTimer;
mSend1.Lines.Add('Protocol state = ' + IntToStr(SMTP2.Protocolstate));
  try
    SMTP2.Quit;
  except
    QuitSend.Interval := EnableTimer;
  end;
mSend1.Lines.Add('QuitSend out');  //************************************
end;

0
 
LVL 4

Expert Comment

by:BoRiS
ID: 1359584
smile_tbw

Is there a reason that the SendDoc() meathod is passed in the ...

procedure TForm1.SMTP2ProtocolStateChanged(Sender: TObject;
         ProtocolState: Smallint);

The SendDoc() meathod you have seems to need a filename example...

procedure TMainForm.SendFile(Filename: string);
begin
  CreateHeaders;
  with SMTP1 do
  begin
    DocInput.Filename := FileName;
    SendDoc(NoParam, DocInput.Headers, NoParam, DocInput.FileName, '');
  end;

Later
BoRiS
0
 

Author Comment

by:smile_tbw
ID: 1359585
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?
0
 
LVL 4

Expert Comment

by:BoRiS
ID: 1359586
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
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1359587
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.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question