Click here to Skip to main content
15,899,754 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How do I add controls to my view? Pin
Anonymous2-Sep-03 10:20
Anonymous2-Sep-03 10:20 
AnswerRe: How do I add controls to my view? Pin
Navin2-Sep-03 10:28
Navin2-Sep-03 10:28 
GeneralHiding MDI child window at startup, check the code please Pin
mr20032-Sep-03 8:24
mr20032-Sep-03 8:24 
GeneralRe: Hiding MDI child window at startup, check the code please Pin
valikac2-Sep-03 9:38
valikac2-Sep-03 9:38 
GeneralRe: Hiding MDI child window at startup, check the code please Pin
Brian Shifrin3-Sep-03 12:08
Brian Shifrin3-Sep-03 12:08 
GeneralAutomation server help needed Pin
Gilrock2-Sep-03 8:13
Gilrock2-Sep-03 8:13 
GeneralRe: Automation server help needed Pin
Brian Shifrin3-Sep-03 12:10
Brian Shifrin3-Sep-03 12:10 
GeneralRe: Automation server help needed Pin
Gilrock3-Sep-03 12:53
Gilrock3-Sep-03 12:53 
The automation class already contains those calls as inserted by the ClassWizard.

Just try this and you should see the problem:
1) Create a new single dialog MFC application called TestServer.
2) Change TestServer.cpp to look like the following:
// Parse the command line to see if launched as OLE server
COleTemplateServer::RegisterAll();
if (RunEmbedded() || RunAutomated())
{
  // Register all OLE server (factories) as running.  This enables the
  //  OLE libraries to create objects from other applications.
  return TRUE;
}
else
{
  // When a server application is launched stand-alone, it is a good idea
  //  to update the system registry in case it has been damaged.
  COleObjectFactory::UpdateRegistryAll();
}

3) Add a class called Interface1 derived from CCmdTarget that is creatable by type id TestServer.Interface1.
4) Add a get property to Interface1 called StepSize and have it's implementation return 5.0.
5) Create a file called test.vbs which contains the following:
Dim x
set x = CreateObject("TestServer.Interface1")
WScript.Echo x.StepSize
WScript.Echo x.StepSize

6) Execute the application which will bring up the dialog.
7) Then double-click the test.vbs file to execute it.
8) Before you close the windows script host messagebox that returned "5", hit the "OK" button on the dialog which will close it.
9) Then hit "OK" on the windows script host messagebox.
10) You will see the error message that the remote server machine does not exist. So I want to know how to change this so that closing the dialog doesn't kill the server.

Gil
GeneralRe: Automation server help needed Pin
igor19603-Sep-03 13:48
igor19603-Sep-03 13:48 
GeneralRe: Automation server help needed Pin
Gilrock3-Sep-03 20:07
Gilrock3-Sep-03 20:07 
GeneralRe: Automation server help needed Pin
Gilrock4-Sep-03 6:10
Gilrock4-Sep-03 6:10 
GeneralRe: Automation server help needed Pin
igor19604-Sep-03 7:05
igor19604-Sep-03 7:05 
GeneralRe: Automation server help needed Pin
Gilrock4-Sep-03 8:15
Gilrock4-Sep-03 8:15 
Generalfree(pMemory) Pin
ravingcoder2-Sep-03 8:11
ravingcoder2-Sep-03 8:11 
GeneralRe: free(pMemory) Pin
igor19602-Sep-03 8:15
igor19602-Sep-03 8:15 
GeneralRe: free(pMemory) Pin
ravingcoder2-Sep-03 8:24
ravingcoder2-Sep-03 8:24 
Generalexporting std::string Pin
Jim Crafton2-Sep-03 7:46
Jim Crafton2-Sep-03 7:46 
GeneralRe: exporting std::string Pin
cmk2-Sep-03 7:52
cmk2-Sep-03 7:52 
GeneralRe: exporting std::string Pin
Neville Franks2-Sep-03 10:01
Neville Franks2-Sep-03 10:01 
GeneralRe: exporting std::string Pin
Navin2-Sep-03 10:22
Navin2-Sep-03 10:22 
GeneralRe: exporting std::string Pin
cmk2-Sep-03 14:05
cmk2-Sep-03 14:05 
Generalunicode woes Pin
Jim Crafton2-Sep-03 7:08
Jim Crafton2-Sep-03 7:08 
GeneralRe: unicode woes Pin
cmk2-Sep-03 7:50
cmk2-Sep-03 7:50 
GeneralRe: unicode woes Pin
Jim Crafton2-Sep-03 8:07
Jim Crafton2-Sep-03 8:07 
GeneralRe: unicode woes Pin
cmk2-Sep-03 9:12
cmk2-Sep-03 9:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.