Solved

MSWINSCK.OCX in Delphi

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

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 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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

737 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