I am trying to display a message on an LED screen. The SDK for the screen has a DLL that handles on the communications. Which is nice, less programming for me. But the call to the DLL that sends a message has the data structure below as one of the parameters of the call.
Type User_FontSet
strFontName As String
iFontSize As Long
bFontBold As Long
bFontItaic As Long
bFontUnderline As Long
colorFont As Long
iAlignStyle As Long
iVAlignerStyle As Long
iRowSpace As Long
End Type
This is the DLL call:
Public Declare Function User_RealtimeSendText Lib “EQ2008_Dll.dll” (ByVal CardNum As Long, ByVal x As Long, ByVal y As Long, ByVal iWidth As Long, ByVal iHeight As Long, ByVal strText As String, ByRef pFontInfo As User_FontSet) As Boolean
I’ve tried to create a memory block using the following code, but it just crashes when I run it:
Dim fontName as String
Dim Offset As Integer
fontName = “@Arial Unicode MS”
Dim mbUserFontSet as New MemoryBlock((Len(fontName)*2)+2)
mbUserFontSet.WString(0)=fontName
Offset = mbUserFontSet.size
mbUserFontSet.Size=Offset+36
mbUserFontSet.Long(Offset+4)=12 'size
mbUserFontSet.Long(Offset+8)=0 'bold
mbUserFontSet.Long(Offset+12)=0 'italic
mbUserFontSet.Long(Offset+16)=0 'underline
mbUserFontSet.Long(Offset+20)=0 'color
mbUserFontSet.Long(Offset+24)=0 'style
mbUserFontSet.Long(Offset+28)=0 'alignment
mbUserFontSet.Long(Offset+32)=1 'row spacing
If app.User_RealtimeSendText(1,0,0,224,32,“Hello”,mbUserFontSet) Then 'call the DLL with the message
MsgBox(“Message Sent”)
Else
MsgBox(“Unable to send message”)
End If
Any suggestions on how to proceed?