Michael Kaden
Guest
|
Hello
we have our own string resource files for example XDeutsch.resx, generated with Resgen.
we then add the resx files with "Add Existing Item" to a Folder in the projects root. (not in the XLL or ComAddIn module)
We then try to retrieve entries from the resx file with a function:
Public Class Functions01
Public Function Testalera() As String
On Error GoTo Errorhandler
Dim ResM As Resources.ResourceManager
Dim Resourcename As String = "XDeutsch.resx"
Dim key As String = "X00010"
ResM = New Resources.ResourceManager(Resourcename, System.Reflection.Assembly.GetExecutingAssembly)
Testalera = ResM.GetObject(key)
Exit Function
Errorhandler:
MsgBox("Error Testalera " & Err.Description & " ERR.num " & Err.Number)
Resume Next
End Function
End Class
We get error5 - the resource cannot be found. To set the OnBuild property of XDeutsch.resx to "Embedded Resource" does not help. Do we need anther method with ADX?
Visual Basic sample code please.
kind regards
Michael |
|
Dmitry Kostochko
Add-in Express team
Posts: 2875
Joined: 2004-04-05
|
Hi Michael,
Please have a look at the https://msdn.microsoft.com/en-us/library/yfsz7ac5(v=vs.110).aspx documentation:
baseName
- The root name of the resource file without its extension but including any fully qualified namespace name. For example, the root name for the resource file named MyApplication.MyResource.en-US.resources is MyApplication.MyResource.
But, as far as I can see, you passed the resource file name together with its extension. Please check this.
If this does not resolve the issue, please send me your project (or some demo project with the same issue) for testing and will try to work out a solution. |
|
Michael Kaden
Guest
|
Dear Dimitry,
Thank your for your post, it works well now. I had the resource file extension passed.
Regards
Michael |
|
Andrei Smolin
Add-in Express team
Posts: 18829
Joined: 2006-05-11
|
You are welcome!
Andrei Smolin
Add-in Express Team Leader |
|