Re: PATH and VB
- From: "Ralph" <nt_consulting64@xxxxxxxxx>
- Date: Fri, 7 Sep 2007 08:47:46 -0500
"SteM" <xxx@xxxxxxx> wrote in message
news:ePBISFS8HHA.4712@xxxxxxxxxxxxxxxxxxxxxxx
Ok, i will try to be clear.Microsoft
The VB application calls a function contained in a C DLL: this function
launches a commad to run 'cint' (c interpreter) that needs to have
Visual Studio tools on the PATH.environment
Then in the DLL function i add the path of VC tools to the PATH
variable (and other variable, i took them from vcvars32.bat) by someWindows
APIs for the current process:that's
<snipped>
This settings work if i run the compiled application, no work on vb
application run from the IDE.
I don't undestand that, cause the code is always included in the DLL
the same in both cases !?!??<snipped>
Then our suggestion that there may be a problem with App.Path is incorrect.
It would be interesting to know how G__init_cint() is launching the
application. Are you using WinAPI (createProcess) or something from the C
runtime (spawn, exec, ...). Not that I could fully explain what was going on
if I did know. <g>
I'm not terribly surprised that there would be an issue with the IDE. One,
when running a project, the actual parent process is VB6.exe instead of the
App with a debugger attached (as in VC++). Second, all calls to and from
Dlls are routed through the VBDebug.dll (which is loaded in VB6.exe space).
And third the VB IDE is just plain notorious for 'high-jacking' the
Registery and other system services for its own use.
If this is a real problem and you can't live with it. You might investigate
two alternative programming changes:
1) Write your new path directly to the registery.
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession
Key: ManagerEnvironment
Value: Path
Then send a broadcase message to all applications that the Registry has been
changed.
2) Rewrite your G__init_cint() routine to use CreateProcess. Which takes a
specific Environment parameter.
Or, you could just launch a DosPrompt window, run vcvars32.bat, (or use the
special commandprompt provided by VC++) and then launch your project from
that prompt. That way the IDE would inherit the new settings just fine.
I broke it down, but you should be able to do all this in a simple shortcut
to your project.
hth
-ralph
.
- References:
- PATH and VB
- From: SteM
- Re: PATH and VB
- From: Jan Hyde (VB MVP)
- Re: PATH and VB
- From: SteM
- PATH and VB
- Prev by Date: Re: THANKS! Re: MSForms 2 Obj Lib not "sticking"
- Next by Date: Re: Vista version check volunteers?
- Previous by thread: Re: PATH and VB
- Next by thread: Re: PATH and VB
- Index(es):
Relevant Pages
|