all groups > vb.net upgrade > august 2004 >
You're in the

vb.net upgrade

group:

Mixing VB6 and VB.Net resource files



Re: Mixing VB6 and VB.Net resource files Jay B. Harlow [MVP - Outlook]
8/3/2004 3:32:56 PM
vb.net upgrade: Jan,
The easiest way may be to create a VB6 DLL that has an object that your
VB.NET code can call that does the LoadResString for it.

As I don't believe the Visual Basic Compatibility Library's
VB6.LoadResString within VB.NET can be used to load VB6 style res files.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbup1062.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbgrfVisualBasicCompatibilityNamespaceReference.asp

Hope this helps
Jay

[quoted text, click to view]

Mixing VB6 and VB.Net resource files Jan van Veldhuizen
8/3/2004 10:01:26 PM
I've an application (VB6) which uses resource dll's (only strings) with a
LoadResString function.
Now I added some new programs using VB.NET.
I want to avoid duplicating the resource-files, but I cannot find a way to
re-use those dll's from .NET.
Is there a way how I can read the stringtable from that dll? Or how I can
share the rc- or res-file with both the VB6 and the .Net project?


Re: Mixing VB6 and VB.Net resource files JohnHart NO[at]SPAM Online.Microsoft.com.
8/4/2004 7:53:58 PM
Hi Jan,

Jay is correct the Visual Basic Compatibility Library's VB6.LoadResString
will only work on VB.Net resx files. Another possible solution for you
would be to call the native Window's APIs LoadLibrary and LoadString from
your .Net project to load the resources from your VB6 DLL.

Here's a KB article that describes how: How To Create and Call a String
Resource in a DLL with a Specific Locale ID
(http://support.microsoft.com/default.aspx?scid=kb;en-us;232625&Product=vb6)

This article was written with a VB6 sample but you can easily upgrade the
code .Net


--
John Hart, Microsoft VB Team
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
[quoted text, click to view]
microsoft.public.dotnet.internationalization,microsoft.public.dotnet.languag
es.vb,microsoft.public.dotnet.languages.vb.upgrade
[quoted text, click to view]
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10
.phx.gbl
[quoted text, click to view]
microsoft.public.dotnet.languages.vb.upgrade:6769
microsoft.public.dotnet.internationalization:820
[quoted text, click to view]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/
vbup1062.asp
[quoted text, click to view]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/
vbgrfVisualBasicCompatibilityNamespaceReference.asp
[quoted text, click to view]
Re: Mixing VB6 and VB.Net resource files Jay B. Harlow [MVP - Outlook]
8/6/2004 8:00:04 AM
John,
I like that better then my VB6 DLL!

Although he already has VB6 DLLs, so it may not be such a big difference...

Thanks for the link, I'll need to save that one.

Jay

[quoted text, click to view]

AddThis Social Bookmark Button