BC30109_'String' is a class type and cannot be used as an expression.

  • Thread starter Thread starter Paulywog0667
  • Start date Start date
P

Paulywog0667

Guest
I haven't used cryptography much since a 2007 ISYS1005 Access VBA Lab. I am familiar with basic cryptography. I have two texts by Chapman and Bonde. We used some of each in lab. My old laptop went through a wet outlet and a basement flood. My two week cram class of an EHR was ruined. I understand concept of AES->HMAC->RSA etc., but want to get through both texts as refreshers and basically create web forms instead of succumbing to ASP, MVC, etc. Seems Chapman's text is a previous version of the Visual Basic IDE within Visual Studio 2019. I easily changed the While->Wend to While->End While, but seems the IDE is asking a function as a string with sNameBuffer = String(lNameLength, vbNullChar) . Any help would be appreciated.


Private Sub EnumCSPs()

Dim lResult As Long
Dim lIndex As Long
Dim sNameBuffer As String
Dim lNameLength As Long
Dim lProvType As Long

lIndex = 0
lblList.Text = ""

lResult = CryptEnumProviders(lIndex, 0, 0, lProvType, vbNullString, lNameLength)

sNameBuffer = String(lNameLength, vbNullChar) //BC30109 'String' is a class type and cannot be used as an expression.

While CBool(CryptEnumProviders(lIndex, 0, 0, lProvType, sNameBuffer,
lNameLength))
If (lIndex > 0) Then lblList.Text = lblList.Text + vbCrLf
lblList.Text = lblList.Text + sNameBuffer
lIndex = lIndex + 1
lResult = CryptEnumProviders(lIndex, 0, 0, lProvType, vbNullString, lNameLength)

sNameBuffer = String(lNameLength, vbNullChar)
End While

End Sub

Continue reading...
 
Back
Top