tim roberts eqemprobocom mani sabri wrote want run python shell dllmain function isnt safe much processing dllmain thing called loader lock held dllmain called prevent loading dlls might try spinning thread real work came far bool apientry dllmainhandle hmoduledword ul_reason_for_calllpvoid lpreserved switchul_reason_for_call case dll_process_attach py_isinitialized bool res allocconsole going use handles heard way handle outhand getstdhandlestd_output_handle handle inhand getstdhandlestd_input_handle handle errhand getstdhandlestd_error_handle redirecting console freopenconoutwstdout freopenconinwstdin freopenconerrwstderr really think w correct three printf prints new console redirection printftest opening stdout stdin files pass python redirection file afile fopenconout w file bfile fopenconin w really think want w much writing stdin py_initialize py_isinitialized returnfalse bellow lines instead redirecting python crashes dll pysys_setobjectstdout pyfile_fromfileafile testwb fclose pysys_setobjectstdin pyfile_fromfilebfile coninwb fclose youre probably going want read stdin write dont really need fopen pyfileobject xout pyfile_fromstring conout wb pyfileobject xin pyfile_fromstring conin rb pysys_setobject stdout xout pysys_setobject __stdout__ xout pysys_setobject stdin xin pysys_setobject __stdin__ xin tim roberts eqemprobocom providenza boekelheide inc _______________________________________________ pythonwin32 mailing list kpitckaew45pythonorg httpmailpythonorgmailmanlistinfopythonwin32 tue 05 aug 2008 233348 0700 pythonwin32 embedding ipython windows dll