Solved

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

Posted on 2002-07-09
10
195 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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
Include multiple hostnames in this command? 3 56
format the code in java 6 117
Not needed 13 134
Problem to Office 1 67
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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 an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

738 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