Can't get lineTranslateAddress() to populate UDT - PLEASE HELP



I've cut this down to the utmost basic by entering the parameter values
directly into the lineTranslateAddress() function. It returns
TAPI_SUCCESS - zero. But only populates 4 of the values in the UDT.

This is the last thing I need to get working to finish my project. I've
studied everything I can get my hands on and don't understand why this isn't
working. I can make it work with the same values with TAPI Browser

Private Declare Function lineTranslateAddress Lib "tapi32.dll" _
(ByVal hLineApp As Long, _
ByVal dwDeviceID As Long, _
ByVal dwAPIVersion As Long, _
ByVal lpszAddressin As String, _
ByVal dwCard As Long, _
ByVal dwTranslateOptions As Long, _
ByRef lpTranslateOutput As TRANSLATEOUTPUT) As Long

Private Type TRANSLATEOUTPUT
dwTotalSize As Long
dwNeededSize As Long
dwUsedSize As Long
dwDialableStringSize As Long
dwDialableStringOffset As Long
dwDisplayableStringSize As Long
dwDisplayableStringOffset As Long
dwCurrentCountry As Long
dwDestCountry As Long
dwTranslateResults As Long
End Type

Dim RetVal As Long, tlo As TRANSLATEOUTPUT
tlo.dwTotalSize = Len(tlo)
RetVal = lineTranslateAddress(&H0, &H0, &H20002, "+1 (813) 5551212", &H0,
&H0, tlo)

The above line returns TAPI_SUCCESS but only populates 4 additional
values in the UDT.

dwCurrentCountry = 1
dwDestCountry = 1
dwDialableStringOffset = 0
dwDialableStringSize = 0
dwDisplayableStringOffset = 0
dwDisplayableStringSize = 0
dwNeededSize = 79
dwTotalSize = 40
dwTranslateResults = 0
dwUsedSize = 40

I've spent countless hours on this. It just won't work. Putting the same
values into TAPI Browser 2.0 (with the exception of the UDT pointer) works.
Heck they're all zeros except for the number string and the UDT pointer.
The pointer value of my UDT is: VarPtr(tlo)= 1297588. But it does not
return an Invalid Pointer Error and 4 more values in the UDT DO populate so
this pointer has to be correct, right?. There's nothing else I know of to
change.
Is there any way to help me fix this problem? I'd REALLY appreciate any
help anyone can offer.
Thanks very much.
Rick


.



Relevant Pages

  • Re: Cant get lineTranslateAddress() to populate UDT - PLEASE HELP
    ... But only populates 4 of the values in the UDT. ... I can make it work with the same values with TAPI Browser ... Heck they're all zeros except for the number string and the UDT pointer. ...
    (microsoft.public.win32.programmer.tapi)
  • Re: Cant get lineTranslateAddress() to populate UDT - PLEASE HELP
    ... But only populates 4 of the values in the UDT. ... ByRef lpTranslateOutput As TRANSLATEOUTPUT) As Long ... dwDisplayableStringSize As Long ... Heck they're all zeros except for the number string and the UDT pointer. ...
    (microsoft.public.win32.programmer.tapi)
  • Re: Mass delete files and directories
    ... of the pointer lpszProgressTitle are for some reason being ... I've only tried it out on a few Vista machines, and they very definitely do not store a pointer unless you have at some stage assigned a string value or an empty string. ... If you create a variable of a UDT and if that UDT contains a standard variable length string then VB will leave the four "string pointer" bytes filled with zeros unless you assign something to the string, or unless you have previously done so and it is not a "fresh copy". ... Even if those bytes contain a valid pointer to a string they will cause a serious problem, because the pointer in the UDT data which VB passes to the SHFileOperation function is not in the place where SHFileOperation expects it to be, and is in fact offset by two bytes because of the "Integer padding" I mentioned. ...
    (microsoft.public.vb.general.discussion)
  • Re: SendMessage crashing
    ... I am writing ... >Couldn't you pass the pointer of your UDT to the other program and read the ... marshalling shared data cross-process including... ...
    (microsoft.public.vb.winapi)
  • Re: SymGetTypeInfo and TI_GET_DATAKIND
    ... > I succeed to manage base type, pointer, array and UDT. ... I don't know how to determine if a pointer is constant, ... pointers (it uses DbgHelp as its symbol engine), while VC debugger can. ... > DataIsConstant ...
    (microsoft.public.vsnet.debugging)