|
Yes I basically want to play a movie file with my project... I have a project that gives me data on when to play the movie. I just need to make the movie play it at those times... How do i do that?
|
|
|
|
|
For play movie files you can use of MCI functions and they are powerful and easy to use,but I think for this case you dont need to two project.
|
|
|
|
|
Both of my projects areMFC
|
|
|
|
|
kanekcwu wrote: Both of my projects areMFC
I assume that you mean MFC executable projects, as opposed to MFC extension dlls. I have never used MFC automation, but I think you can use that to make methods in one executable callable. Another possibility would be to convert one of your projects to an MFC extension dll project (which has some issues), or an ATL project (which would provide much better automation support than MFC).
Nathan
|
|
|
|
|
hi,
the complier tell me this error happens at the statement of the malloc sentence, but I wonder how can this happens for this statement
AT2[nAT2].itemset=(int *)malloc(sizeof(int)*up->lb[i].itemlen);
usually when the pointer points to the invalid error or the array is out of index then this error happens, but now the very strange thing is I have run the program for 40hours then the error jump out?
can anyone help me to analyze this error?
|
|
|
|
|
Use your debugger to check if up is a valid pointer and that i is in the range of the array.
|
|
|
|
|
wendyyue wrote: I have run the program for 40hours then the error jump out?
It looks like you'll spend a lot of time to find it out.
BTW Have you checked if your process wastes memory?
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
|
|
|
|
|
yes it does takes me a lot of time.
just now I check the call stack find out that
there is a problem in the following statement
AT1=(int *)malloc(sizeof(int)*100);
AT2=(int *)malloc(sizeof(int)*100);
the AT1 can get the pointer and a valid value
but the AT2 is 0x000000,
can it means that the malloc did not allocate the memory for the AT2, because the memory is used up ?
I have run it for 40 hours
|
|
|
|
|
wendyyue wrote: can it means that the malloc did not allocate the memory for the AT2, because the memory is used up ?
Yes, maybe your app is systematically eating up memory (some missing call to free ?).
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
|
|
|
|
|
wendyyue wrote: the complier tell me this error happens at the statement of the malloc sentence...I have run the program for 40hours then the error jump out?
This makes no sense. If you are running the program, then you cannot have compiler a error. If you have a compiler error, then you are not running the program.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I want to compare 2x2 doubles:
double p[2]={0.0,1.0};
double q[2]={0.0,1.0};
return (p[0]>q[0] || p[1]>q[1])
Now I've implemented SEE2 and coded:
__m128d _p=_mm_loadu_pd(p);
__m128d _q=_mm_loadu_pd(q);
__m128d res=_mm_cmpgt_pd(_p,_q);
return (res.m128d_f64[0]!=0.0 || res.m128d_f64[1]!=0.0)
However, this is significantly slower. Have you any suggestions?
(Actually, I'm not very satisfied with the last row.)
Regards
Marcus
|
|
|
|
|
Your expectations are perhaps too high. You cannot expect to just write a couple of asm instructions and expect your application to be faster. There is much more to optimization than simply using the latest instruction set.
Your performance hit is probably due to memory access latency due to cache miss. You could possibly use _mm_prefetch[^] hinted with _MM_HINT_T0 and you *might* see a small performance increase but it also may also be purely artificial and simply moving the latency from one code location to another depending on how often you access this address. And if this comparison is rarely calculated you may end up with cache polution rather than a true optimization. These SSE/SEE2 optimizations are typically used for loops containing many operations. You should also understand that _mm_prefetch is simply a hint and may be completely ignored. This is known as speculative fetching.
Best Wishes,
-David Delaune
|
|
|
|
|
Hello, I have a dialog based MFC application with embedded webbrowser control. I need to load an url and then inject my javascript when page is loaded. I am able to do this by using insertAdjacentHTML function or pasteHTML (with regions) and injecting deferred script. But the problem is when this injected script is trying to do document.write into the page, it seems to erase all content of the document. What could be a problem there? Also, injected script does not work if I inject script only, it is always necessary to add some "garbade" before script, some extra characters. This is my source code:
long rs = m_web01.get_ReadyState();<br />
if (4 == rs)<br />
{<br />
MSHTML::IHTMLDocument2Ptr spDoc2 = m_web01.get_Document();<br />
MSHTML::IHTMLBodyElementPtr spBody = spDoc2->body;<br />
MSHTML::IHTMLElementPtr spBodElem = spBody;<br />
spBodElem->insertAdjacentHTML(_bstr_t("beforeEnd"), _bstr_t(strInjection));<br />
}
Also, there is another problem, sometimes webbrowser just hangs when trying to download a page, for example google finance homepage page will hang it almost for sure. There is an article in KB saying that there is a problem with setting focus if control is embedded into the formview, but I could not find an universal solution, my control embedded into property page, so how do I handle this?
|
|
|
|
|
Alexander Fedorov wrote: when this injected script is trying to do document.write into the page, it seems to erase all content of the document.
Isn't that what document.write does?
led mike
|
|
|
|
|
No, I dont think so. This page will say "Hello world!" not just "world!":
<html><br />
<body><br />
Hello <br />
<script type="text/javascript"><br />
document.write('world!');<br />
</script><br />
</body><br />
</html>
But if I inject similar code into control, it will just say "world!". This happens because script is deferred, but this is what I am trying to do, I need script to be able to execute but not to erase previous content.
|
|
|
|
|
Alexander Fedorov wrote: No, I dont think so. This page will say "Hello world!" not just "world!":
Of course because the script is inline and run at that point when the browser is loading the page but that's not what you are doing because you are injecting the script after the page is finished loading. Your scenario is more like this script which will only display "world"
<head>
<title>Untitled Page</title>
<script type="text/javascript">
function loadPage()
{
document.write(" world");
}
</script>
</head>
<body onload="loadPage();">
hello
</body>
</html>
led mike
|
|
|
|
|
Right, now I get it, but how do I inject something that can write into the page without erasing it? Should I override some event like DocumentComplete? Can I make loaded page to get "busy" again and inject something then?
|
|
|
|
|
Alexander Fedorov wrote: but how do I inject something that can write into the page without erasing it?
Well you already have the inject part working correct? So you need to figure out how to modify the HTML using javascript without using document.write. AFAIK you would use the HTML DOM[^] to do that. So for example say you had a page with span element in it and you wanted to change the text in the span to say "Code Project". You would get the reference to span element using the HTML DOM and then:
theSpan.innerText = "Code Project";
something like that for IE but all browsers are not equal. Of course how you get the reference to the span element depends on the page you are working with.
led mike
|
|
|
|
|
I want to use the .Net class "Math" functions in my vc++ SDI application like "Round" etc.
What header file and library I need to include for this?
Thanks,
Suman
--
"Programming is an art that fights back!"
modified on Wednesday, April 16, 2008 9:10 AM
|
|
|
|
|
If it's a normal C++ function, I think the answer is just plain "tough".
If you're using C++/CLI, then the other forum would be more appropriate.
There's nothing stopping you writing match code in C++ though - and lots of examples in the internet...
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
Hi All,
When there is a global HANDLE to an Event(unnamed) in a exe and another HANDLE in DLL to an Event(named) with the same name, will ResetEvent/SetEvent called in exe trigger the event wait in DLL?
Hope you understand the Q. Here is more explanation.
EXE --> declare HANDLE g_evt= CreateEvent()
DLL --> declare HANDLE g_evt = Createevent(name)
Exe(main thread) { <br />
SetEvent(g_evt); <br />
call to dll function x()...<br />
}<br />
<br />
<br />
<br />
DLL(main thread) x()<br />
{ <br />
ResetEvent(g_evt)<br />
waitforsingleobjectex(INFINITE, g_evt,TRUE);<br />
dosomething();<br />
}<br />
<br />
<br />
<br />
newthread()<br />
{<br />
log<br />
setevent(g_evt);<br />
}
when setevent is called in the exe, I see that the there is no wait
and dosomething() is called rightaway. Actually it should be waiting for the newthread() to execute and set the event. Since the call is commented it should be waiting for ever.
Setevent in exe is called for some other thread that is part of the exe. But it is signalling the dll wait object. Please kindly let me know if my reasoning is correct?
Thanks & Regards,
Dhana
|
|
|
|
|
I fell over at your first sentence.
You have two handles, one named, and one not named.
If you have two named handles, with the same name, then they would be the same underlying object. But you don't, so your two event handles will point to different things.
If you really want to talk to the same object, you will have to use the same name for both. And no-name != some name.
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
I am very very sorry.
Both the HANDLES have same names. One is defined in exe and one in a dll which the exe uses.
handle in the dll is pointing to a named event and other handle in exe is pointing to a unnamed event.
Hope now you can relate to my previous message.
Thank you.
Thanks & Regards,
Dhana
|
|
|
|
|
jana_dhana wrote: Both the HANDLES have same names
HANDLE 'names' are usually called identifiers .
However, as long as DLL symbol is not exported, they refers to different variables.
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
|
|
|
|
|
Thank you for the answer.
Thanks & Regards,
Dhana
|
|
|
|