.NETGURU
Mixing VB6 and VB.Net resource files
Messages   Related Types
This message was discovered on microsoft.public.dotnet.languages.vb.upgrade.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Jan van Veldhuizen
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?

Reply to this message...
 
    
Jay B. Harlow [MVP - Outlook] (VIP)
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

"Jan van Veldhuizen" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
John Hart [MSFT] (VIP)
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.
--------------------
[Original message clipped]

es.vb,microsoft.public.dotnet.languages.vb.upgrade
[Original message clipped]

.phx.gbl
> Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.languages.vb:221420
microsoft.public.dotnet.languages.vb.upgrade:6769
microsoft.public.dotnet.internationalization:820
[Original message clipped]

vbup1062.asp
[Original message clipped]

vbgrfVisualBasicCompatibilityNamespaceReference.asp
[Original message clipped]

Reply to this message...
 
    
Jay B. Harlow [MVP - Outlook] (VIP)
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

"John Hart [MSFT]" <Click here to reveal e-mail address.> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification