Weird problem with resources between Main Application and DLL

I have a main MDI application and a DLL used by this MDI application (MFC
extension DLL).
The problem is, that, when the resource ID associated to an icon, or a BMP
or anything in the DLL
matches an ID in the MainAPP, the resource showed by the application is the
resource in the Main APP!!!

The problem is that the MainAPP and the DLL are being developed separately,
so the people that
works in one CAN NOT know the resource ID's being used by the other part.

So, there's a way to assure that when I read a resource from the DLL, I
won't get the resource
with the same ID from the Main APP? I tried using (in the MainAPP):

HINSTANCE hInstResourceClient = AfxGetResourceHandle();
AfxSetResourceHandle(::GetModuleHandle("MyDLL.dll"));
[Code that uses resources from the DLL, such as icons, etc]
AfxSetResourceHandle(hInstResourceClient);

but doesn't work, the app continues showing the resources from the MainAPP
only.

Thanks a lot for your attention.


0
8/5/2004 4:44:32 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
658 Views

Similar Articles

[PageSpeed] 45

Check out the docs:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_Extension_DLLs.asp

Look at the section "Sharing Resources and Classes"

Hope this helps...

On Thu, 5 Aug 2004 12:44:32 -0400, "Alvaro Palma"
<invalid_address@invalid_domain.com> wrote:

>I have a main MDI application and a DLL used by this MDI application (MFC
>extension DLL).
>The problem is, that, when the resource ID associated to an icon, or a BMP
>or anything in the DLL
>matches an ID in the MainAPP, the resource showed by the application is the
>resource in the Main APP!!!
>
>The problem is that the MainAPP and the DLL are being developed separately,
>so the people that
>works in one CAN NOT know the resource ID's being used by the other part.
>
>So, there's a way to assure that when I read a resource from the DLL, I
>won't get the resource
>with the same ID from the Main APP? I tried using (in the MainAPP):
>
>HINSTANCE hInstResourceClient = AfxGetResourceHandle();
>AfxSetResourceHandle(::GetModuleHandle("MyDLL.dll"));
>[Code that uses resources from the DLL, such as icons, etc]
>AfxSetResourceHandle(hInstResourceClient);
>
>but doesn't work, the app continues showing the resources from the MainAPP
>only.
>
>Thanks a lot for your attention.
>

0
none89 (807)
8/5/2004 6:45:05 PM
Reply:

Similar Artilces:

Comments problem
I've created a number of comments. When I position the comments where I want them, they only reflect their positions on "Show" or "Edit" comment. All the comments default to the same relationship to the cells when you pass over them. This is a problem because I've also used data vaildation (with lists) on these cells and you can't display the comment with the list pulled down at the same time because the comments are tool close to the validated cell. Thanks in adavance. The comment usually appears to the right of the cell, and should still allow you to see t...

Profiling DLL
Environment: MS Visual Studio 6.0 Pro; Win2000 server, Java JDK1.4.2 Following the instructions at http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B179269 I am attempting to profile my DLL built under Visual Studio. The complication in my case is that the DLL is called by only Java/JNI. Using java.exe as the executeable name the PROFILE command works and my test program successfully runs to completion. For example, PROFILE /I %dllname% /O %dllname% D:\is\jdk14\bin\java.exe -classpath %cp% org.fast.NSTestHarness %1 The problem is the .PBO output file is empty. The usual suspects...

synchronising problem with Sony NWZ-S545
Up until recently i could sync tracks/albums etc to my sony S545 MP3. now when i try and drag tracks to the sync folder then click start sync the mp3 player just freezes, WMP states "processing" but nothing happens. Have searched the web for a solution but nothing. done sysem restore etc etc. I guess it must be a recent update but what one? Its a pain in the backside and hope someone can help "Wookywoo" wrote: > Up until recently i could sync tracks/albums etc to my sony S545 MP3. now > when i try and drag tracks to the sync folder then click s...

Excel Mail Merger Problem
When merging excel with word for..my currrency field is dropping off zeros to the right of decimal point..if field has $ 56.03, it imports correctly, but if it is $56.00, it comes in as $56, if it is $56.30, it comes in as $56.3...this process is for invoices..any advice (I've tried everything)? Debra Dalgleish has given the following reply in newsgroups http://google.com/groups?threadm=3EBB0685.5080002%40contextures.com and has also identified the following MS KB articles in such as : http://google.com/groups?threadm=3DFA8DA8.6000209%40contextures.com 304387 - WD: Date, Phone N...

How to create a windows server and client application with NT integrated security
Hi All, I'm delivering a project need to create a sever and client application using NT integrated security. The server supports two modes of security checking: standard security and NT integrated security, Just like the way of SQL Server 2000 is doing. If the server uses standard security mode, the client need to explicitly type in the user name and password in order to connect to the server. If the server uses integrated security mode,the client program will use the crendential of the current logon user to connect to the server and it will be authenticated by the NT domain. With this ...

VBA Help problem
I'm using Office 2003 SP3 on Win 2000 SP4. When I use VBA help, if thee are hyperlinks on the page I get a popup with the following error: "Runtime error has occurred" Line 16: Error: not implemented If I choose debug from this dialog box I am taken to a script and another error popup: "htmlfile: Not implemented" there is a yellow arrow at the line: "document.onclick = window.parent.closeList" Am I missing a reference somewhere in VBA or is this a more serious problem? The Windows 2000 install has been around a long time... I've ...

Printing problem from Excel 2007
Greetings, I am having an issue with printing from Excel 2007. Many users when printing from Excel with get several pages of non-sensical "junk" printed out on the pages. If it actually prints what is on the page, none of the items are in the cells, but look like they are just randomly thrown about the page. I have found that this most often is related to the Calibri font somehow, because I instruct them to change the font to Arial and all prints fine. That being said, if the user converts the Excel sheet into a PDF and print, it prints perfect. This is a great workaround, but kind ...

Problems printing in Publisher 2003 with HP PSC 2410 #2
I am new to publisher 2003 and am having great difficulties printing anything properly using an HP PSC 2410 all in one. As an example when trying to print a half page side folded pre-designed greetings card all that prints is page 1 and part of page 4, minus any text. Pages 2 and 3 are missing altogether. The print preview however displays everything correctly. I have reinstalled Office 2003 and updated the printer drivers to the latest versions but the problem remains. Any help is much appreciated. ...

code problem
Hi this is a follow on to a previous thread (Copy Macro) We are now successfully creating a new Workbook using the code below. With ActiveWorkbook FName = .Path & "\code.txt" .VBProject.VBComponents("Module2_sort").Export FName End With ThisWorkbook.Worksheets(Array("Supplier Concerns")).Copy ActiveWorkbook.SaveAs Filename:="c:\Week\testing" & strFileName & ".xls" ActiveWorkbook.VBProject.VBComponents.Import FName Problem is when we open the new Workbook and run the macro the code defaults ba...

conversion lotus 123 files to excel -- problem
I am converting lotus123 files to excel2002. One problem is that in lotus, literals are ignored when found in a cell within a formula. Excel on the other hand is not doing this and therefore causing #value errors on all the formulas where this occurs. Is there a way to handle this in excel other than manually having to change all the formulas? ...

problem in changing the text of sentences before tables
I am developing a word automation application. In a method of mine, I change the text of some sentences of an opened word file, but the problem is when I change the text of a sentence which located before a table, it will be moved to the first cell of the table. My code is as follow: void myMethod( long startingSentenceNumber, const char *toBeSearched, const char *replacement, bool replace ) { Range currentSentenceRange; Selection sentenceSelection; Sentences sentencesList = m_document.GetSentences(); long sentencesCount = sentencesList.GetCount(); CString replacementCStr(...

Resource Scheduling...
Hi folks, I am running exchange 2003 on SBS2003. I have had this problem on BOTH installs (we recently got a new box and I rebuilt everything from scratch) so I know its something I am doing. I am attempting to get our conference rooms to auto-accept appointments. I have logged in as those users, set them to auto accept appointments from outlook, and then given folks permissions. But they appointments don't auto accept. Do I need to do something additional - perhaps open the mailboxes with my account?? Please help, its an issue thats been driving me crazy forever. Hi, Did yo...

save as problem
I cant save my excel file The "save as" option is not eviable. Whats happening? "From a prior post by Ron DeBruin, You can reset your menubar to default. Right click menubar. Customize > Toolbars Tab. Select worksheet menubar. Click Reset button. Using VBA Application : CommandBars(""Worksheet menu bar"").Controls(""File"").Reset Or the whole menubar Application.CommandBars(1).Reset You lost the things you add to the menubar!!" ========================================================== And one link that offers some sugges...

Odd problem with worksheets when opening file
Okay, here's the odd problem that's come up. When you double click on a excel file, excel opens up, but you can onl see the toolbars. The grid area looks like a snapshot of whatever you current background is before the file opened up. If you were showin your desktop, after the excel file opened, you'd still see your deskto in the datagrid area. If you start up a new excel file, then do the File>Open>file name, th file will open correctly. This problem happens across users here. Everyone is currently runnin office 2K. Any ideas on what causes the problem and any...

Problem OL 2002 Email
I am having a problem with OL 2002 email settings. I have two computers which I am setting up. One computer works perfectly. The second computer I have configured exactly the same...incoming/outgoing servers and ports, etc... are all setup the same. On the second computer when I press test email settings, everything tests fine. But when I try to do a Send/Receive, I run into problems. First, the POP3 tries to connect to the POP3 server twice at the same time. (I am able to see this on my POP3 server console.) Second, the SMTP sending mail never connects to my SMTP server. (Ag...

2007 B2 MSOO has encountered a problem
More often then not when I click to open an email in my inbox I get this MSOO pop-up with a checkbox, checked telling me MSOO has encountered a problem and needs to close. Has this been an issue for others and is there a fix. If you have Adobe Acrobat Pro 6/7 (not the reader), go into Control Panel, Add/Remove Programs, click change for Adobe Acrobat Pro and remove the Office & Outlook plugins. Patrick Schmid -------------- http://pschmid.net "Jax" <Jax@discussions.microsoft.com> wrote in message news:A74147F4-CD75-4FF8-98A7-5A18B01A8FDD@microsoft.com: > More of...

Sumproduct Problem (AB)
Hi everyone, can you please sort out this problem for me? SUMPRODUCT(('Client Opening Stock'!B2:B138=$A$1)*('Client Opening Stock'!C2:AH138=A7),'Client Opening Stock'!C2:X138) 'Client Opening Stock'!B2:B138 is the Client Name Client Opening Stock'!C2:AH138 is the Product 'Client Opening Stock'!C2:X138 is the Amount I belive the formula is not the proper formula, but this is the result I need. Thank you for your kind help You need to tell us what the problem is, and what solution you want. Why is it "not the proper formula...

Subform doesn't work once added to main form
Hi, I've been searching around looking for some help and can't find anyone that has had quite the same problem. I have a main form called 'Sites' and have added a subform called 'Previous Year Flows' into the main form. I do not enter data into this subform. Instead, data on previous years is drawn through from a table called prev yr flows into this subform. When I open the subform on its own it draws through all the necessary data, but when it is embedded within the main form, none of the actual data is pulled through at all, although the linked fields, Site ID and A...

Query Problem in Test.
I keep getting errors on the WHERE part of my query. I'm sure it's something simple. I don't know if you will need the whole code to see what the problem is. It is lengthy, so I will start with just where the problem is. Set rs = DBEngine(0)(0).OpenRecordset("SELECT T2.Distance, T1.* FROM (Church AS T1 INNER JOIN qryChurchZip1 ON T1.ChurchID = qryChurchZip1.ChurchID) INNER JOIN DistanceQuery AS T2 ON qryChurchZip1.Zip5 = T2.ZIPCode WHERE " & strWhere) ' See if found none If rs.RecordCount = 0 Then MsgBox "No Churches meet your crite...

HTA problem with IE8
We discovered an issue with some inbedded VBScript code inside an HTA written by a developer that is no longer with us. The code work in IE6 but error out on the set objMsgArea statement indicating that the object requires 'objMenuFrame' which should have been set in the previous line of code. If I put in an 'On Error Resume Next" statement in that sub the HTA appears to work correctly however I don't like putting a band-aid on something like this. Does anyone have any solution for this? Here's the code: sub AppStatusDisplay(strMsgIn, bolAddToStatusLogIn) s...

Sending email in CRM web app problem
Hi, I found this problem very annoying. Our CRM's SMTP service is hosted in YahooMail. The SMTP address is mail.bizmail.yahoo.com and this is a "locked down" server, which means required authentication by username and password. I configured the CRM server's registry by settings the SMTPServerUrl and other stuff, such as Username and password entries. Now, when we send emails from CRM web app, it works... BUT... when we send email using a template which has embedded images, it cannot send the email and reports an error: "Not valid association" something... A...

Problem with 07 Office Pdf/Xps Add-in
Hello Despite having installed the 2007 Office SaveAs Pdf/Xps add-in, I have seen Mary Sauer's posting on this somewhere asking if it in the Add-in of the Office programmes. I do not see it any of the programmes even though I have reinstalled twice with genuine validation. Anything else I can do? Thks. Menk It's like a printer...you print to it. -- ~~~~~~~~~~~~~~~~~~ Rob Giordano Microsoft MVP Expression "Menikos" <menikos88@hotmail.com> wrote in message news:u2EEuVswIHA.4564@TK2MSFTNGP06.phx.gbl... > Hello > > Despite having installed the 200...

Unable to deliver the message due to a recipient problem #3
Hi can anybody help. I check with varies newsgroup but to no scucess. like for example below When you send mail to an X.400 personal address book (PAB) entry or one-off address, you may receive the following non-delivery report (NDR):... However, this one-off entryis not active in our server. ...

CRM 4.0 CTP 3 Workflow problems
I'm trying to create a workflow that triggers on Status Change to the Quote Entity, which will create a new task. When I publish the workflow, and then try to do anything with a quote, I receive an error: You cannot switch the execution context's caller if the context is impersonating the system user. Has anyone else seen this in 4.0, and does anyone know what can be done to fix it? Thank you, Brett Whats the role of the user that has published the workflow? Whats the role of the user that is trying to perform action on the quote? If you unpublish the workflow, does the action ...

Application wide transaction scope?!
Any ideas about using single transaction across pages of an application? Thank you Regards Raj "Raj" <Raj@discussions.microsoft.com> wrote in message news:C9A5960D-0181-47D5-A3DE-8F6D342427D7@microsoft.com... > Any ideas about using single transaction across pages of an application? > > Thank you > > Regards > Raj Yes. Do them as logic transactions rather than database transactions. IE hold your data in memory in a collection of some sort - a list or two lists or a dataset. Then write them to the database in one go. Holding a databa...