Regarding Update Resource Problem

Hi All,

            Actually i have some problems in putting back the extracted
resources form an exe using the UpdateResource function.

I could extract all the contents of the dialog resource from the exe.I was
just trying to update them back to the exe facing some problems in it.Here
is the list of steps we have followed .

1.LoadLibrary -> Map the specified executable module into the address
space of the calling process.
2.EnumResource -> Check for the list of available resource
3.FindResource -> Find the specified resource.
4.LoadResource -> Load specified resource into global memory
5.LockResource -> Locks the specified resource in memory.

For Dialogs ->
6.CreateDialogIndirect ->Creates a modeless dialog box from a dialog box
template in memory and returns a window handle to the Dialog Box.

Data is extracted and edited from the window handle which is returned in
step 6.

We are facing problem in the UpdateResource :
7.BeginUpdateResource -> Returns a handle that can be used by the
UpdateResource.

8.UpdateResource -> UpdateResource function replaces a resource in an
executable file.

For step 8 we need to pass the raw binary data(i.e Convert the handle
received in step 6 back to the buffer received in step 5).

We are facing problem in step 8 converting the handle back to the buffer.

Pls help me if any one can solve out this problem.

Regards,

Amit.






0
amit.k (1)
5/28/2004 10:47:25 AM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
793 Views

Similar Articles

[PageSpeed] 27

I have not done that. But I would say step 6 is not needed.

Step 5 should return a read-only pointer. You need to copy it into another
memory for modification, after modification, pass to UpdateResource. Try to
do it in baby step. Copy the data, find a string, modify a single character,
UpdateResource, close up and see whether the resource is updated.

-- 
Feng Yuan (www.fengyuan.com)

This posting is provided "AS IS" with no warranties, and confers no rights.


> 5.LockResource -> Locks the specified resource in memory.
> 6.CreateDialogIndirect ->Creates a modeless dialog box from a dialog box
> 8.UpdateResource -> UpdateResource function replaces a resource in an
> executable file.


0
fyuan (9)
5/28/2004 6:45:42 PM
Reply:

Similar Artilces:

"Send and Receive" in regards to an Exchange account
We have an Outlook 2003 user setup with Exchange 2003, he also uses the client to access about a dozen POP accounts. When he clicks "send and receive" it seems to get stuck on the exchange account. It says "processing" and takes for ever. But "send and receive" isn't required to get Exchange mail, since it's always connected. Yet his Exchange mail comes in normally, with no delays. It's only when he uses "send and receive" that it seems to sit there forever. Has anyone seen this before? Or is there a way to not include the Exchange account wh...

Regarding Dynamic chart
Dear All I have problem in formula ans it was solved Mr. Max , now i am facing problem in Chart please do the needful . I am mention the my problem and the formula given by Mr.Max . In cell b1 my input value varies from 1-30 in e1 my input will be amount it varies assume 300000. i want formula in a5 to show 0 and a6 as 1 so on till i get the input in b1 .. and in c5 i need a formula =$e$1*((2*(a5/$b$1)^2-(a5/$b$1)^4) till same as in column based on the value in b1. wish you all a very happy new year -2010 in advance A B C D E ...

Failed Recent Updates and Error Code 80070490
Since yesterday my computer and me have been trying to install two Vista updates: Security Updates for Windows Vista (KB967723) and Updates for windows Vista (KB972145) and I get the Error Found Code 80070490 I have Windows Vista Ultimate. Please advise. Hello Octavio, 0x80070490 - ERROR_NOT_FOUND Corrupted System File; Need to perform an in-place upgrade or reinstall of the OS. How to use the System File Checker tool to troubleshoot missing or corrupted system files on Windows Vista or on Windows 7 <http://support.microsoft.com/kb/929833> Tell...

VBA problem to open a file which is allready opened
Hey guys After a horrible nights sleep, caused by spooky VBA macro-gosts that are harassing me and chasing me through the bright and flowering fields of Visual Basic and into the dark woods of soul-searching lack of VBA-qualifications, I have no other choice than ask You to conjur one of these small devils in mind, by helping me solve my VBA-problem: I try - and manage (hurray!!) - to create a macro that copy a specified range from one workbook, then open a specified new one and finaly paste the data (pluss - of course - do some other stuff) into this predefinied workbook/sheet. My problem i...

Problem with Smart Tag
Using WinXP SP3 and Excel 2003. Have a column with financial symbols and Smart Tags enabled. All Smart Tags work. Entered in the symbols column another valid symbol but Smart Tags doesn't seem to recognized it no matter what I do. I search the KB and am doing everything right. What might be the problem? Thanks, Nathan Nathan, did you ever figure out how to get this working? I am having the same problem. A 2003 excell file will not read all stock symbols. thanks "Nathan" wrote: > Using WinXP SP3 and Excel 2003. > Have a column with financial symbols and Smart Tags en...

backgroundworker button updates
hello, as i work through upgrading and converting some old VB application to C#. i'm finding that i need to add threading. i'm using backgroundworker as the method to do so. i'm running into and issue where i was attempting to do windows form button updates like enable, disable and text. i'm using multiple class.cs files to make the code better to manage but i ran into issues where i can get the code to update the buttons states and text but they don't appear to display the changes. and it became a nightmare to debug the project would hit the breakpoint ...

Elements Gallery doesn't update...
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: intel Hallo! When I click to the item in Elements Gallery in any Office application, for instance "Charts", the Elements Gallery opens. After second click to the same item the Elements Gallery closes and turns to white strap... Does anyone have the same problem? On 5/6/08 4:16 PM, in article 59b4d00d.-1@webcrossing.caR9absDaxw, "Andrey_Kazak@officeformac.com" <Andrey_Kazak@officeformac.com> wrote: > Version: 2008 > Operating System: Mac OS X 10.5 (Leopard) > Processor: intel > > Ha...

Two critical updates failed to install. KB976416 and KB974561. Vis
-- I''m the richest man in the world without a dime in my pocket Is "Vis" in your subject line supposed to equate to "Vista"? Even if it is - perhaps shorten the subject line and increase the message body next time and give some better details that way. Those are office 2007 updates (InforPath and Word to be exact) - have you tried to download/install them individually? Description of the Office InfoPath 2007 update: December 08, 2009 http://support.microsoft.com/kb/976416 Description of the update for Office Word 2007: November 2009 http://s...

Does an UPDATE create a record???
Will an UPDATE query create the record if it is not in the table yet? My update says it runs with NO ERROR but yet there is no record in the table... Do I need to set up a SELECT and then an INSERT if the records do not exist first ??? On Tue, 11 Dec 2007 08:48:07 -0800, chemicals wrote: > Will an UPDATE query create the record if it is not in the table yet? > My update says it runs with NO ERROR but yet there is no record in the > table... > > Do I need to set up a SELECT and then an INSERT if the records do not exist > first ??? An Update query will only update dat...

regarding focus
Gurus, I have MDI MFC application . I click a menu item and a modeless dialog CPalette is created. void CMainFrame::OnToolsOpenpalette() I have added a variable to CMainFrame i.e. CPalette *mypal; Now real problem is When this dialog is displayed it gets all the focus and my main frame, view loses focus and there is some color change in the title bar of these windows. If focus gets to frame or view then dialogs loses focus and some color change occurs to dialog title. which is very irritating. I dont want this. I want the CPalette dialog to look like a component of MainFrame. There should...

problem about non-delivery reports
I have a problem about non-delivery reports. My user use=20 outlook 2000 (Exchange Server 2003) when they sent mail to=20 non-smtp e-mail address.they recieve message non-delivery=20 reports some user get message non-delivery reports=20 from "postmaster" (English Language) but some user get=20 message non-delivery reports from = "&#3612;&#3641;&#3657;&#3604;&#3641;&#3649;&#3621;&#3619;&#3632;&#3610;&#= 3610;"(Thai=20 Language).I do not understand.What's the problem occur=20 depend on ? How I can config for standard non-deliver...

Volume Problem in User Acct Only
Win XP Pro + SP3 + updates WMP 11.0.5721.5268 1 admin acct, several limited user accts I have a purchased audio CD that produces no volume in a user acct but plays correctly (with volume) in the admin acct. In the user acct I have checked all the volume controls, have run MS's troubleshooter utility, etc. No control that I can find is muted. In this user acct I can hear system alerts. Furthermore, with IE8 I can go to websites and play and hear videos. What can be blocking volume from a purchased audio CD that plays correctly in the admin acct? Isn't ther...

updatable query 05-31-07
I'm using the results of a select query as the creteria for another query's field. I am unable to edit any data for the second query's table. If I use a make table query and use that table for the creteria, I'm successfuly but have added another step. How can I make the first option feasable? And I don't seem to ever be able to get to the window that edits referential integrity/cascading. "sierralightfoot" <sierralightfoot@discussions.microsoft.com> wrote in message news:AB5A8B5D-DD0F-4359-8DE5-0F2775E7951E@microsoft.com... > I'm using the r...

Stopped getting automatic account updates
I have Monet 2004 with Passport Money password manager. I normally got all accounts updated plus latest Money program updates every time I logged in to passport and started Money. However this stopped a few months ago for no apparent reason. I cannot find any wrong settings, all accounts are enabled and set to update every day (I also tried every hour, which did not help). Thanks, Victor Could this be it: http://umpmfaq.info/faqdb.php?q=120? "vm60201" <vmonty@acm.org> wrote in message news:1134520163.431161.81980@g14g2000cwa.googlegroups.com... >I have Monet 2004 with P...

Benefit Amounts in HR are not updating Payroll or vice versa
We are currently using GP 10.0 SP3 with HR and Payroll (PR). Employer Portion is not rolling down from HR to PR or vice versa. Below are the steps that I have tried to change the amounts: 1. Went to Benefit / Deduction Summary Window (Cards | Payroll | Employee | GO TO Button | Human Resources | Ben/Ded Summary) 2. Double clicked on the Ben/Ded 3. This brought me to the Retirement Plans Enrollment Window (Cards | Human Resources | Employee – Benefits | Retirement Plans). 4. Changed the “After-Tax Dollar” amount. 5. Clicked Save 6. Answered Yes to “Do you want to set up the corres...

Automatic update of sheets
Hello, I am having a sheet with list of students and their active profile. I enter the marks for each subject for a month. This happens for the next month which is the next sheet. Suppose one student did not take the exam, he comes inactive and his name should not appear in the next months sheet. What formula should I use for this Thank you L Krishna Kumar Assume student names are listed in Sheet1's col A from row2 down with col B being the key col ("Marks") where any students absent will be marked as: abs In another Sheet2, In A2: =IF(Sheet1!B2="",&quo...

Explanation regarding code
Hello ! I am debugging a program wriiten by someone else in VC++. I have a doubt at a class definition. The code is something like given below: ********************************************************** class CT_pio : public CWinThread { DECLARE_DYNCREATE(CT_pio) protected: CT_pio(); public: // Override //{{AFX_VIRTUAL(CT_pio) public: virtual BOOL InitInstance(); virtual int ExitInstance(); //}}AFX_VIRTUAL // Implementation protected: virtual ~CT_pio(); DECLARE_MESSAGE_MAP() private: class PC_main *c_main_p; class CT_motor *c_motor_p; class CT_pio *c_pio_p; } I ha...

Updating Share Point list from within Excel
I have the need to update an existing SharePoint list within Excel using VBA code. Is this possible? Can somebody point me to some reference that can direct met on how to do it? I'm able to save workbook and create dashboard from that workbook. However, now I need to update custom fields in an existing list. Regards, OMER ...

Using the "Regarding" action in Outlook integration FAILS with
When i use the "regarding" action in Outlook integration and attempt to query a Campaign, I get an error message pop up "Error has occurred" and I get a grid refresh failed. Does this have to do with a customization that is causing the query to throw and exception? And how to I validate that? Ray Casey Hi Ray, activities cannoot be set regarding a campaign. There's a bug in CRM 4.0 that shows Campaigns in the Set Regarding list of entities -- but you'll get an error message if you attempt to use it. Campaign planning tasks and campaign activities and ...

Question Regarding Milestones Going Back to 0%
Hello, Does anybody know why this is happening or if there is a fix I can use? I’ve got a master project with several sub-projects in it. When I accept status updates from resources via PWA, all milestones that were 100% change to 0%. Does anybody know why this is happening or if there is a fix I can use? Thank you in advance! Tim ...

Money Delux requires a software update
I keep getting this popup. When I try to download the update it almost completes, but then there is some error because it says that the update was unsuccessful and then to check how much memory I have on my computer and try again. I try and it doesn't work. I have plenty of memory for the download. Help! The popup won't go away. Check the mny version under "help" and then "about microsoft" if the version is 17.0.150.1415 your mny software is already update it, that means that your user profile is the one that is causing this issue. "Jo" wro...

Updating Rates in 8.0
We recently upgraded to 8.0; now when the users try to update rates it requires the system password. Even though no password is set in Multicurrency Setup. I don't want the users to have access to the system password but I do need them to be able to update the rates themselves. Is there any way to solve this dilema? It worked fine in 7.5 - as long as I gave the user rights to Multicurrency Exchange Rate Maintenance, they had no problems updating rates. Any help appreciated. According to GP's TK, the issue is that it isn't prompting for a password in version 8: Qual...

Printing Postcards-MAJOR PROBLEM
Ok, so i'm trying to print 2 sided postcards. I'm also printing 3 on a paper. Well anyways i go to print the front side, everything works. i turn the paper over to print the back and make sure it is aligned. But it doesn't work, the sides aren't aligned!!! WHAT DO I DO??? and i can't keep on messing with it cause the paper i have is very expensive! PLease help! thank you Katrina How are you setting up the cards on your document? There is a way to setup a publication so it will print correctly back to back. You have to remember, anything that is on the left on the fron...

Outlook adress Book Problem
When creating a new Email, when I click on the Adress Book, To search through my Contacts, it sorts them according to first names, not last, which is causing me problems to find names, any ways to change this Few questions have been answered more often. Answer depends on your version which you did not bother to post. Find a post that matches your version. -- Russ Valentine [MVP-Outlook] "KBD" <kbd@thejnet.com> wrote in message news:cc63bd68-9b83-443e-95c3-ef72535bad6a@e15g2000vbe.googlegroups.com... > When creating a new Email, when I click on the Adress Book, To search ...

401(k) Unable to Update Retirement Account
In the past I have updated my retirement account via "Update Retirement Account" or "401(k) Manager" once a quarter. Since upgrading to Money Premium 2006 I noticed that my account could download my transactions online and directly within Money (not yodlee). Super! Each paycheck I check for updates, the appropriate buys are downloaded into "Investment Transactions" and my "Cash Transactions are updated to a zero balance. All the cash transactions are marked "R" (reconciled) but the investment transactions are marked "E". No pro...