This project is read-only.

Request with String.length >= 256 chars

Mar 2, 2011 at 2:44 PM
Edited Mar 2, 2011 at 2:53 PM

Hi there,

I have downloaded the sources an wanted to raise maximal string size to 1024 chars so I changed the constant Ddeml.MAX_STRING_SIZE to 1024. I recompiled the NDde.dll and tried to use it.

I want to request a DDE server application to evaluate an expression (the server application is MapInfo). My request item is longer than 256 but shorter than 1024 chars.

    Private Shared Function RequestMapInfo(ByVal item As String) As String
        Dim res As String
        Using mDDEclient = New NDde.Client.DdeClient("MapInfo", "System")
            Try
                mDDEclient.Connect()
                res = mDDEclient.Request(item, 1000)
                Return res.Substring(0, res.Length - 1)
            Catch ex As Exception
                Return ""
            Finally
                If mDDEclient.IsConnected Then
                    mDDEclient.Disconnect()
                End If
            End Try
        End Using
    End Function

 

my call:

 

try
    result = RequestMapInfo(tpc, item)
catch ex as Exception
    ' if item.length > 256 an exception is thrown
end try

 

Strings shorter than 256 are working.

If I print out the same long request item in MapInfo application (print <myRequestItem>) it outputs my wanted result.

...or do anyone know where else the limitation of 256 characters is? Is there anyone who can help me?

edit: Sending an mDDEclient.Execute(...) with String.length>256 is working!

Thanks,

Jan