c# - How to read command line parameters passed from VB6 IDE in a .NET library? -


i have app1.exe (built vb6) takes bunch of command line parameters. calls lib1.dll - c#/.net interop library needs access command line parameters of exe. use environment.commandline read command line params , works great.

when debugging app1.exe in vb6 ide, typically go project properties, make tab , set command line parameters textbox manually. however, .net library, when called, doesn't see command line parameters @ all. sees entire thing running under vb6.exe process.

that makes sense (since when debugging, run under vb6.exe), makes difficult debug, since .net library never gets access actual command line parameters.

my question: short of passing command line parameters manually .net lib, there other way see them when debugging in vb6 ide?

this core way vb6 ide designed. when debug vb6 code don't run process, run interpreter. executes p-code, not machine code. accidentally nice feature, allows debugging both vb6 code , .net code made [comvisible]. not possible, there can 1 debugger attached process. explains why .net debugger sees vb6.exe process, that's process has both interpreter , debugger.

so when using environment.commandline, reading command line passed vb6 ide. that's empty one.

the proper approach clear one: don't try obtain information through back-door. have vb6 code set properties on object.


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -