473,382 Members | 1,766 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,382 software developers and data experts.

Old Style Resource "embedding" in VB.NET... please help.

I'm working on a plug-in for an application called DesktopSideBar for
Windows. It emulates to some degree the Longhorn sidebar. The SDK for
DesktopSideBar supports .NET plug-in development through COM Interop
and a provided reference DLL. In the SDK are two included samples...
One, called RecycleBin is written entirely in unmanaged C++ as a
normal DLL. The second, StickerPanel, is written in C#. My first
exercise was porting StickerPanel to VB.NET to get a feel for the SDK
and I prefer VB.NET to C#.

Most of the functionality is a very seamless fit with the .NET
framework. However, there are a couple of examples I can NOT figure
out how to emulate in .NET. One of the first methods that is required
is:

Public Overridable Sub RegisterPanel(ByVal panelClass As String, ByVal
panelCaption As String, ByVal panelDescription As String, ByVal
panelIcon As String, ByVal panelCategory As String, ByVal categoryIcon
As String, ByVal panelFiles As String, ByVal pluginCookie As Integer)

The included C# example leaves the Icon variables blank. This has the
effect of leaving the icon blank on the "Add Plugin" panel where all
installed plug-ins are listed. I really want to provide this. The
problem is that either Icon parameter is a String format... and it's
not a path. In the C++ example it's handled:

char szPath[_MAX_PATH];
GetModuleFileName(_AtlBaseModule.GetResourceInstan ce(),szPath,sizeof(szPath));

std::stringstream panelIcon;
panelIcon<<szPath<<","<<IDB_ICONS<<",0";

CSidebar sidebar(pSidebar);
sidebar.RegisterPanel(
"RecycleBinPanel",
"recyclebin",
"recyclebin_desc",
panelIcon.str(),
"system_cat",
",254,4",
"",
pluginCookie);

Now, I used to do C++ development exclusively and this is certainly
not difficult to understand... mostly anyway. Unfortunately the author
of DesktopSidebar is just one person and so the SDK just includes the
2 samples, the reference DLL, some Includes for C++ development, and
general instructions. There is no documentation for the methods
available. So, the code above basically gets the full path to itself,
a DLL in the DesktopSideBar directory. Then it creates a string that
looks something like this: "C:\Program Files\Desktop
Sidebar\recyclebin.dll,100,0". I used 100 because that is the provided
resource ID within the project specified by IDB_ICONS. In the C++
code, the bitmap used, "icons.bmp" is included as a resource in the
DLL. It's a bitmap with 2 images, so I think the ",0" refers to the
first image.

Now, in VB.NET we can also include bitmaps (or whatever we want)
inside the DLL by making it an embedded resource. However, there are
several problems... one is that there is no resourceID to reference
(which I require in this weird case). Now, I can use Ildasm.exe on the
compiled DLL to get more information, for instance in my DLL
Ildasm.exe shows me this:
..mresource /*28000002*/ public 'dssystemuptime.up.bmp'

So, I guessed that my resourceID could be 28000002 and so I tried
using the same semantics (even used the same bitmap). However, all I
got was a black blob. This is more than I got before, but I think I'm
missing something. I don't think the embedding in VB.NET works in the
same way it does/did under C++. Using an application, "Resource
Grabber" I was able to open the Recyclebin C++ DLL and see the bitmap.
When looking at my DLL developed in VB.NET, I don't see the bitmap.
However, it IS there as I can get to it just fine using the call:
Me.GetType().Assembly.GetManifestResourceStream(.. .) and then creating
a bitmap from that.

Does anyone have a clue on how I could procede or is this just
something that isn't going to work?
Nov 20 '05 #1
2 1777
* mp******@yahoo.com (Matt) scripsit:
Now, in VB.NET we can also include bitmaps (or whatever we want)
inside the DLL by making it an embedded resource. However, there are
several problems... one is that there is no resourceID to reference
(which I require in this weird case). Now, I can use Ildasm.exe on the
compiled DLL to get more information, for instance in my DLL
Ildasm.exe shows me this:
.mresource /*28000002*/ public 'dssystemuptime.up.bmp'


You will have to use "vbc.exe" for compilation with
"/win32resource:<filename>" specified in order to embed an old-style
Win32 resource file.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Thanks!
Nov 20 '05 #3

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

Similar topics

1
by: Havic Ploccin | last post by:
The LocalizedHelloWorld sample in help shows how to embed the default resource into the main assembly. Is this really required? Can we not d this and always require satellite assemblies? I tried...
0
by: MikeY | last post by:
With Reference/Resource is there a way of embedding the .resource file within a folder of my application instead of having it in the main project /executing assembly area. i.e. if I have a folder...
1
by: Namratha Shah \(Nasha\) | last post by:
Hi All, This is a resource file generation tool which converts an xml based resource formats to .net resource file i.e. (.resources) and vice-versa. Today we will see how we will generate ...
1
by: coz | last post by:
Someone please help! I cannot for the life of me get a web resource in asp.net 2.0 to return any content. I know I have correctly embedded my resources (because I can manually get the resources...
0
by: Angrez Singh | last post by:
Hi, I am trying to use a "customcontrol" inside a "webusercontrol" but facing problem with the viewstate of the "customcontrol". When I use the "customcontrol" on a page either adding it...
0
by: YellowFin Announcements | last post by:
Whitepaper: "Yellowfin Reporting" enables Embedded Business Intelligence -------------------------------------------------------------------------------- Embedded reports are a standard...
3
by: Jim Hill | last post by:
Well, I've found about a hundred thousand web pages where people have had the same problem I have but nary a page with a solution that works for me. I want to do a simple embed, so I've followed...
4
by: Duncan Jones | last post by:
I'm almost certain there is no easy answer to this question, but I'd thought I'd just check.... *Ignoring* for a second why I want to do this, is there any way to specify that an element in a...
5
by: Srinidhi | last post by:
I'm trying to embed a report (.rdlc) file in my project. But it always stays as linked. The 'Persistance' property is grayed & always set to 'Linked at compile time'. Upon further inspection i saw...
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: 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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.