Hi Joel,
 
have you tried to add a Null Char at the end of the string. I had a similar problem regarding vb and dde. Everything worked well inside the vb(x( world, but if i got further i got strange string results. I guess it's because of the internal string representation in VB.
 
Try something like: str = str & chr(0)
 
Regards
 
Andreas Gahr

-----Ursprüngliche Nachricht-----
Von: Joel WU [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 3. August 2004 08:25
An: [EMAIL PROTECTED]
Betreff: [Axapta-Knowledge-Village] ActiveX DLL problem in Axapta 2.5

Hi everyone:

 

I have a function that I have put in to an ActiveX DLL written using VB. I have to write this function because I am using Axapta 2.5 it doesn’t support ASCW and CHRW function in Axapta. So I put it in a report to manipulate my string and return a string to me.

 

Public Function Code128B(ByVal OrigStr As String) As String

    Dim CheckSum As Long

    Dim CharStr() As Long

.

.

.

.                    Some logic here

.

.

   ReDim Preserve CharStr(0 To UBound(CharStr) + 1)

    CharStr(UBound(CharStr)) = XXXX

   

    Code128B = ""

    For i = 1 To UBound(CharStr)

        Code128B = Code128B & ChrW(CharStr(i))

        Debug.Print CharStr(i)

    Next i

   

End Function

 

It work fine and tested in VB, VBA etc….

And now I put it into Axapta and it also work fine when I just call it once. But when I try to call it multiple time in the report, it shown some strange result of the string it return.

 

Anyone know what is going on.

Regards,

Joel



Sharing the knowledge on Axapta.




Sharing the knowledge on Axapta.


Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to