<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>25 Mar 2020 08:56:51 Z</lastBuildDate><pubDate>18 Feb 2015 10:44:10 Z</pubDate><description>Since there is a new version of the Belgian EID, it is more difficult to read the EID.&#13;
I have found the VB.Net code and wanted to convert it to Windev code.&#13;
&#13;
When I try to run the procedure he gives an error.&#13;
&#13;
Original VB Code&#13;
[code:wl]&#13;
   Public Function GetData(ByVal label As String)&#13;
        Dim m As Net.Sf.Pkcs11.Module = Nothing&#13;
        Dim valueb As Byte()&#13;
        Dim value As String = ""&#13;
        Dim labelchar As String = ""&#13;
&#13;
        Dim mFileName As String = "beidpkcs11.dll"&#13;
        Dim slotlist() As Net.Sf.Pkcs11.Slot&#13;
&#13;
        Try&#13;
&#13;
            m = Net.Sf.Pkcs11.Module.GetInstance(mFileName)&#13;
&#13;
            slotlist = m.GetSlotList(True)&#13;
            If (slotlist.Length &gt; 0) Then&#13;
                Dim session As Net.Sf.Pkcs11.Session&#13;
                Dim slot As Net.Sf.Pkcs11.Slot&#13;
                slot = slotlist(0)&#13;
                session = slot.Token.OpenSession(True)&#13;
                Dim classAttribute As New ByteArrayAttribute(Net.Sf.Pkcs11.Wrapper.CKO.DATA)&#13;
                classAttribute.Value = BitConverter.GetBytes(Convert.ToUInt32(Net.Sf.Pkcs11.Wrapper.CKO.DATA))&#13;
                Dim labelAttribute As New ByteArrayAttribute(Net.Sf.Pkcs11.Wrapper.CKA.LABEL)&#13;
                labelAttribute.Value = System.Text.Encoding.UTF8.GetBytes(label)&#13;
                Dim p11a() As P11Attribute = {classAttribute, labelAttribute}&#13;
                session.FindObjectsInit(p11a)&#13;
                Dim foundObjects() As P11Object = session.FindObjects(50)&#13;
&#13;
                Dim counter As Integer = foundObjects.Length&#13;
                Dim data As New Data&#13;
                While (counter &gt; 0)&#13;
&#13;
&#13;
                    data = foundObjects(counter - 1)&#13;
                    If Not data.Label.Value = Nothing Then&#13;
                        If Not label = "PHOTO_FILE" Then&#13;
                            value = System.Text.Encoding.UTF8.GetString(data.Value.Value)&#13;
                        Else&#13;
                            valueb = data.Value.Value&#13;
                        End If&#13;
                        System.Diagnostics.Trace.WriteLine("mijne label: " + value)&#13;
                    End If&#13;
                        counter = counter - 1&#13;
                End While&#13;
                If Not label = "PHOTO_FILE" Then&#13;
                    Return value&#13;
                Else&#13;
                    Return valueb&#13;
                End If&#13;
                session.FindObjectsFinal()&#13;
            Else&#13;
                'MsgBox("no card found")&#13;
                Return "nocard"&#13;
            End If&#13;
&#13;
        Catch ex As Exception&#13;
            MsgBox(ex.Message)&#13;
        Finally&#13;
            m.Dispose()&#13;
        End Try&#13;
    End Function&#13;
[/code]&#13;
&#13;
Translated to WINDEV&#13;
&#13;
[code:wl]&#13;
PROCEDURE GetData(label)&#13;
&#13;
m is "Net.Sf.Pkcs11.Module" dynamic&#13;
valueb is array of byte&#13;
value is string = ""&#13;
sLabelchar is string = ""&#13;
&#13;
mFileName is string = "beidpkcs11.dll"&#13;
slotlist is array of Net.Sf.Pkcs11.Slot()&#13;
 &#13;
m = new "Net.Sf.Pkcs11.Module.GetInstance"(mFileName)  *** ERROR IN EXECUTION AT THIS LINE ***&#13;
&#13;
slotlist = m.GetSlotList(True)&#13;
IF ArrayCount(slotlist) &gt; 0 THEN&#13;
       session is "Net.Sf.Pkcs11.Session" dynamic&#13;
       slot is "Net.Sf.Pkcs11.Slot" dynamic&#13;
       slot = slotlist[0]&#13;
       session = slot.Token.OpenSession(True)&#13;
&#13;
       classAttribute is ByteArrayAttribute(Net.Sf.Pkcs11.Wrapper.CKO.DATA) dynamic&#13;
       classAttribute.Value = BitConverter.GetBytes(Convert.ToUInt32("Net.Sf.Pkcs11.Wrapper.CKO.DATA"))&#13;
       labelattribute is ByteArrayAttribute(Net.Sf.Pkcs11.Wrapper.CKA.LABEL) dynamic&#13;
       labelattribute.Value = System.Text.Encoding.UTF8.GetBytes(label)&#13;
&#13;
       p11a is array of P11Attribute(classAttribute,labelattribute)&#13;
       session.FindObjectsInit(p11a)&#13;
       Foundobjects is array of P11Object&#13;
       Foundobjects = session.FindObjects(50)&#13;
       Counter is int = ArrayCount(Foundobjects)&#13;
       objdata is Net.Sf.Pkcs11.objects.Data dynamic&#13;
&#13;
       WHILE Counter &gt; 0 &#13;
             objdata = Foundobjects[Counter-1]&#13;
             IF NOT objdata.Label.Value = Null THEN&#13;
                    IF NOT label = "PHOTO_FILE" THEN&#13;
                           value = System.Text.Encoding.UTF8.GetString(objdata.Value.Value)&#13;
                    ELSE&#13;
                           valueb = objdata.Value.Value&#13;
                    END&#13;
             END&#13;
             Counter--&#13;
       END&#13;
&#13;
       session.FindObjectsFinal()&#13;
&#13;
       IF NOT label = "PHOTO_FILE" THEN&#13;
             m.Dispose()&#13;
             RESULT value&#13;
       ELSE&#13;
             m.Dispose()&#13;
             RESULT valueb&#13;
       END&#13;
ELSE&#13;
       m.Dispose()&#13;
       RESULT "nocard"&#13;
END&#13;
&#13;
[/code]&#13;
&#13;
&#13;
While running the procedure he gives an error on this line of code :&#13;
&#13;
m = new "Net.Sf.Pkcs11.Module.GetInstance"(mFileName)&#13;
&#13;
ERROR CODE 0: Level: no error&#13;
&#13;
Does someone has any ideas on how to solve this ?</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/50527-wd19-reading-new-belgian-eid-march-2014-conversion/read.awp</link><title>(WD19) : Reading New Belgian EID March  2014 : Conversion VB.Net to Windev</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>mike.vanlierde</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/50527-wd19-reading-new-belgian-eid-march-2014-conversion-67714/read.awp</comments><pubDate>25 Mar 2020 08:56:51 Z</pubDate><description>Managed to solve this error? I'm looking for a way to read the eid aswell.</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/50527-wd19-reading-new-belgian-eid-march-2014-conversion-67714/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/50527-wd19-reading-new-belgian-eid-march-2014-conversion-67714/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/50527-wd19-reading-new-belgian-eid-march-2014-conversion/read.awp">(WD19) : Reading New Belgian EID March  2014 : Conversion VB.Net to Windev</source><title>Re: (WD19) : Reading New Belgian EID March  2014 : Conversion VB.Net to Windev</title></item><item><author>mike.vanlierde</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/50527-wd19-reading-new-belgian-eid-march-2014-conversion-67713/read.awp</comments><pubDate>25 Mar 2020 08:56:20 Z</pubDate><description>Managed to solve this error? I'm looking for a way to read the eid aswell.</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/50527-wd19-reading-new-belgian-eid-march-2014-conversion-67713/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/50527-wd19-reading-new-belgian-eid-march-2014-conversion-67713/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/50527-wd19-reading-new-belgian-eid-march-2014-conversion/read.awp">(WD19) : Reading New Belgian EID March  2014 : Conversion VB.Net to Windev</source><title>Re: (WD19) : Reading New Belgian EID March  2014 : Conversion VB.Net to Windev</title></item></channel></rss>
