[API]
LoadStringA
LoadStringW

[INCLUDE]
GenericInit
PeekS

[CODE]
Public Function LoadResEx_String(ByVal ResID As Long) As String
  Dim xLong1 As Long

  If IsUnicode Then
    #If LoadResEx_LanguageFile then
      xLong1 = LoadStringW(LoadResEx_LanguageFile_hModul, ResID, ptrTemp, ptrTempSizeXW)
      #Else
      xLong1 = LoadStringW(App.hInstance, ResID, ptrTemp, ptrTempSizeXW)
      #End If
    Else
    #If LoadResEx_LanguageFile Then
      xLong1 = LoadStringA(LoadResEx_LanguageFile_hModul, ResID, ptrTemp, ptrTempSizeX)
      #Else
      xLong1 = LoadStringA(App.hInstance, ResID, ptrTemp, ptrTempSizeX)
      #End If
    End If
  If xLong1 = 0& Then
    #If InIDE Then
      On Error GoTo Er1
      LoadResEx_String = LoadResString(ResID)
Rs1:
      On Error GoTo 0
      Exit Function
Er1:
      LoadResEx_String = "#" + CStr(ResID)
      Resume Rs1
      #Else
      LoadResEx_String = "#" + CStr(ResID)
      #End If
    Else
    LoadResEx_String = PeekS(ptrTemp, xLong1)
    End If
  End Function