This method retrieves a list of ports

[Visual Basic]   [ Long = ]imagekitcontrolname.PrintDraw.EnumPorts(PortNames As String)
[Visual C++]     [ long = ]imagekitcontrolname.GetPrintDraw().EnumPorts(BSTR *PortNames)

Parameters

Name Explanation
PortNames A string containing the retrieved port names

Return Value

The number of retrieved ports

Explanation

The EnumPorts method retrieves a list of ports. If the return value is 1 or more, then list of retrieved port names will be set in the PortNames parameter.

The PortNames string will be returned as "xxxxx,xxxxx,xxxxx,¥¥¥¥¥¥¥¥," (delimited by commas and ends with a comma).

For scripting languages and other programs that require variant types, please refer to the EnumPortsVariant method.

Note: In VB.NET and C#.NET, you cannot retrieve the string for PortNames. Use InvokeMembers instead. For details, please see the code example below.

 

Visual Basic.NET

    Dim t As Type = Type.GetTypeFromProgID("ImageKit8.PrintDraw")

    Dim p As New System.Reflection.ParameterModifier(1)

    p(0) = True

    Dim mods() As System.Reflection.ParameterModifier = {p}

    Dim args() As Object = {""}

    Dim Size As Long = CType(t.InvokeMember("EnumPorts", System.Reflection.BindingFlags.InvokeMethod, Nothing, ImageKit1.PrintDraw, args, mods, Nothing, Nothing), Integer)

    If Size < 1 Then Exit Sub

    Dim Ports As String = CType(args(0), String)

    ' various programming code

    ..........

 

Visual C#.NET

    Type t = Type.GetTypeFromProgID("ImageKit8.PrintDraw");

    System.Reflection.ParameterModifier p = new System.Reflection.ParameterModifier(1);

    p[0] = true;

    System.Reflection.ParameterModifier[] mods = {p};

    object[] args = { "" };

    int Size = (int)t.InvokeMember("EnumPorts", System.Reflection.BindingFlags.InvokeMethod, null, ImageKit1.PrintDraw, args, mods, null, null);

    if (Size < 1) return;

    string Ports = (string)args[0];

    // various programming code

    ..........

The ImageKit8 ActiveX is a product created by Newtone Corporation