Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

TCL(Tool Command Language) Scripting

Can't get stdout to screen


I had a console application that embedded TCL in it on a Windows
Machine. I started TCL by running code that looked like this

        hTCLModule = LoadLibrary(TCLDllLocation);
        Tcl_FindExecutable("myApp.exe");
        myInterpreter = Tcl_CreateInterp();
        Tcl_Init(myInterpreter);
        ret = Tcl_EvalFile(myInterpreter,scriptPath);

When this was a console application, everything worked fine, and any
priintf's that I slotted between these lines popped up in a little
black window.

Now I've converted my little console app to a DLL that is called by
another app. TCL still runs... but I don't get the nice little black
window. Also, the only results I get from TCL now are "can not find
channel stdout"

I don't know what to do. I've been tinkering with Tcl_GetStdChannel,
but I can't seem to get it to work. Any ideas from anyone out there?

Jon

You can create one with AllocConsole().  Something like the following would work:

 conout = CreateFile("CONOUT$", GENERIC_READ|GENERIC_WRITE,
    FILE_SHARE_READ|FILE_SHARE_WRITE, 0L, OPEN_EXISTING, 0, 0L);

 if (conout == 0L || conout == INVALID_HANDLE_VALUE) {
    AllocConsole();
    conout = CreateFile("CONOUT$", GENERIC_READ|GENERIC_WRITE,
        FILE_SHARE_READ|FILE_SHARE_WRITE, 0L, OPEN_EXISTING, 0, 0L);
    if (conout == 0L) {
        Tcl_SetObjResult(interp, Tcl_NewStringObj(
                "can't attach or create a console.",0L));
        return TCL_ERROR;
    }
 }

--
   Thank you. before I begin, I'd like everyone to notice that my report is in
a professional, clear plastic binder...When a report looks this good, you know
it'll get an A. That's a tip kids. Write it down.         -- Calvin

  signature.asc
1K Download

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc