Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Read string from handle
Message
From
25/10/2010 05:52:47
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
25/10/2010 05:39:53
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01486821
Message ID:
01486824
Views:
45
>>Hi all,
>>
>>so the days second riddle.
>>
>>I have a dll that returns a string in an handle.
>>
>>It gives me the handle as well as the len of the string.
>>
>>Simple question:
>>How do i get my string?
>>
>>TIA
>>
>>Agnes
>
>see sys(2600) first example
>
>There's another solution with api

Hm,

this returns garbage.

Is handler the same is pointer in this context?

even the C example does something with globallock etc

from the VB
        If bcRESULT2.pBC_TwoDimRes.hBC_TwoDimRes <> 0 Then
            h2DResult = 0
            h2DResult = GlobalLock(bcRESULT2.pBC_TwoDimRes.hBC_TwoDimRes)
            If h2DResult = 0 Then
                sResult = sResult + TXT_ERROR_RESULT_2DIM_NOACCESS + vbCrLf
            Else
                s2DResult = String(bcRESULT2.pBC_TwoDimRes.iBC_TwoDimLen + 1, Chr(0))
                Call CopyMemory(ByVal s2DResult, ByVal h2DResult, bcRESULT2.pBC_TwoDimRes.iBC_TwoDimLen)
                s2DResult = Left(s2DResult, bcRESULT2.pBC_TwoDimRes.iBC_TwoDimLen)
                sResult = sResult + qsTrim(s2DResult) + vbCrLf
                bcData = qsTrim(s2DResult)
                GlobalUnlock (h2DResult)
            End If
            GlobalFree (bcRESULT2.pBC_TwoDimRes.hBC_TwoDimRes)
            bcRESULT2.pBC_TwoDimRes.hBC_TwoDimRes = 0
        Else
....
        End If
Agnes

Update,

ah, I ifound the declaration. I will give it a try.
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform