×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    2

    Visual basic and Picture messaging

    Hei

    I have a litle problem i hope some can help me with.
    I am doing a program to send out a Picture message, and ind that case i need to convert the binaery streng i get from my BMP-file to and HEX that i need, for sending out the picture message.

    But the bin-string i get is 2014 long, and when i try do to 2^2014 ind Visual Bacis, it comes with and overflow.

    Can someone please help me here.

    This is code i use:
    Function fncBinToHex(strBin As String) As String
    Dim intI As Variant
    Dim lngTemp As Variant
    lngTemp = 0
    For intI = 1 To Len(strBin)
    If Mid(strBin, intI, 1) = "1" Then lngTemp = lngTemp + 2 ^ (Len(strBin) - intI)
    Next intI
    fncBinToHex = Hex(lngTemp)
    End Function

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Tampere / Finland
    Posts
    1,839

    RE: Visual basic and Picture messaging

    Hi!

    As the question is purely VB related, you should post is to some programming forum to get the fastest possible answer.

    Teemu / Forum Nokia

  3. #3
    Registered User
    Join Date
    May 2003
    Posts
    10
    why use variant? and why are you using 2 ^ len(strbin).. that's huge???

    Maybe i'm just lost on what your trying to do but to convert to hex from bin it should be done in 8 bit segments and not the whole string.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×