Re: PATH and VB

Tech-Archive recommends: Speed Up your PC by fixing your registry




"SteM" <xxx@xxxxxxx> wrote in message
news:ePBISFS8HHA.4712@xxxxxxxxxxxxxxxxxxxxxxx
Ok, i will try to be clear.
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
Microsoft
Visual Studio tools on the PATH.
Then in the DLL function i add the path of VC tools to the PATH
environment
variable (and other variable, i took them from vcvars32.bat) by some
Windows
APIs for the current process:

<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
that's
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


.



Relevant Pages

  • Re: Compact Framework 2.0 team needs to finish the .NET CF 2.0 release
    ... is that breakpoint in the DLL which is dynamically loaded (or ... First investigations seems that the IDE for some reason are not deploying ... debugging to a USB attached device is faster. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: How to debug an ActiveX DLL
    ... You don't even need the main application in the IDE Dag. ... Just loaded the VB project for the DLL into the IDE, ... instruct it to run your main app whenever you want to debug the VB DLL. ... I'm a real novice when it comes to ActiveX DLLs, ...
    (comp.lang.basic.visual.misc)
  • Re: PInvoke & LoadLibrary fail - DLL exists
    ... Your IDE is trying to link with them, ... not know anything about those libraries unless you tell it, ... How is the DLL getting to the device? ... Handheld Products QVGA WM5 device ...
    (microsoft.public.dotnet.framework.compactframework)
  • hiding a db connection string
    ... We currently have a DLL that the VB6 ... apps call to get the production connection string. ... specify to the remote object where it's calling from (short of actually ... launch path in it as read only property, and maybe I can send that up ...
    (microsoft.public.dotnet.general)
  • Re: Debugging ActiveX Components: How does VB6 IDE work around the problem?
    ... Control, not a DLL, and VB handles those differently. ... instead of loading the DLL into the IDE first and then running ... the client, set the client path in the 'Start program' field of the ...
    (microsoft.public.vb.general.discussion)