473,698 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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"Em pty.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 "MissingManifes tResouceExcepti on"
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_ProjectTre e"):

namespace LeapSoft {

namespace DAL {

DAL_ProjectTree ::DAL_ProjectTr ee(IDAL* pDAL)

{

String* name = CultureInfo::Cu rrentCulture->Name;

CultureInfo* c = new CultureInfo(nam e, false);

Thread::Current Thread->CurrentCultu re = c;

ResourceManager * rsrcMgr = new ResourceManager ("DAL_ProjecTre e",
Assembly::GetEx ecutingAssembly ());

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

}

}

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 1449
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.c om> wrote in message
news:Os******** ******@tk2msftn gp13.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"Em pty.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 "MissingManifes tResouceExcepti on"
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_ProjectTre e"):

namespace LeapSoft {

namespace DAL {

DAL_ProjectTree ::DAL_ProjectTr ee(IDAL* pDAL)

{

String* name = CultureInfo::Cu rrentCulture->Name;

CultureInfo* c = new CultureInfo(nam e, false);

Thread::Current Thread->CurrentCultu re = c;

ResourceManager * rsrcMgr = new ResourceManager ("DAL_ProjecTre e",
Assembly::GetEx ecutingAssembly ());

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

}

}

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
410
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 the same thing. Below I have included two minimal compilable samples that illustrate my problem. The C# code produces this XML: <?xml version="1.0" encoding="utf-8"?>
1
1637
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 like.... int function(String *strString, String *strString1....)....etc I am unable to use the "ref" keyword in the C# module when invoking the mc++ method .... it will not compile.
3
1535
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 iValue" int parameter.... and in the mc++ code I define "int* iValue" for the same int parameter. As a result I have to place the invoking code in an unsafe code block. Is there not a means to update a int parameter between C# and mc++ without...
2
2513
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 pointer or reference to a derived type of the base class's return type. In .NET the overridden virtual function is similar, but an actual parameter of the function can be a derived reference from the base class's reference also. This dichotomy...
2
1909
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. See code below: Object __gc* memberAttributes = info->GetCustomAttributes(__typeof(EntryPointAttribute), false);
0
1212
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 C# depending on thesituation. These components are accessed through a standard setof interfaces that we have defined in C#. We are using"explicit implementation" for these interfaces as thesecomponents may implement many interfaces, often with...
0
1607
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 that when I ran it and looked at memory usage (in Windows task manager) it looked as if there was a very slow leak. To isolate the issue:
8
2200
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 existing code. The options I've considered so far: 1. Create a new MC++ GUI project and add the *.c files to them and mark them with pragma unamanged. However, the /clr option does not compile *.c files, so I rename them to *.cpp, and now they...
0
9160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7729
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6521
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.