• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 972
  • Last Modified:

MSWINSCK.OCX in Delphi

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
Stevenkumps
Asked:
Stevenkumps
  • 2
  • 2
1 Solution
 
florisbCommented:
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
 
StevenkumpsAuthor Commented:
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
 
florisbCommented:
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
 
StevenkumpsAuthor Commented:
Thanx
0

Featured Post

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.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now