473,385 Members | 1,344 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

res:// protocol in VB.NET

I have added a GIF to my project and wish to retrieve it using the res://
protocol. As an example, the first string below works, whilst the second
does not.

Const s1 As String = "res://c:\windows\system32\shdoclc.dll/pagerror.gif"
Const s2 As String = "res://c:\test\mycontrol.dll/comments.gif"

If I Ctrl+Click on the first in the IDE then the page is opened. Doing the
same on the second simply displays the default "The Page cannot be
displayed" page.

I have added the GIF to my project using "Add Existing Item ..." and
changing the Build Action to Embedded Resource. I have also tried adding a
RESX file containing the resource. I rebuild the project but neither of
these seems to work.

Can anyone suggest how it should be done?

[The reason I want to use the res:// protocol is to load custom glyphs into
the WebBrowser control, and I want them to be part of the assembly. The Add
Glyph to Table command can take a path name or a res:// protocol descriptor.
The latter seems to be the only way to read them from a resource file. If
there is another way please let me know]

TIA

Charles
Nov 20 '05 #1
4 5412
Hello,

"Charles Law" <bl**@thingummy.com> schrieb:
Const s1 As String = "res://c:\windows\system32\shdoclc.dll/pagerror.gif"
Const s2 As String = "res://c:\test\mycontrol.dll/comments.gif"

If I Ctrl+Click on the first in the IDE then the page is
opened. Doing the same on the second simply displays
the default "The Page cannot be displayed" page.

I have added the GIF to my project using "Add Existing
Item ..." and changing the Build Action to Embedded
Resource. I have also tried adding a RESX file containing the
resource. I rebuild the project but neither of
these seems to work.


The res-protocol won't work with resx resources, I think. You will have to
use Win32 resources (you must compile using the "vbc" compiler and add the
Win32 resource file by specifying the file in "/win32resource:".

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #2
Hi Herfried

Thanks for the info. I have been looking into this and am still not sure how
to achieve my goal.

Can I do the compile from within the IDE or do I have to resort to the
command line :-( ?
My project has a .vbproj file (and several .vb files), so what would my
command line look like, assuming the project is called MyProj and the
resource file is called MyRes.Res?

Thanks for you help.

Charles
"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:OZ**************@TK2MSFTNGP11.phx.gbl...
Hello,

"Charles Law" <bl**@thingummy.com> schrieb:
Const s1 As String = "res://c:\windows\system32\shdoclc.dll/pagerror.gif" Const s2 As String = "res://c:\test\mycontrol.dll/comments.gif"

If I Ctrl+Click on the first in the IDE then the page is
opened. Doing the same on the second simply displays
the default "The Page cannot be displayed" page.

I have added the GIF to my project using "Add Existing
Item ..." and changing the Build Action to Embedded
Resource. I have also tried adding a RESX file containing the
resource. I rebuild the project but neither of
these seems to work.
The res-protocol won't work with resx resources, I think. You will have

to use Win32 resources (you must compile using the "vbc" compiler and add the
Win32 resource file by specifying the file in "/win32resource:".

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet

Nov 20 '05 #3
Hello,

"Charles Law" <bl**@thingummy.com> schrieb:
Can I do the compile from within the IDE or do I have to resort to the
command line :-( ?
AFAIK this cannot be done from within the IDE.

:-(
My project has a .vbproj file (and several .vb files), so what would my
command line look like, assuming the project is called MyProj and the
resource file is called MyRes.Res?


Have a look at the documentation for "vbc.exe". You won't be able to use
the project file when compiling from the command line.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #4
Thanks again Herfried. I will look at it.

Charles
"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:u1*************@TK2MSFTNGP09.phx.gbl...
Hello,

"Charles Law" <bl**@thingummy.com> schrieb:
Can I do the compile from within the IDE or do I have to resort to the
command line :-( ?


AFAIK this cannot be done from within the IDE.

:-(
My project has a .vbproj file (and several .vb files), so what would my
command line look like, assuming the project is called MyProj and the
resource file is called MyRes.Res?


Have a look at the documentation for "vbc.exe". You won't be able to use
the project file when compiling from the command line.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Geoff Turner | last post by:
Hi all, I'm trying to create a string table for a project. In fact it's to tidy up an old project. So I have all the strings, and just need to create a table. But I don't want to have to retype...
18
by: Roger Shrubber | last post by:
Hello all I have created a page which has several pictures on it. Each picture is surrounded by a frame made from actual photos of real picture frames, consisting of four corner tiles and four...
1
by: D. Yates | last post by:
Hi, I am looking for an example of how to extract bitmap images from an embedded resource file (a file with *.res extension, which can be viewed inside of the ide and can hold bitmaps, icons,...
2
by: Dan | last post by:
Hi, How do I embed a picture (gif for instance) in a dll using VB.NET so that the picture can be used in a html page with the res protocol? I have tried adding pictures (as Embedded resources)...
1
by: mabond | last post by:
Hi My app requires to run in a minumum of 1024 X 768. There are plenty of users who for their own comfort continue to work in 800 X 600. The res is checked at start-up. If res is less than...
4
by: Bob Badger | last post by:
Hi, Simple question (although I guess with a complicated answer). Is HTTP an async protocol? For instance, if I send a message to a c# webservice via http what is the protocol actually doing? ...
1
by: John | last post by:
Can some one please help me with this code? I've spend 2 days on it. And I see the question all over the place but I do not see the answer. No on is answering the question I am about to ask. I...
1
by: Benry | last post by:
Hi guys. I hope I can discuss Twisted here. If not, direct me to the correct place please. My question(s): I'm working on a custom network protocol (application layer in TCP/IP model) for a...
4
by: Pool | last post by:
I tried to connect DB2 (Sitting in Unix server at my client location) using Db2 connect V8. I am getting the following error message. I tried all the possible options BUt the error is same.. See each...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.