2
votes

I'm writing a mixed C++/CLI DLL with both managed and unmanaged classes. Both need access to string and other types of resources, like Direct3D textures.

How best to embed them within the DLL? It seems like there are several ways to do this; .resx (new style, managed), .rc (old style) which can be used to generate .resources files and (optionally) embedded within the assembly.

Currently I'm using a .rc file and ::LoadString() to get my strings. I have a managed wrapper for this to return String^ values to managed code. And a similar method to return WCHAR* to native code.

Is there a better way of doing this? What are the tradeoffs? I could for instance use a .resx file and the ResourceManager class for managed code and an .rc for native but this means I can't share resources etc. Is there a recommended approach?

Thanks,

Ade

1

1 Answers

1
votes

I just use a .resx and if there is any strings the native code needs I use managed to get stuff out of my .resx file and convert it into a CString on the next line.

Although you already have a wrapper to do this so it would be even easier.

.rc files are so 1997 man!