Solved

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

Posted on 2002-07-09
10
187 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Login Script to Copy Folders 12 29
has77  challenge 9 73
sumHeights  challenge 17 66
x-bar in Google Sheets 2 27
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

21 Experts available now in Live!

Get 1:1 Help Now