|
toxcct wrote: he's programming MFC
Sorry, I missed that. Sincerely.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
don't confuse, installing Visual Studio .NET doesn't mean you actually use the .NET framework.
if your program is pure MFC project, then provide the MFC71.dll, MSVCR71.dll and MSCVP71.dll libraries with your exe (or statically link your project to MFC, but that'll increase the .exe file size significantly)...
|
|
|
|
|
Thanks for replying.
as you said i think it does not use the framework it's running in pure MFC.
so by putting these dll's on client's machine will be suffice..
Thanks
Harshal
|
|
|
|
|
complete answer
|
|
|
|
|
Ship all required dll's on client m/c. No need to install .net framework.
Use depends.exe for detecting dependencies.(It will show files mentioned by you).
|
|
|
|
|
.NET 2003 include VC7.0 , Convert VC6.0 project to VC7.0 , then rebuild all .
No need other dll , no need .NET framework.
|
|
|
|
|
I need to know when a copy event occurs in the explorer. I think I must set a global hook using SetWindowsHookEx API. But which type of hook it has to be?
|
|
|
|
|
You can write an ICopyHook shell extension to get those notifications.
|
|
|
|
|
That seems to work only for folders. I want my application to know immediately when user is copying one or more files. Will a clipboard hook help? Is there any other way to do this?
|
|
|
|
|
No, it gets called for any file operations done in Explorer. A copy hook gets registered under a "folder" key but that doesn't mean it works only for folders.
|
|
|
|
|
Oh thats cool. Can you point me to some sample article or code? When I searched CP I found one article but there only folder copy operation is handled. My app requirement is like I need to log whenever the user is performing a file copy in the explorer. Thanks.
|
|
|
|
|
|
How to run a VC console app from a batch file but with variable number of params?
file.bat
vcConsole.exe %????
> file.bat param1 params2 param3 ... paramN
and pass them all at once without %1 %2 %3 ... in batch file?
9ine
|
|
|
|
|
use %1- instead...
sorry, this was the unix way.
use %* to expand all the parameters excluding the %0 (which is the batch file name).b
|
|
|
|
|
good morning
is it possible to fill a table with CString ?
CString tab [20];
|
|
|
|
|
|
yup, why wouldn't it be ?
BTW, think of using STL if it becomes complex (with something like std::vector<CString> )...
|
|
|
|
|
|
I'm writing a DMO (DirectX Media Object) transform filter for video. Now I want to implement internal resizing functionality. Thus previously I have always returned DMO_E_INVALIDTYPE from InternalCheckOutputType() if input and output dimensions doesn't correlate for RGBxx. However this approach isn't possible for YUY2 color space since the renderer (VRM9) for some dimensions introduce memory alignment for every row of the frame (for example if the input video has dim 176x144 the renderer requests a output dimension of 192x144 probable due to some render acceleration of the YUY2 rendering in graphics card and if denied it will use RGB instead and performance will of course decrease).
The above is annoying because I can't see the difference when to perform internal resizing and when to align the rows of the frame (or when to do both).
So my question is, is there a way to get information on the amount of (image row) memory alignment of the output from inside a DMO filter.
(In some cases I also will need to hook up the output of the filter with non-rendering filters.)
|
|
|
|
|
By the way, the sort of memory alignment i am talking about is called pitch or stride.
|
|
|
|
|
Hi everyone
I am running the following piece of code on Windows 2000 and XP (except the code below has been simplified with error checking removed).
This code spawns a child process, which writes its output to a logfile called child.log.
The problem I am having is: if the child process is a command or batch file, then child.log captures output of commands such as "dir",
however, for any processes that are launched from the batch script, such as perl.exe, all the output is lost. I don't know where the
output is going or why. I suspect I have done something wrong with handle inheritance somewhere.. any ideas??
I don't get the same problem if the child process is some other shell interpreter, such as bash.exe.
SECURITY_ATTRIBUTES secAttr;
secAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
secAttr.bInheritHandle = TRUE;
secAttr.lpSecurityDescriptor = NULL;
STARTUPINFO startupInfo;
::ZeroMemory((void*) &startupInfo, sizeof(STARTUPINFO));
startupInfo.cb = sizeof(STARTUPINFO);
startupInfo.dwFlags = STARTF_USESTDHANDLES;
PROCESS_INFORMATION processInfo;
startupInfo.hStdOutput = CreateFile(
"child.log",
GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ,
&secAttr,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH | FILE_FLAG_SEQUENTIAL_SCAN,
NULL);
startupInfo.hStdError = startupInfo.hStdOutput;
CreateProcess(
NULL,
commandString,
NULL,
NULL,
TRUE,
DETACHED_PROCESS,
NULL,
NULL,
&startupInfo,
&processInfo);
// Close handle because parent process has no further need for it:
CloseHandle(startupInfo.hStdOutput);
<div class="ForumSig">
cheers,
Neil</div>
|
|
|
|
|
So if I understand the issue correctly, you’re creating a file for a batch file to write to right?
Well if that’s indeed the case the issue is how you’re creating it.
neilsolent wrote: startupInfo.hStdOutput = CreateFile(
"child.log",
GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ,
&secAttr,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH | FILE_FLAG_SEQUENTIAL_SCAN,
NULL);
FILE_SHARE_READ Allows other apps to open it read only. Change that to FILE_SHARE_WRITE or close the file before spawning the the child process.
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
Thanks for the suggestion.
I tried this out, but it didn't seem to make any difference.
To clarfiy, the issue is that, processes launched by the batch file itself do not send any output to child.log. The batch file itself DOES successfully send ouput to child.log. So if the batch file is:
dir
perl -v
exit 0
.. then you can see output from "dir" (because this is a DOS commmand, that does not run as a new process) but not from perl (because this is launched as a new process).
Weird ??
cheers,
Neil
|
|
|
|
|
Sorry, I'm even more confused.
So you want the output from the perl script written to the log file right?
If you run the perl script from the command line does it do what its suppose to?
What is the perl script doing? Any reason it has to be done from a scipt and not part of your C++ App?
For any of the command line commands redirecting the output from the screen to a file is >Path.To.File ie dir >C:\MyLog.log
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
Thanks again for your comments. Here's some answers to your questions:
So you want the output from the perl script written to the log file right?
= Yes. Whatever the program - that is launched by CreateProcess() - does, I want all stdout (and stderr) to go the logfile child.out. If the launched program is a batch script, this includes the output from any new processes (such as Perl) that the script may launch.
If you run the perl script from the command line does it do what its suppose to?
= Well, there is no Perl script here, I am just getting Perl to return its version statement (-v flag). But yes, Perl does correctly return the version statement if I run the batch script manually. If I replace the batch script with a shell script (bash.exe instead of cmd.exe) it works just fine - the output from Perl goes to child.out. It seems that it only doesn't work if the program launched with CreateProcess() is a batch script.
What is the perl script doing? Any reason it has to be done from a scipt and not part of your C++ App?
= That is not really relevant, because the main C++ program - that runs CreateProcess() - is supposed to allow the user to run ANY program or script he/she likes. I was just testing that it out with a sample batch script, when I came across this weird problem. I can't know in advance what programs the user may wish to run, and I can't ask them to kindly not launch any new processes from a batch script !!
For any of the command line commands redirecting the output from the screen to a file is >Path.To.File ie dir >C:\MyLog.log
= Yes, but I am not sure how that is relevant here? The output from the "dir" call DOES goes to child.log as it stands. It is just odd that the output from the Perl call does not. I have concluded that the difference is that Perl.exe is a new process, whereas dir is not. There must be something strange with the startup parameters in the CreateProcess() call, but I just can't think what..
I hope this makes sense, and I hope you can work out what I could be doing wrong, because I am totally stumped!!
cheers,
Neil
|
|
|
|