Delegate and simple string not allowed?

I’m calling a method like this:

SetUpForConnection AddressOf ResultReceived

ResultReceived is a method with one parameter: Data As String

In another class, I have a delegate: DlgReply(Message As String) and a property PDlgReply as DlgReply

And this is SetUpForConnection:
SetUpForConnection(Feedback as ptr)
Obj=new MyClass
//some hidden lines
Obj.PDlgReply=new MyClass.DlgReply(Feedback)
End Sub

When I compile, I get this error:
ModSearch.CSearch.SetUpForConnection, line 10
External functions cannot use ordinary strings as parameters. Use CString, PString, WString, or CFStringRef instead.
Obj.PDlgReply=new MyClass.DlgReply(Feedback)

I fairly know pointers can be used for declares, but, in my case, it stays an internal method, so I really want to pass a string (not a PString or a CString).
If I change my definition of the delegate to CString instead (for testing), I don’t get a compile error, but the app crashes when the delegate is invoked.

I’m overlooking something?

Should be

SetUpForConnection(Feedback as MyClass.DlgReply)

1 Like

Oh yes. I often confuse pointers and delegates.
Thank you.