Add-in Express™ Support Service
That's what is more important than anything else

Retrieving Resources in ADX 
Michael Kaden

Posts: 105
Joined: 2017-11-15

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
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

Posted 06 Dec, 2017 05:55:56 Top
Dmitry Kostochko

Add-in Express team

Posts: 2740
Joined: 2004-04-05
Hi Michael,

Please have a look at the ResourceManager Constructor documentation:

- 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.
Posted 06 Dec, 2017 11:44:57 Top
Michael Kaden

Posts: 105
Joined: 2017-11-15
Dear Dimitry,

Thank your for your post, it works well now. I had the resource file extension passed.


Posted 08 Dec, 2017 07:13:50 Top
Andrei Smolin

Add-in Express team

Posts: 14582
Joined: 2006-05-11
You are welcome!

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 08 Dec, 2017 08:31:53 Top