|
Pass both parameters in a single string as the lpParameters argument.
|
|
|
|
|
Look at the ShellExecute Function (Windows)[^] documentation on the MSDN: you have to use the lpParameters argument. Here below is an example:
ShellExecute(NULL, "open", "notepad.exe", "/P myfile.txt", NULL, SW_SHOW);
|
|
|
|
|
This is not working..
I am passing like
CString cmdArg = _T("-x ") + szUpdateFilePath;
::ShellExecute(NULL, _T("open"), szUnZipExePath,cmdArg , NULL, SW_SHOW);
I need to pass like
unzip.exe -x file.zip
Anything wrong?
|
|
|
|
|
john5632 wrote: This is not working..
Which means what exactly?
Try using string literals as the third and fourth arguments to ShellExecute() . Once you get that going, then you can go back to using variables.
"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
|
|
|
|
|
Are you sure szUpdateFilePath contains what you think it contains?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
|
Does szUpdateFilePath contain spaces perhaps? If yes, enclose it with quotation marks, e.g.:
Cstring cmdStr = _T("-x \"") + szUpdateFilePath + _T("\"");
Also, try this:
CString exec = szUnZipExePath + _T(" -x ") + szUpdateFilePath;
::ShellExecute(NULL, _T("open"), exec,NULL , NULL, SW_SHOW); and see if it changes anything or not.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
|
Actually, why does it not work? What are the sympthoms i mean.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
It should unzip the file and create 2 folder and contents. When I am running using command prompmt the same is working fine. but it is not working in code.
|
|
|
|
|
If you check out the documentation for ShellExecute[^], it states that you get error codes -if any- in the returned value, what does the error code tell you?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
Its returning 0(The operating system is out of memory or resources.). Can you tell me why this is happening. plzz.
|
|
|
|
|
Which version? Your original or the one i suggested? Try your version if you haven't.
Btw i did a small test app and it runs unzip.exe without problems, i suspect that the problem is with your parameters, maybe the path to your executable is too long or the parameter string is. If you don't specify any arguments, just try to run the exe, does it work?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
modified on Friday, October 22, 2010 2:07 PM
|
|
|
|
|
|
What is the reason of failure in ICaptureGraphBuilder2::RenderStream() with .mpg files? HRESULT is 0x80004005
Чесноков
|
|
|
|
|
That HRESULT value stays for E_FAIL which has no more specific details. Have a look at the documentation of ICaptureGraphBuilder2::RenderStream[^] on the MSDN; on the remarks section there are 2 sentences that could help you:
- If pSource is a filter, the method searches for an output pin on that filter. In that case, use the pCategory and pType parameters to narrow the search. For example, if a filter has separate pins for preview and capture, you can specify either PIN_CATEGORY_CAPTURE or PIN_CATEGORY_PREVIEW. If pSource is an output pin, set the pCategory and pType to NULL.
- File Sources. You can use this method to transcode or recompress a file. The following discussion assumes that the file has at most one video stream and one audio stream, or else a single interleaved stream. Otherwise, the method will not work correctly. A file source has one output pin, so set pCategory and pType to NULL. Call the method twice — once to render the video stream, and once to render the audio stream. The first call connects the source filter to a parser filter and renders one of the parser filter's output pins. The second call renders the parser's remaining output pin. If you are compressing one stream but not the other, make sure to specify the compressor filter in the first call. The method will automatically pick the correct stream based on the compression type.
|
|
|
|
|
I use intelligent connect. It should find all pins and connects them together automatically? How do I need to manage those pins manually?
IBaseFilter *pSrcFilter = NULL;
hr = m_pGraph->AddSourceFilter(fileName, L"Source Filter", &pSrcFilter);
if (FAILED(hr))
return -3;
IBaseFilter* pGrabberFilter = NULL;
hr = AddSampleGrabber(&pGrabberFilter);
if (FAILED(hr)) {
pSrcFilter->Release();
return -4;
}
IBaseFilter* pNullFilter = NULL;
hr = AddNullRenderer(&pNullFilter);
if (FAILED(hr)) {
pGrabberFilter->Release();
pSrcFilter->Release();
return -5;
}
hr = m_pCapture->RenderStream(NULL, NULL,
pSrcFilter, pGrabberFilter, pNullFilter);
Addition of the NULL renderer and sample grabber are typical from MSDN
IBaseFilter* pFilter;
hr = CoCreateInstance(CLSID_NullRenderer, NULL, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, (void **)&pFilter);
if (FAILED(hr))
return hr;
*ppNullFilter = pFilter;
hr = m_pGraph->AddFilter(pFilter, L"Null Renderer");
if (FAILED(hr)) {
pFilter->Release();
return hr;
}
(*ppNullFilter)->AddRef();
pFilter->Release();
Чесноков
|
|
|
|
|
Look at these pages from MSDN:
|
|
|
|
|
Why intelligent connect fails with .mpg files but works with others as .avi, .mp4?
Чесноков
|
|
|
|
|
If I set those parameters it returns 0x80070057
RenderStream(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, pSrcFilter, pGrabberFilter, pNullFilter);
Чесноков
|
|
|
|
|
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.
|
|
|
|