Ok - after trying 1/2 the day yesterday and a bunch this morning I got it to work - so I will answer my own question in case someone finds it helpful in the future.
The issue appears that we need to initialize the member variables to the structure using the NEW keyword - not just the object itself. This requires a little more code in the creation of the object - but not a lot.
It's steeped in cryptic science (never used the "with" statement and curly brackets before), but it works. Perhaps someone else can suggest a better way - but here is the working version of my code sample from above:
-
Imports System.Text
-
---------------------------------------------------
-
Public Structure eMailMessageType
-
Public GoodMsg As StringBuilder
-
Public BadMsg As StringBuilder
-
End Structure
-
Friend Messages As New eMailMessageType With {.BadMsg = New StringBuilder(), .GoodMsg = New StringBuilder()}
-
-
Friend Function MakeMessage() As Boolean
-
-
Messages.GoodMsg.AppendLine("Some Good Messages")
-
Messages.BadMsg.AppendLine("Some Bad Messages")
-
-
'now I can do something useful with Messages...
-
-
Return True
-
-
End Function
-