473,324 Members | 2,214 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,324 software developers and data experts.

Resources in MC++

I'm currently using icons in my app via external files
(pImageList->Images->Add(new Icon("Empty.ico"))) and I need to switch to
using them by compiling them into the assembly and using (Object* aa =
rsrcMgr->GetObject(S"Empty.ico")). I used one of the several applications
from the internet that allow you to insert files such as *.ico files into
the resx file and that seemed to work. However, I'm not having too much luck
accessing the icon since I'm getting a "MissingManifestResouceException"
error when I try to access the resource. I get the same error when I try to
access one of the strings in the resx file.

My little test application consists of a main exe and a single assembly dll
(again, both MC++). I'm trying to access the icon from code contained in the
dll assembly using the following code (the name of the .resource file is
"DAL_ProjectTree"):

namespace LeapSoft {

namespace DAL {

DAL_ProjectTree::DAL_ProjectTree(IDAL* pDAL)

{

String* name = CultureInfo::CurrentCulture->Name;

CultureInfo* c = new CultureInfo(name, false);

Thread::CurrentThread->CurrentCulture = c;

ResourceManager* rsrcMgr = new ResourceManager("DAL_ProjecTree",
Assembly::GetExecutingAssembly());

String* aa = rsrcMgr->GetString(S"abc");

}

}

Do I to worry about the namespace (I also tried not using a namespace with
no luck) or something else? I downloaded the recent MC++ samples from msdn
and the one on Localization has a manifest resouce inside an .rc file. Do I
need to do the same? I removed that resource from the sample and it still
worked so I'm inclined to think not. Do I need to do something with the
resources in the exe?

Any help will be appreciated?

Jon Lea.
Nov 16 '05 #1
1 1439
Some additional informastion: if I put the same code that I'm using in the
class that is part of the dll assembly into one of the classes in the exe
assembly, I can get the string resource. It looks like there is something
that I need to do to get resources contained in a dll assembly.

Jon Lea
"jlea" <jo*@leapsoft.com> wrote in message
news:Os**************@tk2msftngp13.phx.gbl...
I'm currently using icons in my app via external files
(pImageList->Images->Add(new Icon("Empty.ico"))) and I need to switch to
using them by compiling them into the assembly and using (Object* aa =
rsrcMgr->GetObject(S"Empty.ico")). I used one of the several applications
from the internet that allow you to insert files such as *.ico files into
the resx file and that seemed to work. However, I'm not having too much luck accessing the icon since I'm getting a "MissingManifestResouceException"
error when I try to access the resource. I get the same error when I try to access one of the strings in the resx file.

My little test application consists of a main exe and a single assembly dll (again, both MC++). I'm trying to access the icon from code contained in the dll assembly using the following code (the name of the .resource file is
"DAL_ProjectTree"):

namespace LeapSoft {

namespace DAL {

DAL_ProjectTree::DAL_ProjectTree(IDAL* pDAL)

{

String* name = CultureInfo::CurrentCulture->Name;

CultureInfo* c = new CultureInfo(name, false);

Thread::CurrentThread->CurrentCulture = c;

ResourceManager* rsrcMgr = new ResourceManager("DAL_ProjecTree",
Assembly::GetExecutingAssembly());

String* aa = rsrcMgr->GetString(S"abc");

}

}

Do I to worry about the namespace (I also tried not using a namespace with
no luck) or something else? I downloaded the recent MC++ samples from msdn
and the one on Localization has a manifest resouce inside an .rc file. Do I need to do the same? I removed that resource from the sample and it still
worked so I'm inclined to think not. Do I need to do something with the
resources in the exe?

Any help will be appreciated?

Jon Lea.

Nov 16 '05 #2

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

Similar topics

0
by: Daniel Lidström | last post by:
Hi, I've been trying a long time now to generate some XML using MC++ and XmlSerializer. I have a piece of C# code that produces exactly what I want, but I simply can't get the MC++ code to write...
1
by: Philip | last post by:
I am trying to return a string from a mc++ method back to an invoking C# module. In the invoking C# module I have the string defined as.... String strString;.... in mc++ the method definition is...
3
by: Philip | last post by:
I am invoking a mc++ method from C# via an unsafe code block. The reason for the unsafe code block is that I am receiving a int as a return parameter. I am invoking the method with a "ref...
2
by: Edward Diener | last post by:
In C++ an overridden virtual function in a derived class must have the exact same signature of the function which is overridden in the base class, except for the return type which may return a...
2
by: Lev | last post by:
Hi, I have some code that does reflection on an assembly I load. When I try to get the attributes on one of the methods implemented in the assembly, the MC++ version does not return anything....
0
by: Peter Insley via .NET 247 | last post by:
Hi, have been searching for an answer for this for quite a while,I would be greatfull for any help. We are developing a codebase that of components that we wouldlike to be able to write in MC++ or...
0
by: Maxwell | last post by:
Hello, I recently completed a MC++ (VS2003) DLL that wraps a non MFC C++ DLL and need to use it in a MC++ Console Application (no forms/guis of any kind just output to console). Trouble is...
8
by: WebSnozz | last post by:
I have an application written in C that does a lot of low level stuff. It does a lot of things like casting from void*'s. I want to create a new GUI for it in either C# or MC++, but reuse the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.