Alex Rivera | Logout

How can I access argc and argv in c++ from a library function

Asked 2008-10-01T23:56:56.223
9

I'm writing a library which is to be dynamically loaded in C++.

I'd like to read argc and argv (for debugging reasons) from within my code, however I do not have access to the main function. Is there any way to retrieve the command line (both Windows and Linux solution would be nice).

Thanks, Dan

Edit
Report

1 Answer

6

On windows you can access argc/argv via __argc and __argv. __wargv if you want the wide character version.

answered 2008-10-02T02:07:47.860

Your Answer