|
Hi
Please suggest HTML supporting available in Visual C/C++
thanx in advance
by
KK
KK
|
|
|
|
|
Can you be more specific
you can use CDHtmlDialog class
or ChtmlView
|
|
|
|
|
kk.in wrote: Please suggest HTML supporting available in Visual C/C++
look for IHTML* interface
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
TO understand we create a sink to html element events and 'advise' it as follows:
bool Cembrowsersink::ConnectEvents(IHTMLElement* pElem)
{
HRESULT hr;
USES_CONVERSION;
IConnectionPointContainer* pCPC = NULL;
IConnectionPoint* pCP = NULL;
DWORD dwCookie;
IUnknown* pUnk =NULL;
// Check that this is a connectable object.
AtlTrace(_T("\nCheck that this is a connectable object."));
hr = pElem->QueryInterface(IID_IConnectionPointContainer, (void**)&pCPC);
if (SUCCEEDED(hr))
{
//AtlTrace(_T("Find the connection point."));
hr = pCPC->FindConnectionPoint(DIID_HTMLElementEvents2, &pCP);
if (SUCCEEDED(hr))
{
//AtlTrace(_T("create the instance of the element sink."));
hr=m_selem->QueryInterface(IID_IUnknown,(void**)&pUnk);
if(SUCCEEDED(hr))
{
//AtlTrace(_T("Advise the connection point."));
hr = pCP->Advise(pUnk, &m_dwCookie);
if (SUCCEEDED(hr))
{
AtlTrace(_T("Successfully advised"));
}
}
pCP->Release();
}
pCPC->Release();
}
return false;
}
When we run it against the htlml element collection on GOOGLE home page ,we find that there are certain HTML elements aganst which the sink could be hooked (HTML,HEAD,TITLE,,META,,CENTER,,TBODY) while others against which no connection point interface is found like STYLE,SCRIPT,BODY,TABLE,TR,FORM,INPUT.
What's the reason?
If I want to subscribe only to the events of the 'INPUT' html elements ,how do then i do it?
|
|
|
|
|
Your code could be simplified a little by using the ATL helper functions AtlAdvise and AtlUnadvise . Also, you can use the IEnumConnectionPoints interface to get a list of all connection points supported by an object; this has saved me a few times in the past when attempting to sink events in IE.
Steve
|
|
|
|
|
Thanks.But why do the 'INPUT' elements not report any connection point interface implemented?Is it a mistake on my part of there is some reason behind it.
Do not all the HTML elements publish connection points for event notifications?
|
|
|
|
|
Perhaps it does (implement a connection point) but you're just using the wrong value in the riid argument in your call to IConnectionPointContainer::FindConnectionPoint for the element in question - this has happened to me before. Use code something like this:
void LogConnectionPoints(IUnknown *pUnk)
{
CComQIPtr<IConnectionPointContainer> spCPC(pUnk);
if (!spCPC)
{
return;
}
CComPtr<IEnumConnectionPoints> spEnumCP;
HRESULT hr = spCPC->EnumConnectionPoints(&spEnumCP);
if ( FAILED(hr) )
{
return;
}
ULONG fetched;
CComPtr<IConnectionPoint> spCP;
while ( spEnumCP->Next(1, &spCP, &fetched) == S_OK )
{
IID iid;
hr = spCP->GetConnectionInterface(&iid);
if ( SUCCEEDED(hr) )
{
}
spCP.Release();
}
}
I may have made some syntax errors: I have used code like this before with IE and it has worked but this specific piece of code is off the top of my head and not tested. Once you log all the "iid"s supported for the element in question you can try every one and see which ones work and look them up in "mshtml.idl" to get their names.
Steve
|
|
|
|
|
Hi all,
I want to save each frame from a video file(.cam).I wrote the following coding to get the image.
<br />
CFile cf;<br />
CString filename;<br />
int xu_flag;<br />
BITMAPFILEHEADER xufileheader;<br />
char * xu_sp;<br />
long outputlen;<br />
<br />
<br />
filename = "c:\\temp\\test.jpg";<br />
xufileheader.bfOffBits = 54;<br />
xufileheader.bfSize = xu_newwidth * xu_newheight * 3 + sizeof(BITMAPINFOHEADER) +sizeof(BITMAPFILEHEADER);<br />
xufileheader.bfType = 0x4d42;<br />
xu_sp = new char [xu_newwidth * xu_newheight * 3+ sizeof(BITMAPINFOHEADER) + sizeof(BITMAPFILEHEADER)];<br />
outputlen = xu_newwidth * xu_newheight * 3 + sizeof(BITMAPINFOHEADER) + sizeof(BITMAPFILEHEADER);<br />
memcpy(xu_sp, &xufileheader, sizeof(BITMAPFILEHEADER));<br />
memcpy(xu_sp + sizeof(BITMAPFILEHEADER), xu_buff, <br />
(xu_newwidth * xu_newheight * 3 + sizeof(BITMAPINFOHEADER)));<br />
xu_flag = cf.Open(filename, CFile::modeCreate | CFile::modeWrite);<br />
cf.WriteHuge(xu_sp, outputlen); <br />
cf.Close();
But my problem is,I can able to catch only one frame at a time.But i need to save all the frames.
How do i acheive this?
help me please
sunita ramesh
|
|
|
|
|
Hi Sunita
Examples on Video available in MSDN CD at \SDK\GRAPHICS\VIDEO
Try
KK
|
|
|
|
|
Maybe I'm missing something here, but jpg files aren't made to store movies. The jpg file format is only able to store one frame of image data.
You need to use another format, AVI, WMF, Quicktime, Realvideo, Tiff...if you want to store multiple frames.
On the other hand, if you save each frame to a separate jpg file then it will work, but then you'll have to deal with all those jpg's and find or make a player that can play them back in sequence.
|
|
|
|
|
Hi all,
#include <stdio.h>
void fun(void)
{
int a[2];
a[3] +=7;
}
void main()
{
int i = 5;
printf("\t %d \n\t",i);
fun();
i = 10;
printf(" %d \n\t",i);
}
Output of above program is
5
5
Why output is like this?
And it is giving Run-Time error when I use " a[2] +=7; " in the function.
Why like this?
Thanks in advance.
Aniket.
|
|
|
|
|
Aniket Salunkhe wrote: int a[2];
You are declaring an array of size 2 (int a[2]).
So it will have a zero based index i.e. 0 to 1.
This means you cannot access a[2] as that does not belong to you. You only have right to modify positions from a[0] to a[1](inclusive).
Modify anything beyond this range could lead to runtime errors and other crashes. Of course you can make the array bigger.
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
Hi,
I know about array size. But when I debug the code, it is skipping the next statement followed by the function call & not giving error. So I am asking that why this is happening? Why it is not showing error?
Thanks for reply.
Aniket.
|
|
|
|
|
what is it a[0]...//used without being defined
int a[3];
a[0]=a[1]=a[2]=0;
a[2] +=7;
and then output is 5 and 10
|
|
|
|
|
Hi,
If I write same Program as,
#include <stdio.h>
void main()
{
int i = 5;
printf("\t %d \n\t",i);
int a[2];
a[3] +=7;
i = 10;
printf(" %d \n\t",i);
}
Than Output is,
5
10
Why? So what is problem in that Program?
Thanks,
Aniket.
|
|
|
|
|
You are breaking the rules. Do not do this.
You say you understand arrays and indexes...then why do you insist on using a[3]?
a[3] is pointing to an area of memory that is being used by another part of the program. It might point to the actual memory being used by int i, it might be pointing to something else. It all depends on how the compiler allocates memory on the stack and in what order you have declared your variables and it's going to change everytime you edit your program.
You are not supposed to be using a[3] so don't use it!
if you create your array:
int a[2];
then you can go use a[0] and a[1], and that's it. Period, exclamation point.
|
|
|
|
|
int a[2];
a[3] +=7; //a[3] is return address(i = 10)
//a[3]+=7 return address is (printf(" %d \n\t",i));
i = 10 do not working
sorry
hello
|
|
|
|
|
Hi,
I'm looking for resource on calling xsl(or xslt) from c++, i'd been looking this for a week almost & haven't come across a good usefull one.
So could some one please let me know, even a code snippet will do.
Thanks.
Mohan
|
|
|
|
|
|
Hi all,
I am tring to get the incoming PIDs & their details using FilterGraph.But I have some problems regarding IMpeg2Data & IMpeg2PsiParser.
1)I added following statements in my code =>
IMpeg2Data *pMPEG = NULL;
hr = pMPEG2Demux->QueryInterface(IID_IMpeg2Data,(void**)&pMPEG);
it is giving me Error as follows =>
Linking...
aDlg.obj : error LNK2001: unresolved external symbol _IID_IMpeg2Data
Debug/a.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Creating browse info file...
What should i do? Is there any library missing. I have added libraries "Strmiids.lib Quartz.lib Dmoguids.lib" & also i have included 'mpeg2data' header file.
2)When i tried to add following statement =>
IMpeg2PsiParser* pMpeg2Psi;
it is giving Error as =>
error C2065: 'IMpeg2PsiParser' : undeclared identifier
Please Help me. Thanks in advance.
Aniket
|
|
|
|
|
Aniket Salunkhe wrote: i have included 'mpeg2data' header file.
I guess there must a corresponding library file also for this header file. Please check.
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
You are using the source from the PSIParser DirectShow sample filter right?
#include "IMpeg2PsiParser.h"
and remember to
#include <initguid.h> before
#include "IMpeg2PsiParser.h" in one of your cpp files.
|
|
|
|
|
Thanks for your advice.
Now it is not giving error.
I have connected DEMUX --> PSI Parser. So can i get the all incoming PIDs & their details OR details of selected PIDs using 'IMpeg2PsiParser' interface here.
Thanks in advance.
Aniket.
|
|
|
|
|
Users get the message:
"This application has failed to start because the application configuration is incorrect. Reinstalling your application may fix the problem."
Does anyone know how to solve this problem?
I'd like to make sure my application runs on 98SE, WinXP Pro etc... any help? Thanks very much in advance!
using visual studio 2005...
(MFC app, NO .NET)
(using the NSIS installer)
build log follows:
Creating temporary file "c:\Documents and Settings\Davids\My Documents\Visual Studio 2005\Projects\Blah\ReleaseW2k\RSP00001D49765820.rsp" with contents
[
/O2 /Ob1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_BUILDING_ON_WIN2K" /D "_AFXDLL" /GF /FD /EHsc /MD /Gy /Yu"stdafx.h" /Fp".\ReleaseW2k/File1.pch" /Fo".\ReleaseW2k/" /Fd".\ReleaseW2k/" /W4 /c /TP ".\File4.cpp"
]
Creating command line "cl.exe @"c:\Documents and Settings\Davids\My Documents\Visual Studio 2005\Projects\Blah\ReleaseW2k\RSP00001D49765820.rsp" /nologo /errorReport:prompt"
Creating temporary file "c:\Documents and Settings\Davids\My Documents\Visual Studio 2005\Projects\Blah\ReleaseW2k\RSP00001E49765820.rsp" with contents
[
/O2 /Ob1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_BUILDING_ON_WIN2K" /D "_AFXDLL" /GF /FD /EHsc /MD /Gy /Yu"stdafx.h" /Fp".\ReleaseW2k/File1.pch" /Fo".\ReleaseW2k/" /Fd".\ReleaseW2k/" /W4 /c /TP ".\File1.cpp"
".\File2.cpp"
".\File6.cpp"
]
Creating command line "cl.exe @"c:\Documents and Settings\Davids\My Documents\Visual Studio 2005\Projects\Blah\ReleaseW2k\RSP00001E49765820.rsp" /nologo /errorReport:prompt"
Creating temporary file "c:\Documents and Settings\Davids\My Documents\Visual Studio 2005\Projects\Blah\ReleaseW2k\RSP00001F49765820.rsp" with contents
[
/OUT:".\ReleaseW2k/MyAppName.exe" /INCREMENTAL:NO /MANIFEST /MANIFESTFILE:".\ReleaseW2k\MyAppName.exe.intermediate.manifest" /PDB:".\ReleaseW2k/File1.pdb" /SUBSYSTEM:WINDOWS /MACHINE:X86 shell32.lib kernel32.lib user32.lib
".\ReleaseW2k\File3.obj"
".\ReleaseW2k\File4.obj"
".\ReleaseW2k\File5.obj"
".\ReleaseW2k\File6.obj"
".\ReleaseW2k\File2.obj"
".\ReleaseW2k\File7.obj"
".\ReleaseW2k\StdAfx.obj"
".\ReleaseW2k\File1.obj"
".\ReleaseW2k\File1.res"
]
Creating command line "link.exe @"c:\Documents and Settings\Davids\My Documents\Visual Studio 2005\Projects\Blah\ReleaseW2k\RSP00001F49765820.rsp" /NOLOGO /ERRORREPORT:PROMPT"
Creating temporary file "c:\Documents and Settings\Davids\My Documents\Visual Studio 2005\Projects\Blah\ReleaseW2k\RSP00002049765820.rsp" with contents
[
/outputresource:".\ReleaseW2k\MyAppName.exe;#1" /manifest
".\ReleaseW2k\MyAppName.exe.intermediate.manifest"
]
Creating command line "mt.exe @"c:\Documents and Settings\Davids\My Documents\Visual Studio 2005\Projects\Blah\ReleaseW2k\RSP00002049765820.rsp" /nologo"
Creating temporary file "c:\Documents and Settings\Davids\My Documents\Visual Studio 2005\Projects\Blah\ReleaseW2k\BAT00002149765820.bat" with contents
[
@echo Manifest resource last updated at %TIME% on %DATE% > ".\ReleaseW2k\mt.dep"
]
Creating command line """c:\Documents and Settings\Davids\My Documents\Visual Studio 2005\Projects\Blah\ReleaseW2k\BAT00002149765820.bat"""
-- modified at 1:16 Saturday 6th May, 2006
|
|
|
|
|
Be more specific please.
What kind of application (project type, the functionality, etc.)?
Under what OS?
......
......
Maxwell Chen
|
|
|
|