Solved

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

Posted on 2002-07-09
10
184 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

758 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