Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CString

Status
Not open for further replies.

Bodrum81

Programmer
Nov 5, 2003
29
DE
Hello

I have a simple question.
Visual C++ 6.0

m_lpCmdLine are this variable a String variable?

now my problem

I have in m_lpCmdLine this string/text: user pass server
I want to save this in several variables

so that I have

CString v_user = "user";
CString v_pass = "pass";
CString v_server = "server";

mfc 6.0 has not Tokenize method!?
are there another mothod to make the string "user pass server" in parts?


thanks for help
 
I think you should #include<stdarg.h> and use global variables, __argc and __argv. The first one is number of arguments, the second one is a char** array or string arguments.

Ion Filipski
1c.bmp
 
I want to call my program like:

viewer.exe -r Rerport.rpt -u User -p Pass -s Server

u now how I catch the options -r -u -p -s
??
can i set this options/parameters?
 
__argc will be 8
and argv will be:
__argv[0] &quot;-r&quot;
__argv[1] &quot;Rerport.rpt&quot;
... &quot;-u&quot;
... &quot;User&quot;
... &quot;-p&quot;
... &quot;Pass&quot;
... &quot;-s&quot;
__argv[__argc - 1] &quot;Server&quot;


Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top