Click here to Skip to main content
15,914,111 members
Home / Discussions / COM
   

COM

 
GeneralRe: Problem with Word automation/Shapes/AddCurve Pin
Vi28-Mar-04 18:45
Vi28-Mar-04 18:45 
GeneralThanks, but that isn't a problem Pin
Member 3538108-Mar-04 19:10
Member 3538108-Mar-04 19:10 
GeneralRe: Thanks, but that isn't a problem Pin
Vi28-Mar-04 19:26
Vi28-Mar-04 19:26 
GeneralRe: Thanks, but that isn't a problem Pin
Member 3538108-Mar-04 23:20
Member 3538108-Mar-04 23:20 
GeneralI can't beleive that I wasted so much time with this Pin
Member 3538109-Mar-04 0:56
Member 3538109-Mar-04 0:56 
GeneralMFC executable registration. Pin
oleg638-Mar-04 12:25
professionaloleg638-Mar-04 12:25 
GeneralRe: MFC executable registration. Pin
Mike Dimmick16-Mar-04 2:31
Mike Dimmick16-Mar-04 2:31 
GeneralRe: MFC executable registration. Pin
oleg6316-Mar-04 4:14
professionaloleg6316-Mar-04 4:14 
Thanks Mike,
I've found the simpliest solution.

enum eRegistration{eNothing, eRegisterServer, eUNRegisterServer};
eRegistration process_program_arguments(LPSTR m_lpCmdLine);
...
App::InitInstance()
{
...
if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated)
return TRUE;

if (cmdInfo.m_nShellCommand == CCommandLineInfo::AppUnregister)
{
m_server.UpdateRegistry(OAT_DISPATCH_OBJECT);
COleObjectFactory::UpdateRegistryAll(FALSE);
}
else
{
m_server.UpdateRegistry(OAT_DISPATCH_OBJECT);
COleObjectFactory::UpdateRegistryAll();
}
if (!ProcessShellCommand(cmdInfo)) // Dispatch commands specified on the command line
return FALSE;

if(process_program_arguments(m_lpCmdLine))
return FALSE;

...
...
}

eRegistration process_program_arguments(LPSTR lpCmdLine)
{
char* lpProgArg = _strdup( lpCmdLine );
char seps[] = " -/"; // program arguments separators
char Register[] = "regserver";
char UNRegister[] = "unregserver";

eRegistration ret = eNothing;

char *token = strtok( lpProgArg, seps );
while( token != NULL )
{
if ( !strcmp(token,Register) )
{
ret = eRegisterServer;
}
if ( !strcmp(token,UNRegister) )
{
ret = eUNRegisterServer;
}
token = strtok( NULL, seps );
}
free( lpProgArg );
return(ret);
}

In StdAfx.cpp
#include <afxctl.h>

That's it.
Thanks for hint.
Oleg
Questionussoftproblem with COM server registration??? Pin
pelos7-Mar-04 4:41
pelos7-Mar-04 4:41 
AnswerRe: ussoftproblem with COM server registration??? Pin
Steve S7-Mar-04 22:03
Steve S7-Mar-04 22:03 
GeneralRe: ussoftproblem with COM server registration??? Pin
pelos8-Mar-04 11:37
pelos8-Mar-04 11:37 
AnswerRe: ussoftproblem with COM server registration??? Pin
Anonymous8-Mar-04 9:36
Anonymous8-Mar-04 9:36 
AnswerClass not registered Pin
pelos9-Mar-04 20:06
pelos9-Mar-04 20:06 
AnswerRe: ussoftproblem with COM server registration??? Pin
Vi29-Mar-04 20:44
Vi29-Mar-04 20:44 
GeneralRe: ussoftproblem with COM server registration??? Pin
pelos10-Mar-04 0:15
pelos10-Mar-04 0:15 
QuestionCopying an automation object? Pin
Zee man6-Mar-04 22:46
Zee man6-Mar-04 22:46 
AnswerRe: Copying an automation object? Pin
Steve S7-Mar-04 22:00
Steve S7-Mar-04 22:00 
GeneralRe: Copying an automation object? Pin
Zee man8-Mar-04 4:04
Zee man8-Mar-04 4:04 
GeneralRe: Copying an automation object? Pin
Steve S8-Mar-04 4:33
Steve S8-Mar-04 4:33 
QuestionHow to make clickable/ draggable shapes Pin
Anonymous4-Mar-04 21:24
Anonymous4-Mar-04 21:24 
Generalopening an Excel file Pin
Liate2-Mar-04 5:37
Liate2-Mar-04 5:37 
GeneralRe: opening an Excel file Pin
Steve S2-Mar-04 6:24
Steve S2-Mar-04 6:24 
GeneralRe: opening an Excel file Pin
Liate2-Mar-04 19:55
Liate2-Mar-04 19:55 
GeneralProblem while destroying SafeArray Pin
mandarpb1-Mar-04 22:09
sussmandarpb1-Mar-04 22:09 
GeneralRe: Problem while destroying SafeArray Pin
Steve S1-Mar-04 22:22
Steve S1-Mar-04 22:22 

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.