yet another resource editting thread

I need to edit resources at runtime (i.e. the string table, menus, and
dialog control sizes).  I would like to use the BeginUpdateResource,
UpdateResource, and EndUpdateResource functions.

One of the problems I have is this:
If I load the menu from file with FindResource, LoadResource,
LockResource, I have the binary menu data, and I can't really
manipulate raw binary.
If I load the menu with LoadMenu, i have a CMenu, that I can change
but I don't know how to convert the final menu back to binary data
that I would update with the UpdateResource command.
So, how do you update?

Another question is: with UpdateResource, the last parameter specifies
the size of the new menu/dialog/whatever, but how would you get this
size?  I know of the SizeOfResource function, but that returns the
size of the resource I want to REPLACE, whereas I need the size of the
resource I want to replace it WITH.

Any snippet of sample code would be extremely helpful and appreciated.
 I have looked at the "Using Resources" example on msdn, but that
example copies an already binary dialog box from one resource dll to
another.  What I need is the conversion from the template structure to
binary data.

Thanks!!!!
0
floobles (5)
11/8/2004 7:38:29 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
712 Views

Similar Articles

[PageSpeed] 32

On 8 Nov 2004 11:38:29 -0800, floobles@gmail.com (floobles) wrote:
>I need to edit resources at runtime. (i.e. the string table, menus, and
>dialog control sizes).  I would like to use the BeginUpdateResource,
>UpdateResource, and EndUpdateResource functions.
>One of the problems I have is this:
>If I load the menu from file with FindResource, LoadResource,
>LockResource, I have the binary menu data, and I can't really
>manipulate raw binary.

I think you can, and you're supposed to. The MSDN topic "Resource File
Formats" describes it. I wrote code for injecting bitmaps and icons
and strings onto an EXE's resource table using this information.
(actually, I avoided BeginUpdateResource &c. and wrote in pure
portable C++, for a unix web server which delivered customised
executables.)

--
Lucian

0
lu.nn (2)
11/8/2004 10:15:57 PM
Reply:

Similar Artilces:

copy a number typed in a cell to another & change it to word form.
There are instructions in the following MSKB article: How to convert a numeric value into English words in Excel http://support.microsoft.com/default.aspx?id=213360 "ex:1 in a cell = one in a different cell" wrote: > ...

How do I edit the subject line of emails that I've received?
I used to be able to edit the subject line of my received emails that are in my Inbox. Some people do not know how to compose a helpful subject line. :) Somehow I hit the wrong key or the wrong button, and now my ability to edit is gone. I can't figure out how to do it again, and I can't find it in Help topics. I might not be searching for the correct phrase, though. Any help would be SO appreciated. Thanks! Reply to the email, change the Subject line and then close it, saving the changes. "e11en" <e11en@discussions.microsoft.com> wrote in me...

ODBC ms Query will not edit saved query
Hello, I am using Excel to query an Oracle database. When using Excel 97 and Windows95/98 all saved queries worked fine. After upgrading to Windows2000 and Excel 2000 queries will refresh data, but we cannot edit the queries. When we choose "get external data / edit query" MSQuery appears to flash on the screen for a split second and then vanish. I have created system DSNs as instructed by Microsoft Knowledge Base Article - 322046, but it did not correct the problem. Any suggestions would be greatly appreciated. THANKS, David ...

Assign mailbox to another user
Windows Small Business Server 2003 i had an employee recently leave full-time status. i deleted her as a user since she didn't need to recieve email on that account anymore. problem is, she needs a bunch of info in the mailbox since she does a minor amount of consulting for us. how can i at least reattach her mailbox to a user or login so she can retrieve her mail? i tried adding her as a user and using the Reconnect exchange task but it won't show her account when i search for it. TIA! Chris you created a new account and connected the mailbox to that account? it should sh...

Leveling Team Resources
How can Team Resources (usefully) be leveled? I think Dale's comments in Team Assignment may indicate that this is practically impossible ... since the Team Resource apparently can't be used for availability. We dynamically schedule. We want to assign a generic Team resource to tasks early in the project because we are primarily concerned with feasibility. Later we will elaborate and assign specific resources from the team. When we level, the Team Resource seems to be treated no differently that any other individual resource. It seems to have no knowledge of the wo...

Bulk Resource Substitution in Project Server 2007
Which is the best way to do bulk resource substituoun? For example, a user is a resource in many projects. He is retired. A project manager must substitute this resource with another one. Is there any way to do it automatically? I mean the Project Manager chooses projects in which the resource is assigned to tasks and substitutes them with another resource. egoncharov -- No, there is no automated way to perform the resource substitution, even using the Resource Substitution Wizard. The PM needs to open each project and manually substitute the new resource for the former reso...

Meet yet another resident MVP
http://office.microsoft.com/assistance/preview.aspx?AssetID=HA011172901033&CTT=4&Origin=CH010503491033 -- Brian Kvalheim Microsoft Publisher MVP http://www.mvps.org/publisher ~pay it forward~ This posting is provided "AS IS" with no warranties, and confers no rights. Isn't he cute??? -- JoAnn Paules MVP Microsoft [Publisher] "Brian Kvalheim - [MSFT MVP]" <bkvalheim@publishermvps.com> wrote in message news:OyJA%23B2QEHA.3732@TK2MSFTNGP10.phx.gbl... > http://office.microsoft.com/assistance/preview.aspx?AssetID=HA011172901033&CTT=4&Origi...

copy a row of data to a column in another workbook?
I am trying to get the data i enter into my charity subscription workbook, to be automatically updated in my gift aid register (workbook) so that i do not have to input twice. The data is entered into the subs register in rows and the gift aid register is entered in columns. Any ideas would be appreciated. hi, =('H:\CodeStuff\[ConnectPaths.xls]Sheet1'!D4) a formula like this in your gift aid register wb will draw the data over from your charity subscription wb. I don't know your file paths so you will have to change it to fit your set up. in the gift aid register wb, put the ...

HELP! Copy a Data Series to Another Graph?
Hi- I'm using Excel 2002 and I've got a lot of graphs, all of which are based on a common spreadsheet and all are VERY similar. When I add a new data series to one graph, it would be wonderful if there was a simple way to copy this data series to the other graphs. Can it be done? (Now I add the new line to the first graph. Then I copy the X-values from the first graph, open the second graph & paste, re-open the first graph and copy the Y-values, re-open the second graph & paste, third graph, fourth graph, etc., etc., etc.......) Just make the series refer to a defined na...

publisher, wrong edition?
im trying to open a file i made in publisher at college but when i try and open it at home off my pen drive its saying i can open the file from another version, is there anything i can do? At college, save the file in the version of Publisher you have at home. -- Don Vancouver, USA "jessica" <jessica@discussions.microsoft.com> wrote in message news:7222AD16-3FE4-447C-B239-FB4A48E1DF1A@microsoft.com... > im trying to open a file i made in publisher at college but when i try and > open it at home off my pen drive its saying i can open the file from > another &g...

Can't open a Publisher 2K file in Publisher 2002, edit text only .
Why can't I open an existing Publisher 2000 file with Publisher 2002, then make minor text edits and re-save the file in Publisher 2000 without getting the error message, "There is a picture on page 1 that is too large to be converted to previous versions of Publisher." Publisher 2000 did not use compression... PUB2000: File Size Increases Unexpectedly When You Insert Picture http://support.microsoft.com/default.aspx?scid=kb;en-us;253973 -- Mary Sauer MS MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Art Frustrated with Publisher...

Concurrency with threads?
I was hoping to get some insight into how best design for concurrency in my program. I'd basically like to send a data object to various funtions simultaneously without waiting for their returns. Please correct me if I'm wrong, but it seems the best way to do this would be with threads. The application I'm writing receives messages from a server and then feeds them off to other class functions that need to use the data simultaneously. Below is what I'd like to avoid, as one function must execute and return before the next one is run. void DataManger::OnGotSomeData(DataO...

TILE can help you to edit RMS or POS 2009 items in seconds
TILE can make the task of record editing and updating extremely easy. With TILE, you will simply open your RMS records in a grid-like view (as we have in MS-Excel), quickly apply one or more filters, use your mouse to select the records, right-click, enter the desired value and update. All 100 records will be updated in a flash! For details, visit: http://www.24sevencart.com/tile.htm On Apr 22, 4:55=A0pm, Mark Antonio <antonio.mark...@gmail.com> wrote: > TILE can make the task of record editing and updating extremely easy. > With TILE, you will simply open your RMS recor...

Custom Context Menu for Edit Control
Hello all .. I have a control bar class, CTextBar, derived from the child of CControlBar which uses an edit control (CTextEdit derived from CEdit). And i want to create a custom context menu for the edit control with Copy, Selectall and Wordwrap. My wordwrap implementation is kind of not perfect and i feel it could be done better. However, currently i use something like destroying the edit control and recreating it with the right flags set to make the wordwrap effect, as in a notepad. This implementation has a disadvantage because it needs a pointer to its parent window (in this case, the CCo...

Can't "edit" underlined value in Rules Wizard screen
Running Outlook 2002. I go to Tools, Rules Wizard, and highlight an email filter called Junk Email. The filter works well, no problem. However, I want to delete some email addresses from that particular filter. The instructions over the lower half of that display say "click on an underlined value to edit it." However, clicking on the "Junk Senders" value does not open it. What do you think is wrong? All the other values in all the other filters in Rules Wizard will open and allow me to edit them. Marc ...

HELP! Outlook 2007: 'Out of memory or system resources' Issue
I am desperately trying to locate Diane Poremsky [MVP] who responded to another user re making a new profile, or another MVP, or anyone that can help with my original post as follows! Diane-- Your suggestion re making a new profile as I have a different issue in that I'm using OL 2007 on Vista Ultimate, not Win 7, & have encountered out of the blue the dreaded 'out of memory or system resources' issue. I saw you respond to someone using Win 7 & had my issue via Google but I couldn't find the thread here. Anyway, can you provide me wth specific stepwise ...

Money 2001 Small Business Edition (UK)
Hi, I have lost my Money 2001 CD which I got with my Dell laptop back in 2001, and have been running fine ever since. I installed some software which is now forcing Money to reinstall itself, and I cannot find my CD. So I need to upgrade (which is fine), but which version support the old 2001 Small Business edition? Many thanks, Hi I managed to find out that the version is Personal and Business, not Small Business. Can anyone offer some advice as to which versions are compatible with which? I simply need to access my personal account transactions as the business side was never us...

update one field from another
I know this will probably be an update query but my problem is how to. When I imported several hundred rows from my EXCEL sheets they did not have one of the fields we needed, the field "Location" in my table "Events" now how do I fill the "Location" field by whats in my "Code" field in my "Events" table. My Code field has 40 different codes and these codes have a specific location here how can I have COD put in the "Location" field when the "Code" field has 100SW in it. I am using ACCESS 2003. On Mon, 1 Oct 2007 06:...

how do i set up an email account for another user on same puter
would like to know if a second user email account could be set up in office outlook Sure... what is the 'puter'? You could probably do this at the OS level. XP offers multiple users so they each get their own desktop and settings. Otherwise, you can have multiple profiles and be prompted for which profile to use in Outlook. http://office.microsoft.com/en-au/assistance/ha011471581033.aspx "barb567" <barb567@discussions.microsoft.com> wrote in message news:FF1D28E3-2000-4F91-9CB7-390B7F21B0A0@microsoft.com... > would like to know if a second user email accoun...

Hide a modal dialog by a thread
Hi all I am writing an application, using a module. And that module show a modal dialog when i run my app. Now i want to create a thread in my app, that thread will check if that module display a modal dialog, then my thread will hide that dialog. Any way to do this? Pls let me know if you know. Thanks very much. "Duy Trinh" wrote: > Hi all > > I am writing an application, using a module. And that module show a modal > dialog when i run my app. Which module do you speak about? Module is a broad concept.. Perheps you mean a dll?? > Now i want to create a...

Editing an Automatically Sent Message
We have a user that setup a message to automatically be send each Monday. They now wish to edit that message, problem is, I cannot seem to find it. It doesn't even show up in her sent items. I am sure it is an easy fix, but it has alluded me. Any help would be greatly appreciated. Thanks Mark Winning Systems Administrator Martin Memorial Health Systems ...

Reflect cell contents into another worksheet #2
I have forgotten how to reflect data that is present in one worksheet cell into a specific cell of a second worksheet. IOW, repeat cell contents in a second worksheet. I simply do not make use of MS Excel97 often enough to remember the procedures ! Please help. Regards, ~ Vince ~ hi on sheet 2 in your specific cell put this =sheet1!A1 regards FSt1 "Vince" wrote: > > I have forgotten how to reflect data that is present in one worksheet > cell into a specific cell of a second worksheet. IOW, repeat cell > contents in a second worksheet. > > I simply do not...

resource error mesage
On on e resource in the resource sheet i get the highlight that i should be levered based on a Day to day seeting- What do i need to do? -- Petra Petra, The message is an indication that the resource is overallocated -- or has more work assigned than the resource can do. The first thing is to use Project to help you discover what precisely is causing the issue and then you decide whether you wish to fix it and how. Show the Resource Management toolbar and on click the "Resource Allocation" button to show the Resource Allocation view -- Resource Usage view ov...

multi-threaded control not destroyed on exiting the page?
I have created an ActiveX control (subclassing COleControl) which uses the afxRegFreeThreading model, and I have a small sample web page which inserts the control using an <object> tag. I noticed that when my page places the control inside the <head> tag, the control's destructor is called when my browser goes to a different page. But if the control is inside the <body> tag, the destructor is not called when I leave the page. The control's destructor is eventually called when I exit my browser, but I fear that my control is continuing to occupy system resources unt...

terminate a thread from another one
Hi All, I have a worker thread (used AfxBeginThread) performing a lengthy operation. I want to give the user an option of stopping the process. This should terminate the worker thread. An option would be to use some class-level flag in an if statement and call AfxEndThread() . Is there not another way to do this, e.g communicating between threads. If yes, some sample code would be most helpful. Many thanks Since your worker thread is a loop, you should just exit out of the loop. You don't have to call AfxEndThread to end a worker thread. So set a flag in the worker threa...