?
Solved

MSWINSCK.OCX in Delphi

Posted on 2000-03-27
4
Medium Priority
?
953 Views
Last Modified: 2012-08-13
I imported the file MSWINSCK.OCX in Delphi but how do I have to use it ?
I created a Server application in VB, but now i must create exactly the same one in Delphi. The Events and properties are all the same.
0
Comment
Question by:Stevenkumps
[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
  • 2
  • 2
4 Comments
 
LVL 2

Expert Comment

by:florisb
ID: 2660345
After imporing and registering there should be a component TWinSock on the samples page.

Don't just import; choose Component; Import ActiveX Control.

Use should be same as in VB.

Floris.
0
 

Author Comment

by:Stevenkumps
ID: 2660632
I've already done this, but the use is not exactly the same as in VB.
eg:
Winsock1.GetData(StrData, type, length).
These three variables are declared as OLEVariant. How do I have to use them ?
0
 
LVL 2

Accepted Solution

by:
florisb earned 150 total points
ID: 2673058
how to use olevariants?

var
strData: olevariant
//if doesn't work, try variant.
begin
strData := 'blabla';

as in:
procedure TOLEEditor.New(TemplateName: ShortString);
{ Pre         : Editor should be active and TemplateName should exist
  Input       : Templatename: Name of a known template witin Editor
  Returns     : Nothing
  Description : A new document is created based on the name template specified in
                the parameter. A pointer is now available to the new document,
                the variable is called ActiveDoc}
var
  Template, NewTemplate: OleVariant;
begin
if NOT(Active) then
  begin
  raise EOleError.Create(Name+WrdNotStarted);
  exit;
  end;

case Version of
  170:begin
      TemplateName := Chr(34)+TemplateName+Chr(34);
      FWord70.FileNew(TemplateName, 0);
      end;
  180:begin
      Template := TemplateName;
      NewTemplate := False;
      FWord80.Documents.Add(Template, NewTemplate);
      ActiveDoc := FWord80.ActiveDocument;
      end;
  290:begin
      if UpperCase(TemplateName) = 'NORMAL.DOT' then
        FWP90.FileNew
      else
//        FWP90.TemplateSelect(TemplateName);
        FWP90.FileOpen(TemplateName, 4);
      ActiveDoc := FWP90.envDocNumber;
      FWP90.Quit;
      end;
  end;
end;


Floris.


0
 

Author Comment

by:Stevenkumps
ID: 2678978
Thanx
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

765 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