|
So I am using the solution Explorer and I link two projects together. The question I want to ask is how do I run an object that is created from my second project on my first project? Is there any easy way to do that using include? I tried looking through the microsoft library on Project Dependencies but I am still confused. Thanks
|
|
|
|
|
kanekcwu wrote: The question I want to ask is how do I run an object that is created from my second project on my first project?
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
|
|
|
|
|
As in I have two projects different projects in MFC in a solution. I want to call the dialog created by the second project in my first project.
|
|
|
|
|
But why you want to run a dialog of a project on other project,do you have any idea?
|
|
|
|
|
kanekcwu wrote: I want to call the dialog created by the second project in my first project.
See here.
"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
|
|
|
|
|
kanekcwu wrote: So I am using the solution Explorer and I link two projects together. The question I want to ask is how do I run an object that is created from my second project on my first project? Is there any easy way to do that using include? I tried looking through the microsoft library on Project Dependencies but I am still confused. Thanks
The answer depends on what kind of projects you are using. It's easiest if you are using an object in a static library. Then you need to use the include files from the library project and link the library into the calling project. With other kinds of projects, it becomes more complicated. Could you explain in more detail?
Nathan
|
|
|
|
|
I am using an MFC project. I am trying to run a video player on my MFC project and therefore is having problems. Thanks
|
|
|
|
|
Do you want to play a movie file and whats problem?
|
|
|
|
|
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?
|
|
|
|