|
How to save the webpage on WebBrowser Control to file?
A lot of function for WebBrowser control such as GoBack,GoForward,GoHome,Navigate,etc... but no function for save it.
Please give me some idea for implement this function.
Thanks
|
|
|
|
|
Here is an article on how it can be done - Retrieving the HTML source code[^]
Since you're using a browser control you will need to call its get_Document method instead of GetHTMLDocument .
I also recommend that you use the ATL smart pointer classes like CComPtr and CComQIPtr .
Look at the Comments and Discussions section at the end of the article on other ways to do this.
|
|
|
|
|
|
Hi!
I've 8 jpeg images. I've to position it at 200 different places. For positioning I've a function called setPosition(vector3df). I don't want to copy the images to 200 times. How to place the same eight images at 200 different positions? Can anybody help with piece of code?
|
|
|
|
|
for(int i=0;i<200;i++)
{
for(int j=0;j<8;j++)
{
myImagesVect.at(j).setPosition(getRandomPosition());
}
}
Push Framework - now released !
http://www.pushframework.com
|
|
|
|
|
I have a MFC based dialog compiled with _UNICODE and all works well. Now I want to add a CEdit control and have it support Ansi text instead of unicode. That is, I want the CEdit control to accept ascii test and retrieve ascii text instead of unicode. Can this be done and if so, how?
|
|
|
|
|
Why don't you do the conversion upon the retrieved text ?
Push Framework - now released !
http://www.pushframework.com
|
|
|
|
|
I did not ask how to do a conversion. Please read the question!
|
|
|
|
|
And I did not show you how to do a conversion, rather I suggested to do a conversion as a way to solve your problem. Please understand my answer!
Push Framework - now released !
http://www.pushframework.com
|
|
|
|
|
If you have a subsclassed CEdit control, you could limit the allowed input to the standard ASCII characters. That way any text retrieved even though UNICODE would still all be in the ASCII range.
Some clever stuff may have to be done to handle copy/paste etc but I would think such a method would be workable.
If you vote me down, my score will only get lower
|
|
|
|
|
when i am using CdaoDataBase in main application and close it ,it works success
but when i used cdaodatabase class in thread and close database and after that close application. it gives error. daocore.cpp line 40
m_Daoworkspace.release();
|
|
|
|
|
Shivanand Gupta wrote: it gives error.
Are we somehow supposed to guess what that error is? Have you put a breakpoint on line 40 of daocore.cpp and used the debugger to look at the code?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
i have check by breakpoint. error occur when we close the application where CdaoDatabase class used in thread .
|
|
|
|
|
Shivanand Gupta wrote: error occur...
What error?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
when we close application then applicationn perform this line of code (daocore.cpp file)
// Clean up engine object if necessary
if (pDaoState->m_pDAODBEngine != NULL)
{
pDaoState->m_pDAODBEngine->Release(); //error ouccr in this line
pDaoState->m_pDAODBEngine = NULL;
}
|
|
|
|
|
Shivanand Gupta wrote: pDaoState->m_pDAODBEngine->Release(); //error ouccr in this line
Ok, but what's the error? Is it an assertion, an exception, or something else?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi,
i have done to change edit control backgtound & text color when it is enable, with the help of onstlcolor,
but my edit control is disable then i try to change color but color is not changing
|
|
|
|
|
When an edit control is disabled, it acts like a static control.
So in OnCtlColor method, check nCtlColor parameter for CTLCOLOR_STATIC .
|
|
|
|
|
I have a swf. How can I read swf version in MFC?
I can read my exe version using
CString Version::getFileVersion(LPCTSTR file)
{
CString version;
VS_FIXEDFILEINFO *pVerInfo = NULL;
DWORD dwTemp, dwSize, dwHandle = 0;
BYTE *pData = NULL;
UINT uLen;
try {
dwSize = GetFileVersionInfoSize((LPTSTR) file, &dwTemp);
if (dwSize == 0) throw 1;
pData = new BYTE[dwSize];
if (pData == NULL) throw 1;
if (!GetFileVersionInfo((LPTSTR) file, dwHandle, dwSize, pData))
throw 1;
if (!VerQueryValue(pData, _T("\\"), (void **) &pVerInfo, &uLen))
throw 1;
DWORD verMS = pVerInfo->dwFileVersionMS;
DWORD verLS = pVerInfo->dwFileVersionLS;
int ver[4];
ver[0] = HIWORD(verMS);
ver[1] = LOWORD(verMS);
ver[2] = HIWORD(verLS);
ver[3] = LOWORD(verLS);
if (ver[2] != 0 || ver[3] != 0)
{
version.Format(_T("%d.%d.%d.%d"), ver[0], ver[1], ver[2], ver[3]);
}
else if (ver[0] != 0 || ver[1] != 0)
{
version.Format(_T("%d.%d"), ver[0], ver[1]);
}
delete pData;
return version;
}
catch(...) {
return _T("");
}
}
|
|
|
|
|
So what exactly is the problem you are seeing? Does the code you've shown work? If not, what is it (not) doing?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
That function works with exe file format. SWF's file format is different from that.
See here [^]
***** Dumping SWF File Information *****
----- Reading the file header -----
FWS
File version 3
File size 741
Movie width 550
Movie height 400
Frame rate 12
Frame count 10
I guess after getting this link I will be able to fetch the version. Now going to try this.
|
|
|
|
|
Have you tried something like:
struct header
{
char sig1;
char sig2;
char sig3;
char ver;
};
void main( void )
{
FILE *pFile;
pFile = fopen("c:\\i386\\intro.swf", "rb");
if (pFile != NULL)
{
header h;
fread(&h, sizeof(header), 1, pFile);
fclose(pFile);
}
}
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
hi,
how do i move files and directories with its children, in a directory, in to another directory, in another drive?
the MoveFileEx function, moves directories in same drive. but different drive ...?
please help me.
Zo.Naderi-Iran
|
|
|
|
|
zon_cpp wrote: MoveFileEx function, moves directories in same drive. but different drive ...?
Are you sure? The following sentence in MoveFileEx documentation[^]:
If a file is moved across volumes, MoveFileEx does not move the security descriptor with the file. The file is assigned the default security descriptor in the destination directory.
make me think you actually can.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
i tested MoveFileEx function. it can not move directory in different drive, with LastError = 5
Zo.Naderi-Iran
|
|
|
|