I have this code that works in VB for converting an html colour string into a visual basic colour. How can I do the same thing in C??????

Keep in mind that RGB does not work in C so I would need an equivalent function for this also.

VB Code:
  1. 'Convert a colour represented in html colour format,
  2. 'to a long value recognizable by visual basic
  3. Function HTMLToLong(sHTML As String) As Long
  4.     Dim lR As Long, lB As Long, lG As Long
  5.  
  6.     lR = CInt(Val("&h" + Mid(sHTML, 2, 2)))
  7.     lG = CInt(Val("&h" + Mid(sHTML, 4, 2)))
  8.     lB = CInt(Val("&h" + Mid(sHTML, 6, 2)))
  9.  
  10.     HTMLToLong = RGB(lR, lG, lB)
  11. End Function