Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 0d1da4414697e920748981fb7f5af48af75898d4
Ticket: 555058ffffffffffffffffffffffffffffffffff
Tcl initialization fails in external app
User & Date: davygrvy on 2002-06-03 04:20:21
Changes

  1. icomment:
    Logged In: YES 
    user_id=7549
    
    >How can one use Tcl without Tcl_Main?
    
    Call Tcl_FindExecutable() to set the library path, thus where 
    the encoding files are prior to the first Tcl_Init().
    
    >How is this problem solved in the Tcl Plugin?
    
    Umm, no development work has been done to the plugin for 
    at least 2 years now, AFAIK.  It's way out-of-date.  Please 
    don't refer to it as a reference point.  It's misuse of the event 
    loop and thread contexts are bad enough as it is.
    
    Without knowing argv[0], at least on windows, can be derived 
    with:
    
    char app[MAX_PATH];
    
    GetModuleFile(GetModuleHandle(NULL), app, MAX_PATH);
    Tcl_FindExecutable(app);
    
    The first "crash" listed in the test source is not a crash.  
    Tcl_Init() returns TCL_ERROR and the result is set with the 
    error message.  The second might be be worth digging into, 
    but for how the logic of initialisation is at this moment, today, 
    calling Tcl_FindExecutable() before Tcl_Init() is the correct 
    way to do it.
    
    To have Tcl_Init call Tcl_FindExecutable on it's own would 
    require argv[0], or the derivation of it.
    
    
  2. login: "davygrvy"
  3. mimetype: "text/plain"
  4. username: "davygrvy"