|
Chesnokov Yuriy wrote: If I set those parameters it returns 0x80070057
This code stays for E_INVALIDARG ; try to set both to NULL , or to set the second parameter to MEDIASUBTYPE_MPEG1Video
|
|
|
|
|
They are both set to NULL and it fails to play .mpg files.
When 1st param is NULL and 2nd is set it pruduces SEH
Чесноков
|
|
|
|
|
What I meant was:
RenderStream(&PIN_CATEGORY_CAPTURE, &MEDIASUBTYPE_MPEG1Video, pSrcFilter, pGrabberFilter, pNullFilter);
|
|
|
|
|
That one along with MEDIATYPE_Video results in 0x80070057 on any video file.
If both are NULL only .mpg can not be rendered.
Codec icon appears in task bar as you connect to .mpg with both to NULL but then the error is returned as in the topic question and it disappears.
Чесноков
|
|
|
|
|
Hi,
As we know there are various compilers available for C language for windows.
If the performance is the only criteria, which one to choose?
I want to choose the compiler on which my application should give the best result.
(I don't need any libraries like MFC, ATL...) I just need to use some variables and arrays.
|
|
|
|
|
You can try the Intel C++ Compiler Professional Edition for Windows (start from here[^] to get informations and download a trial). It is able to do automatically a lot of optimizations that are difficult to find on other products, like loop-unrolling, auto-vectorization, auto-parallelization, etc.
The Microsoft C/C++ compiler that ships with Visual Studio is another very good optimizing compiler.
|
|
|
|
|
Thanks a lot for the reply.
I would love if i could create the best performing application on a free/open source C compiler.
|
|
|
|
|
Then the Intel C++ compiler could not be the right one: there exists a free version of it, but only for Linux and as long as you use it for not commercial purposes.
On Windows you can use the Visual C++ Express Edition: it's free for both commercial and not-commercial uses. The Express Edition doesn't ship with ATL nor MFC, but you said that you don't need them. I know for sure that the Express Edition doesn't support the OpenMP libraries; however it's a very good optimizing compiler, and the Visual Studio debugger is claimed to be one of the best available.
You can also try any of the GCC ports (MinGW and Cygwin); as I know they support both the C89 and C99 standards (the Visual C++ only supports the C89) and the OpenMP too. I heard that GCC has a variety of switches that affect the optimizations done and that exists an open-source project that analyze your application to find out the best switches configuration to use (but I don't remember its name).
Another option could be the Open Watcom: the Watcom C/C++ compilers are born in the 80s as commercial/closed source product and has been one of the best compilers until the end of the century; in the 2003 has been released to the open source community that continued its development since now.
|
|
|
|
|
Thanking you once again for reply.
What is your view about Borland/Turbo C++.
Mentioning you once again, performance is the only criteria.
My application will use only few variables and 1 or 2 arrays but a huge set of calculations.
|
|
|
|
|
I used Turbo C++ under MS-DOS (they was great days ), but I never used the Borland C/C++ under Windows. As far as I know Borland haven't had a great success with their C/C++ compilers on Windows and I think that they moved their efforts to Delphi. Anyway Borland gives for free only very old versions of their compilers.
|
|
|
|
|
Borland C+ is awful; it does almost no real optimizations for modern CPUs and the IDE is extremely flaky and dated. For general use, Visual Studio Express is hard to beat. It has a damn good compiler, second only to Intel's compiler in quality of code, but vastly superior in overall tool awesomeness (the Visual Studio debugger is fabulous.) gcc is third, but their tools reek. Nothing else is worth the time or effort.
|
|
|
|
|
The most sensible thing to do is try them and see which ones generates the best code for your problem on whatever system they have to run on. Most manufacturers (e.g. Intel and Microsoft) produce free compilers which will be good enough for evaluating how they perform.
Cheers,
Ash
|
|
|
|
|
By the way, are you looking for a C or for a C++ compiler? People are giving you advices regarding C++ compilers and you are persistently talking of a "C compiler". While each C++ compiler must be able to process C-code and generate C-code binaries, there might be specialized C-compilers for generating fast C-binaries...
|
|
|
|
|
paul_71 wrote: While each C++ compiler must be able to process C-code and
You are right paul. Actually, I am looking for fastest free C compiler only, but C++ is also acceptable as it can also compile C code.
As you mentioned, specialized C compiler for generating fast/best optimized binaries would be the best for me.
|
|
|
|
|
Hi all,
when i m trying to stop running thread ,than some time exception occur and point out on this location in call stack
> test.exe!CMapPtrToPtr::GetNextAssoc(__POSITION * & rNextPosition=0xfeeefeee, void * & rKey=0xfeeefeee, void * & rValue=0xfeeefeee) Line 294 C++
i dont understand whats going wrong please help me for this.
thanks in advance.
|
|
|
|
|
IIRC when you see an object with the bit pattern 0xfeeefeee in VC++ it means the object's been deleted. So my first guess would be you've got a map and and you're trying to delete it twice, or trying to use it for something after it's been deleted.
Cheers,
Ash
|
|
|
|
|
Are you trying to stop thread A from within itself, or from some other thread?
"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 m doing like this.
class CTimerTh :: CWinThread
{
}
class CMy_Th::CTimerTh
{
}
//i create thread with AfxBeginThread and use here CMy_Th as run time class and and save its return pointer in std::map<int, CMy_Th*> ass
ass[0] = (CMy_Th*) AfxBeginThread( RUNTIME_CLASS(CMy_Th),THREAD_PRIORITY_NORMAL, NULL,CREATE_SUSPENDED,
NULL);
std::map<int, CMy_Th*>::iterator pos = ass.find(0);
if(pos != ass.end())
{
if(pos->second!=NULL)
{
CMy_Th* pThread = pos->second;
pThread->PostThreadMessage(WM_QUIT,NULL,NULL);
}
ass.erase(pos);
}
</pre>
please me to resolve the error.
thanks in advance.
|
|
|
|
|
Le@rner wrote: pThread->PostThreadMessage(WM_QUIT,NULL,NULL);
See here. I prefer to let threads kill themselves, and use events to signal between them.
"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 all,
i m working on SDI type application ,i want to set some minimum size of application.
please tell me how can i do this.
thanks in advance
|
|
|
|
|
Le@rner wrote: i m working on SDI type application ,i want to set some minimum size of application.
In your CMainFrame class, you could implement a handler for WM_GETMINMAXINFO like this:
void CMainFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
{
int min_x = ::GetSystemMetrics(SM_CXSCREEN) / 4;
int min_y = ::GetSystemMetrics(SM_CYSCREEN) / 3;
int cx = lpMMI->ptMinTrackSize.x;
int cy = lpMMI->ptMinTrackSize.y;
lpMMI->ptMinTrackSize.x = (cx < min_x) ? min_x : cx;
lpMMI->ptMinTrackSize.y = (cy < min_y) ? min_y : cy;
CFrameWnd::OnGetMinMaxInfo(lpMMI);
}
This example will give you a minimum of 1/4 the screen width and 1/3 the screen height. You could also use hard-coded number of pixels, although this might not scale well for different monitor sizes.
|
|
|
|
|
|
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
cs.cy = 100;
cs.cx = 100;
return TRUE;
}
You can set your custom size with use of cs.cy and cs.cx parameter
|
|
|
|
|
Hi all,
i want to calculate time that is taken by execute a function.
i m doing it like this.
DWORD dw = ::GetTickCount();
dw = ::GetTickCount() - dw;
CString time_str;
time_str.Format("%d ms", dw);
AfxMessageBox(time_str);
is it right way to do this.
thanks in advance.
|
|
|
|
|
You can get much better resolution with the APIs QueryPerformanceCounter() and QueryPerformanceFrequency() . Use ...Counter much like you use GetTickCount, and ...Frequency to calibrate your results. Hit MSDN for more info and examples.
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|