Solved

MSWINSCK.OCX in Delphi

Posted on 2000-03-27
4
925 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now