From: John B. <joh...@ho...> - 2004-12-20 23:10:10
|
I don't know exactly where you went wrong, but your code can be simplified substantially. The byte array is not necessary. You only need to make sure that your string is big enough to accommodate whatever the function might return. The following code works: Private Sub cmdEnter_Click() Dim Str As String, L As Long ' Get input text Str = Me.txtIn.Text ' Call the function in the MinGW DLL L = cvtup(Str) ' Display output Me.txtOut.Locked = False Me.txtOut.Text = Str Me.txtOut.Locked = True End Sub I think you would need a byte array only if your DLL string function had Unicode string parameters. Also, for what it it is worth, you do not need to set .Locked = False to update the text control. .Locked = True prevents the user from typing in the text box, but your program can still update the text box. |