0

How can I use this code:

VB6.LoadResString(i)

without getting this warning:

Public Function LoadResString(ID As Integer) As String is obsolete: 
'Microsoft.VisualBasic.Compatibility.* classes are obsolete and supported 
within 32 bit processes only. http://go.microsoft.com/fwlink/?linkid=160862'.   

The posted link in the error and other info in the MSDN site only say to me "ehy, this is obsolete in your framework, don't use it", but what if I need it (Loads a string from a resource (.res) file.)?

How can I write it without getting that warning message?

UPDATE: Thanks, but nothing worked...

Piero Alberto
  • 3,823
  • 6
  • 56
  • 108
  • 2
    It doesn't actually load a string from a .res file so pretty unlikely that your assumption that you need it is accurate. Use Project + Properties, Resources instead. – Hans Passant Mar 24 '15 at 09:54
  • In VB6 `LoadResString` [does](https://msdn.microsoft.com/en-us/library/aa244131(v=vs.60).aspx) load a string from the project resources. The best way to do this in VB.Net is to use the .Net resources as Hans says. If you are copying/migrating VB6 code you will also need to get the strings from the VB6 resources e.g. using the VB6 IDE – MarkJ Mar 25 '15 at 13:21

0 Answers0