|
From the compiler message: There is something wrong with = overloaded operator of CStringList. This means that there is no overloaded operator = for CStringList hence you cannot assign one List to another like you did. You will have to use some alternative method to do this like copying all the elements of one list to the other in a loop.
e.g., something like:
for(int i=0; i<str.list.GetCount();i++)
{
this->list.AddTail(str.list.GetAt(i));
}
<Font size = 1 color = red>
Steve Mayfield: "Coding in VB is like riding a tricycle...once you figured out how to peddle, its really hard to fall off."
</i></Font>
<a href='http://www.codeproject.com/script/Articles/list_articles.asp?userid=163403'> My Articles</a>
|
|
|
|
|
to sum Aamir up, you dont call the same function that is define in the CStringList class... check the parameters, their types...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
How can I change the border of listctrl?
Can you suggest any useful link?
Tanks in advance!
|
|
|
|
|
i have this tiny problem...
i have this program running in a GUI mode and i want it also to run in the command line.
i want it to have the following command line output:
hello there. this is the command line version of this program.
press enter to continue...
how would i run that program in a command line without making the GUI appear.
|
|
|
|
|
i'm not sure i understand. isn't the following working ?
#include <stdio.h>
#include <conio.h>
void main(void) {
printf("hello there. this is the command line version of this program.");
printf("press enter to continue...");
getch();
}
otherwise, please give some some for us to understand you request.
thanks
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
my program originally runs with a GUI. the problem is i want to run the same program with the command line without making the GUI appear.
thanks for your reply...
|
|
|
|
|
i'm not sure what you call GUI here... if it is a console mode executable, is it the border of a console window that you want to hide ?
this way, if you Alt+Return you will put the window in full screen, so no border anymore ...
otherwise, please detail more...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
let's put this way. i have develop a GUI for my software. I want my software to run in a GUI mode and CLI mode. the problem is everytime i run the my software in the command line my GUI appear instead of printing the following:
this is the command line version of this software
press enter to continue...
the problem get's bigger now...
my software need to perform command line parsing...
thanks for the reply...
regards...
|
|
|
|
|
It is not possible stright away to make a program to run withour GUI .
You have to give some input ..like with which the code is written ...is it VC++ / VB or what ?
Assuming it is VC++ , if u have a GUI app, then it must be either dialog based or document view based (SDI MDI)..
If its SDI , MDI it is not possible to convert the whole app withour impacting the functionlity of it .
If it is dialog based , there is a 100% possiblity to make it run in cmd line ...still
the data retriveal mechanism etc etc has to be made to run in concurrence with plain windows APIs not with MFC dependecies like CEDit etc etc
Give us more input ..
|
|
|
|
|
here is the twist. My application is dialog based. I could identify where did the user call my software (e.g. if the user call it in the command line or if the user click it's icon. My problem is i could not print in the command line. if i call my application in the command line i no printing in the command line will happen.
what i really want is to make my software run in both GUI mode and CLI mode. i could make it run in GUI mode but i cant run it using the command line. i would like it to run in one mode at a time. if the user prefer to run it in GUI mode the all its functionalities should run in GUI mode. if the user prefers to run it in CLI mode all it's functionalities should run in CLI mode.
thanks for the reply...
regards...
|
|
|
|
|
What kind of application do you have ? Plain Win32 ? MFC ?
If MFC, ihe best way to do this would be to have the executive tasks of your program located in User Interface independant classes (e.g. do not locate all computation functions in the MFC GUI derived classes), and call these tasks from the InitInstance function (e.g. if there are command line options when parsing the command line in InitInstance, do not call all the MFC GUI part).
~RaGE();
|
|
|
|
|
my software supports MFC. my software functionalities are all in different classes. I would like my software to run in one mode at a time. if the user chooses to run it in GUI mode then all my functionalities should run in GUI mode. I have no problem with that. The problem comes in if the user chooses to run it in CLI mode.
thanks for the reply...
regards...
|
|
|
|
|
If it is a dialogue based application then put a condition around
<br />
int nResponse = dlg.DoModal();<br />
This is the code that displays the dialogue.
You will have to call any functions you want within the dialogue class by calling from this point instead, such as:
<br />
if(UseDlg)<br />
{<br />
int nResponse = dlg.DoModal();<br />
}<br />
else<br />
{<br />
dlg.DoFunc1();<br />
dlg.DoFunc2();<br />
nResponse = IDOK;<br />
}<br />
Note the last line gives the same effect as clicking the OK on the dialogue.
Elaine
The tigress is here
|
|
|
|
|
yes i have done that. the problem is i can't perform console i/o. i can't even print my name in the console. Can you help me about this...
thanks for the reply...
regards...
|
|
|
|
|
Here the code and step..
1. Create a MFC dialog based application.
2. Create a new thread class (named CConThread) deriving from CWinThread (Use Application wizard)
3. In the Dialog App InitInstance () function add this code
int nResponse;
CString str = this->m_lpCmdLine;
if (str.Find ("Console") > -1)
{
CWinThread *t = AfxBeginThread(RUNTIME_CLASS(CConThread),THREAD_PRIORITY_NORMAL,0,0,NULL);
WaitForSingleObject(t->m_hThread,INFINITE);
}
else
{
CWinConDlg dlg;
m_pMainWnd = &dlg;
nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
}
4. USing class wizard add Run() method to your CConThread class...
5. Add this code to your Run () method
int CConThread::Run()
{
AllocConsole();
HWND hWnd = NULL;
ifstream istr;
ofstream ostr;
//typedef HANDLE (__stdcall *FOO)(LPCTSTR);
istr.open ("CONIN$");
cin = istr;
ostr.open ("CONOUT$",ios::out);
cout = ostr;
typedef HWND (__stdcall *CW) ();
CW fp;
HMODULE hM = LoadLibrary("Kernel32.dll");
fp = (CW) GetProcAddress(hM,"GetConsoleWindow");
hWnd = (*fp)();
SetStdHandle(STD_INPUT_HANDLE,hWnd);
SetStdHandle(STD_OUTPUT_HANDLE,hWnd);
SetStdHandle(STD_ERROR_HANDLE,hWnd);
cout << "Welcome to my app .. Enter a value ";
cout.flush();
int i;
//istr >> i;
cin >>i;
cout << endl << "You have entered " << i;
cout.flush ();
istr.close();
ostr.close();
//return CWinThread::Run ();
return 0;
}
6. Compile and build the code
Execution
----------
1. If you execute the app without any command line agrument, it will display a dialog (As usual)
2. To work on command prompt d:\> AppName Console
where console is the paramter that I have checked inside the code..
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
just one more question...
Is it possible that when i call my program in the cmd it will not again call another cmd.
In short, is it possible to use the command line, where the user call my software, for printing...
thanks...
regards...
|
|
|
|
|
My email address is moodsey211@yahoo.com you could send your experiment in this email address.
One more question, is it possible to use the command line where the user called my program for printing.
I mean, i should not reallocate another command line since the user is using the command line in the first place. I would just use the command line, where the user type "mySoft.exe Console" for printing. All the printing and scanning activity to be done it that same command line.
No more new command line pop-up that will appear.
thanks...
regards...
|
|
|
|
|
i have the problem when it comes on printing the number that i have inputed can you help me...
|
|
|
|
|
I will give the vertices of outer polygon, the code need to generate the vertices of inner polygon , with given tolerance for e.g. 50 mt.
|
|
|
|
|
haveu got the algorithm first ?
making it as a code segment is not a problem ..ths problem is moer to do with geometry then codeing ...
redindian
|
|
|
|
|
I dont have the algorithm, iam waiting for that only.
|
|
|
|
|
Iam waiting for the readymade code, because i urgently need that one.
|
|
|
|
|
hi!
does anybody use dialog with big scrollbar (vertical) ?
first if i move the scrollbar down, i can see my buttons in the bottom of the dialog. important: the buttons have to be on the bottom. i don't want them at the top.
but, if i open the dialog, i can't see them.
how can i manage it? i want see the pushbuttons while scrolling, everytime.
it could be similar to the excel function to fix the window i.e for topics at the top of cells.
i tried with floating buttons, but it flickers. not so beautiful
possible, just connect with a dockable window, which include all buttons of the scrollable dialog???
does anybody have an idear?? example?
thanks!!!!
|
|
|
|
|
hi,
can anybody tell me how do i go about building an ISAPI application. the application which i intend to build is as follows: the user will select some options from a web page(options regarding some images) and then click the get button. then the image selected by the user should get displayed on the page. in html this is simple but this is only a test application.in the final application the user is going to select the name of another application and also send some data required by that application. the background program(i.e. the ISAPI extension ) will have to check whether the application required by the user exist and then pass on the data to that application and wait for the result. when it obtains the result it will show it back to the user. so as a first i want only to send back some images. can anyone tell me how to go about this application. i tried using the sample programs on code project but they did not have any explanation and did not worl properly. Lastly is there anyother better way to build this application other than what i have said(if it is the correct way)
thanks
aditya
|
|
|
|
|
Hi friends,
I would like to know how can we transmitt video captured from a webcam to another system through LAN in real time.
(Link to related articles,white papers,sample projects..etc are also welcome!!)
Thanx in advance
|
|
|
|