Solved

HOW to "open" a cmd.exe so its output behave just like a CView in MDI???

Posted on 2002-07-09
10
193 Views
Last Modified: 2013-11-20
Hi,

I need to open a telnet session within my application and
I was wondering if I could use telnet.exe and "dock" it
within my framewindow just like any CView? It could be
resized, minimized, maximized and would show up in the
"Windows" menu item just like any doc/view... but it would
be "contained" within my application and now a shelled out
process...

Is this possible? How to go about doing it???

Thanks
0
Comment
Question by:aquila98
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 7141250
This isn't possible. But, why don't you 'just' integrate some telnet server code like the one here:
http://www.codeguru.com/network/ChessServer.shtml 
http://www.codeguru.com/internet/Ibrar-Telnet.html
0
 
LVL 86

Expert Comment

by:jkr
ID: 7141252
Ooops, disregard the 1st link, this is really a telnet server :o)
0
 
LVL 30

Expert Comment

by:Axter
ID: 7141914
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 30

Expert Comment

by:Axter
ID: 7141916
You should be able to easily adapt the telnetview project into your project.
0
 
LVL 2

Author Comment

by:aquila98
ID: 7143082
I tried to include the CTelnetView (which is SDI) into my
project (which is MDI) and when the Telnetview starts
it seems to hand in ProcessOptions() and just wait there
hogging the cpu! Must I create a thread separatly???

Here is how I open the ctelnetview:
CFrameWnd* pFrameWnd= NULL;
CTelnetView* pView;
CMyApp* pApp= (CMyApp*)AfxGetApp();
tDocMap::iterator d= m_DocMap.find(aHost); // map<string, CMDIChildWnd*>

if (d == m_DocMap.end())
{
 pApp->BeginWaitCursor();
 CTelnetDoc* pDocument = (CTelnetDoc*) pApp->m_pTelnetDocTemplate->CreateNewDocument();
 pDocument->SetPathName(aHost);
 pDocument->SetTitle(aHost);
 pFrameWnd= pApp->m_pTelnetDocTemplate->CreateNewFrame(pDocument,NULL);
 ASSERT(pFrameWnd);
 pApp->m_pTelnetDocTemplate->InitialUpdateFrame(pFrameWnd,pDocument);
 POSITION pos= pDocument->GetFirstViewPosition();
 ASSERT(pos != NULL);
 pView= (CTelnetView*)pDocument->GetNextView(pos);
 ASSERT(pView != NULL);
 ((CMDIChildWnd*) pView->GetParentFrame())->MDIMaximize();
 m_DocMap.insert(std::pair<std::string, CMDIChildWnd*>(aHost,((CMDIChildWnd*) pView->GetParentFrame())));
 pView->GetDocument()->SetTitle(aHost);
 pApp->EndWaitCursor();
}
else
 {
  if (d != m_DocMap.end())
 (*d).second->MDIActivate();
 }

anything wrong with that setup???
Suggestions?
0
 
LVL 2

Author Comment

by:aquila98
ID: 7146086
I should point out that this code (to open a telnet view) is
within a singleton object which acts as a window controller.
Maybe the way I create the ctelnetview is wrong and that's
why it does not works as a MID... it keeps looping in its
processingoption function...
0
 
LVL 2

Author Comment

by:aquila98
ID: 7196302
oh well, never mind :/
I decided to simply shell out to dos, much simpler
awaiting time when I can build a Formview using a control


thanks for your time.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7196544
A request for deletion has been made.  I am inclined to refund points and place in PAQ

Experts, thoughts?

Computer101
E-E Moderator
0
 
LVL 86

Expert Comment

by:jkr
ID: 7196566
No objections here.
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 7197228
Points refunded and placed in PAQ

Computer101
E-E Moderator
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
xyBalance chalenge 58 96
Unix / Linux grid computing 5 162
Problem to event 3 102
Thin secure Windows 10 5 102
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question