Unicode to non unicode conversion problem
--------------------------------------------------------------------------------
Hi All,
I am using C dll in macro which converts Unicode data to 8 bit encoding data
[code=vb]
' Prototype of C function.
' extern "C" int _stdcall Uni2Eni(wchar_t * uni, unsigned char * eni, int size)
'Here is the function where creating alias of C function using C dll(capi.dll)
' ByVal Uni As String ( Its a Unicode string)
' ByVal eni As String ( its a Non Unicode string)
Declare Function UNI2Eni Lib "capi.dll" Alias " Uni2Eni " ( ByVal Uni As String, ByVal eni As String, ByVal iSize As Integer) As Integer
Sub Test
Dim iRet as integer
Dim sEni as String
iRet = UNI2Eni(“佅”,sEn i,40)
End Sub
[/code]
On calling this function it return iRet =1 which shows conversion has been successful but the value returned in sEni is showing blank .
Is it the problem with data type or something else?
Please anyone can help me?.
I have used the same dll in open office macro .its gives right output in open office. So there is no question of wrong dll.
--------------------------------------------------------------------------------
Hi All,
I am using C dll in macro which converts Unicode data to 8 bit encoding data
[code=vb]
' Prototype of C function.
' extern "C" int _stdcall Uni2Eni(wchar_t * uni, unsigned char * eni, int size)
'Here is the function where creating alias of C function using C dll(capi.dll)
' ByVal Uni As String ( Its a Unicode string)
' ByVal eni As String ( its a Non Unicode string)
Declare Function UNI2Eni Lib "capi.dll" Alias " Uni2Eni " ( ByVal Uni As String, ByVal eni As String, ByVal iSize As Integer) As Integer
Sub Test
Dim iRet as integer
Dim sEni as String
iRet = UNI2Eni(“佅”,sEn i,40)
End Sub
[/code]
On calling this function it return iRet =1 which shows conversion has been successful but the value returned in sEni is showing blank .
Is it the problem with data type or something else?
Please anyone can help me?.
I have used the same dll in open office macro .its gives right output in open office. So there is no question of wrong dll.