472,958 Members | 2,177 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 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

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;

CSidebar sidebar(pSidebar);

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 1755
* 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]
Nov 20 '05 #2
Nov 20 '05 #3

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

Similar topics

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...
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...
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 ...
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...
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...
by: YellowFin Announcements | last post by:
Whitepaper: "Yellowfin Reporting" enables Embedded Business Intelligence -------------------------------------------------------------------------------- Embedded reports are a standard...
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...
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...
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...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.