[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.4

Problem with UpdateResource

Asked by makctg in Windows MFC Programming

Tags: updateresource, problem, beginupdateresource


Hi

I am trying to add html pages from one application-myModifierApp to myReaderApp
using UpdateResource functions.


myReaderApp's view class is derived from CHTMLView class.
With it are included some pages which run quite fine.

Problem 1

THe problem is when I am adding html say price.html from myModifierApp to  myReaderApp
all the existing resources of  myReaderApp  are deleted and only price pages is added.

Problem 2
Then the reader application does not run. Show me the Msg as "Unrecognised Document Format"

Problem 3

I have modifed the myReaderApp to read price.html page
on its   OnInitialUpdate Function
as
void my1stAppView::OnInitialUpdate()
{
     CHtmlView::OnInitialUpdate();

     // TODO: This code navigates to a popular spot on the web.
     
        LoadFromResource ("PRICE");


}

Show me the Msg as "Unrecognised Document Format"



What is the solution.?


Below is the code to add html resouces
-----------------------------------------------


void CMod2Dlg::OnButton1()
{
     // TODO: Add your control notification handler code here


 

HANDLE hFile;
DWORD dwFileSize,dwBytesRead;
LPBYTE lpBuffer;


hFile = CreateFile("C:\\price.html", GENERIC_READ,
                   FILE_SHARE_READ,  
                   NULL,
                   OPEN_EXISTING,
                   FILE_ATTRIBUTE_NORMAL,
                   NULL);
 
     if (hFile != INVALID_HANDLE_VALUE)
     {
// GET FILE SIZE
                   
               dwFileSize=GetFileSize(hFile,NULL);
               // GET THE BUFFET SIZE
               lpBuffer= new BYTE[dwFileSize];

                    // READ FILE INTO tTHE BUFFER
               if(ReadFile(hFile,lpBuffer,dwFileSize,&dwBytesRead,NULL)!=NULL)
               {


               }

               //relase the file
               CloseHandle(hFile);


               }


//Add the File to FirstApp
HANDLE hWnd;

hWnd=BeginUpdateResource("E:\\VC\\Reader\\Debug\\Reader.exe",FALSE);

if (hWnd!=NULL)
{

     if( UpdateResource(hWnd,RT_HTML,"PRICE", MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),lpBuffer,dwFileSize) != FALSE)
          {
               EndUpdateResource(hWnd, FALSE);
          }
     else

     {
          MessageBox("Failed to Add The File");
     }
}




}



 
Related Solutions
 
Loading Advertisement...
 
[+][-]12/27/05 05:27 AM, ID: 15555400Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/27/05 06:52 AM, ID: 15555786Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/27/05 09:19 AM, ID: 15556689Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/27/05 10:21 PM, ID: 15560928Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/28/05 12:20 AM, ID: 15561223Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Windows MFC Programming
Tags: updateresource, problem, beginupdateresource
Sign Up Now!
Solution Provided By: mahesh1402
Participating Experts: 1
Solution Grade: A
 
[+][-]12/28/05 12:51 AM, ID: 15561293Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89