Solved

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

Posted on 2002-07-09
10
190 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

813 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now