Solved

MSWINSCK.OCX in Delphi

Posted on 2000-03-27
4
932 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
  • 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 50 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

786 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