Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB 6.0 >>> VB.NET / August 2004

Tip: Looking for answers? Try searching our database.

Mixing VB6 and VB.Net resource files

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jan van Veldhuizen - 03 Aug 2004 21:01 GMT
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?
Jay B. Harlow [MVP - Outlook] - 03 Aug 2004 21:32 GMT
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/vbup
1062.asp


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


Hope this helps
Jay

> I've an application (VB6) which uses resource dll's  (only strings) with a
> LoadResString function.
[quoted text clipped - 3 lines]
> 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?
John Hart [MSFT] - 04 Aug 2004 20:53 GMT
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

Signature

John Hart, Microsoft VB Team
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

> From: "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP@msn.com>
> References: <eQtpqSZeEHA.236@tk2msftngp13.phx.gbl>
[quoted text clipped - 8 lines]
> Message-ID: <O$qXhkZeEHA.2908@TK2MSFTNGP10.phx.gbl>
> Newsgroups:
microsoft.public.dotnet.internationalization,microsoft.public.dotnet.languag
es.vb,microsoft.public.dotnet.languages.vb.upgrade
> NNTP-Posting-Host: ip68-96-139-50.om.om.cox.net 68.96.139.50
> Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10
.phx.gbl
> Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.languages.vb:221420
microsoft.public.dotnet.languages.vb.upgrade:6769
microsoft.public.dotnet.internationalization:820
> X-Tomcat-NG: microsoft.public.dotnet.languages.vb.upgrade
>
[quoted text clipped - 4 lines]
> 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 clipped - 6 lines]
> > 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?
Jay B. Harlow [MVP - Outlook] - 06 Aug 2004 14:00 GMT
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

> Hi Jan,
>
[quoted text clipped - 5 lines]
> 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
[quoted text clipped - 11 lines]
> > Message-ID: <O$qXhkZeEHA.2908@TK2MSFTNGP10.phx.gbl>
> > Newsgroups:

microsoft.public.dotnet.internationalization,microsoft.public.dotnet.languag
> es.vb,microsoft.public.dotnet.languages.vb.upgrade
> > NNTP-Posting-Host: ip68-96-139-50.om.om.cox.net 68.96.139.50
> > Path:

cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10
> phx.gbl
> > Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.languages.vb:221420
[quoted text clipped - 8 lines]
> > 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
> >
[quoted text clipped - 11 lines]
> can
> > > share the rc- or res-file with both the VB6 and the .Net project?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2012 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.