also follow links i have given you here..
http://www.experts-exchang
MAHESH
Main Topics
Browse All TopicsI have two appl
--my1stApp
--my2ndApp
From my2ndApp , I am adding a html file ( price.htm) to my my1stApp ( see the code below) .
all I need to have the resouce ID as "PRICE" insead of numeric value
can I add writting -----
UpdateResource(hWnd,RT_HTM
What should I write here for having the resource id as "PRICE"
from My first Application my1stApp- which view class is derived from CHTMLView
I want to read the html resource from its onInitialUpdate
void my1stAppView::OnInitialUpd
{
CHtmlView::OnInitialUpdate
// TODO: This code navigates to a popular spot on the web.
LoadFromResource ("PRICE");
}
Right now it not working , what should I do
code :adding a html file ( price.htm) to my my1stApp
--------------------------
HANDLE hFile;
DWORD dwFileSize,dwBytesRead;
LPBYTE lpBuffer;
hFile = CreateFile("C:\\price.html
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
if (hFile != INVALID_HANDLE_VALUE)
{
// GET FILE SIZE
dwFileSize=GetFileSize(hFi
// GET THE BUFFET SIZE
lpBuffer= new BYTE[dwFileSize];
// READ FILE INTO tTHE BUFFER
if(ReadFile(hFile,lpBuffer
{
}
//relase the file
CloseHandle(hFile);
}
//Add the File to FirstApp
HANDLE hWnd;
hWnd=BeginUpdateResource("
if (hWnd==NULL)
{
if( UpdateResource(hWnd,RT_HTM
{
EndUpdateResource(hWnd, FALSE);
}
else
{
MessageBox("Failed to Add The File");
}
}
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
also follow links i have given you here..
http://www.experts-exchang
MAHESH
http://msdn.microsoft.com/
http://msdn.microsoft.com/
http://msdn.microsoft.com/
MAHESH
Hello MAHESH
pls examine my code given above
I would like to add a resource thru code
UpdateResource(hWnd,RT_HTM
>>>Try giving the resource a string name instead of a numeric identifier. this is done by openiing its 'Properties' box and wrapping its 'ID' in quotes.
>>>eg. So PRICE becomes "PRICE", and aaa becomes "aaa".
how can I accomplish this that is giving the resource a string name instead of a numeric identifier thru code
while I am adding the resource
looking for yoyur kind help
UpdateResource(hWnd,RT_HTM
it seems there is no problem in your above code..
this link is having 2 good exmaples of it.....
http://msdn.microsoft.com/
MAHESH
i got err ms
------------------------
--------------------Config
E:\VC\Mod2\Mod2Dlg.cpp(260
Conversion from 'void*' to pointer to non-'void' requires an explicit cast
----------------------
whats wrong with the code
HANDLE hExe;
HRSRC hRes; // hand of the Re
// TODO: Add your control notification handler code here
//Load the EXE -EBOOK.exe
hExe=LoadLibrary("E:\\VC\\
if (hExe==NULL)
{
MessageBox("Error");
}
// FIND THE RESOUCE PRICE
hRes = FindResource(hExe, "PRICE",RT_HTML);
if (hRes == NULL)
{
MessageBox("Could Not Locate the File");
}
No error.
But I am not gettting desired result
Pls examine the Code below
From button 1 click event , I have added a resource
Form button2 click event , I am trying to open it I am not getting the desired result.
hRes = FindResource((HINSTANCE)hE
if (hRes == NULL)
{
MessageBox("Could Not Locate the File");
}
I am getting msg
What is the wrong with it
--------------------------
void CMod2Dlg::OnButton1()
{
// TODO: Add your control notification handler code here
HANDLE hFile;
DWORD dwFileSize,dwBytesRead;
LPBYTE lpBuffer;
hFile = CreateFile("C:\\price.html
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
if (hFile != INVALID_HANDLE_VALUE)
{
// GET FILE SIZE
dwFileSize=GetFileSize(hFi
// GET THE BUFFET SIZE
lpBuffer= new BYTE[dwFileSize];
// READ FILE INTO tTHE BUFFER
if(ReadFile(hFile,lpBuffer
{
}
//relase the file
CloseHandle(hFile);
}
//Add the File to FirstApp
HANDLE hWnd;
hWnd=BeginUpdateResource("
if (hWnd==NULL)
{
if( UpdateResource(hWnd,RT_HTM
{
EndUpdateResource(hWnd, FALSE);
}
else
{
MessageBox("Failed to Add The File");
}
}
}
void CMod2Dlg::OnButton2()
{
HANDLE hExe;
HRSRC hRes; // hand of the Re
// TODO: Add your control notification handler code here
//Load the EXE -EBOOK.exe
hExe=LoadLibrary("E:\\VC\\
if (hExe==NULL)
{
MessageBox("Error");
}
// FIND THE RESOUCE PRICE
// Locate the dialog box resource in the .EXE file.
hRes = FindResource((HINSTANCE)hE
if (hRes == NULL)
{
MessageBox("Could Not Locate the File");
}
}
But
I am adding from Button1 Click Event
void CMod2Dlg::OnButton1()
{
// TODO: Add your control notification handler code here
HANDLE hFile;
DWORD dwFileSize,dwBytesRead;
LPBYTE lpBuffer;
hFile = CreateFile("C:\\price.html
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
if (hFile != INVALID_HANDLE_VALUE)
{
// GET FILE SIZE
dwFileSize=GetFileSize(hFi
// GET THE BUFFET SIZE
lpBuffer= new BYTE[dwFileSize];
// READ FILE INTO tTHE BUFFER
if(ReadFile(hFile,lpBuffer
{
}
//relase the file
CloseHandle(hFile);
}
//Add the File to FirstApp
HANDLE hWnd;
hWnd=BeginUpdateResource("
if (hWnd==NULL)
{
if( UpdateResource(hWnd,RT_HTM
{
EndUpdateResource(hWnd, FALSE);
}
else
{
MessageBox("Failed to Add The File");
}
}
}
I will suggest you to test your executable file after adding resource.. I will suggest you to use tool like PE Explorer or Resource Hunter to browse all resource in exe/dll.. its here..u can download
http://www.boilsoft.com/rc
http://www.pe-explorer.com
with this u can cross check if your exe file is really importing a resource from ur code..
MAHESH
I have also tired with the following
I have added a HTML file in my first app . Manually from the Property Sheet gave it the name as "INDEX"
While trying to read it
as hRes = FindResource((HINSTANCE)hE
I can read it
and also can successfully Read ABOUT DIALOG BOX
hRes = FindResource((HINSTANCE)hE
So it is assumed that While I am trying to add the "PRICE" html file , It not added
How can I check it whether it is added or not
code to add the Price.html is
UpdateResource(hWnd,RT_HTM
I have downloded the PE explorer.
I donot find any entry for my Price.html in the resources of the application (E:\\VC\\Ebook\\Debug\\Ebo
What is the problem for my code for Adding HTML pages pls refer my code pasted in above comments
why such things are happening?
Why my code ,mentioned above, can not update the resource?
What should I do now?
looking forward to your kind help
I have uploaded the file here
www.webMarketReports.com/v
Here You will find two projects
one is Ebook, another is mod2
from mod2 , I am trying to add HTML file in BUtton1 event
and from button2 I test whether it is inserted or not
makctg ...
WHAT THAT ??? Man......
see here.....
HANDLE hWnd;
hWnd=BeginUpdateResource("
if (hWnd==NULL) <=========== ?????? it should if(hWnd!=NULL)
{
UpateResource......
}
DO YOU WANT TO UpdateResource() if hWnd==NULL ??? it should if(hWnd!=NULL)
check that now....
MAHESH
Business Accounts
Answer for Membership
by: mahesh1402Posted on 2005-12-25 at 00:45:24ID: 15548644
>What should I write here for having the resource id as "PRICE"
Try giving the resource a string name instead of a numeric identifier. this is done by openiing its 'Properties' box and wrapping its 'ID' in quotes.
eg. So PRICE becomes "PRICE", and aaa becomes "aaa".
MAHESH