Click here to Skip to main content
15,921,716 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Exiting process Pin
aks.12-Sep-07 15:49
aks.12-Sep-07 15:49 
Questionproblem with multithreading and wrapper-class object Pin
kyer12-Sep-07 4:53
kyer12-Sep-07 4:53 
AnswerRe: problem with multithreading and wrapper-class object Pin
Randor 12-Sep-07 4:59
professional Randor 12-Sep-07 4:59 
GeneralRe: problem with multithreading and wrapper-class object Pin
kyer12-Sep-07 5:30
kyer12-Sep-07 5:30 
GeneralRe: problem with multithreading and wrapper-class object Pin
Randor 12-Sep-07 6:07
professional Randor 12-Sep-07 6:07 
GeneralRe: problem with multithreading and wrapper-class object Pin
kyer12-Sep-07 8:23
kyer12-Sep-07 8:23 
AnswerSolution Pin
kyer12-Sep-07 9:12
kyer12-Sep-07 9:12 
Questionexcel problem Pin
tunminhein12-Sep-07 4:28
tunminhein12-Sep-07 4:28 
Hello all,

Now I writing about TTS program. I already got the TTS function from the Microsoft word.
but Now I effort to write for MS Excel. The following is a piece of code of MSWord.
CMSWordSpy::CMSWordSpy()
: m_nStart(-1)
, m_nEnd(-1)
, m_bstrText(_T(""))
, m_pApp(NULL)
, m_pWindow(NULL)
, m_pRangeReplace(NULL)
, m_pRangeOrg(NULL)
, m_pScanRange(NULL)
, m_bWordIsRunning(false)
, m_hwnd(NULL)
, m_hwndRef(NULL)
{}

CMSWordSpy::~CMSWordSpy()
{}

void CMSWordSpy::dump_com_error(_com_error &e)
{
/*
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());

CString s;
s.Format(_T("code=%08lx, meaning=%s, Source=%s, Description = %s"),
e.Error(),
e.ErrorMessage(),
(LPCTSTR) bstrSource,
(LPCTSTR) bstrDescription);
LOG(s);
TRACE(s);
*/
}

void CMSWordSpy::Connect(BOOL bNewDoc, BOOL bMaximize)
{
if (m_bWordIsRunning)
return;

try
{
if (SUCCEEDED(m_pApp.GetActiveObject(L"Word.Application")))
{
TTS.Speak(_T("Key stone is connecting to Microsoft Word."),
_T("Windows"), LH_MODESENTENCE, -1, -1, TRUE);
if (bMaximize)
m_pApp->WindowState = wdWindowStateMaximize;
if (bNewDoc)
{
DocumentsPtr pDocs = m_pApp->Documents;
pDocs->Add();
}
m_bWordIsRunning = true;
}
}
catch (_com_error &e)
{
dump_com_error(e);
}
}

void CMSWordSpy::Disconnect()
{
if (m_bWordIsRunning)
{
try
{
TTS.Speak(_T("Key stone is disconnecting from Microsoft Word"),
_T("Windows"), LH_MODESENTENCE, -1, -1, TRUE);

// Setting smart pointers to NULL automatically
// handles any necessary release.
m_pWindow = NULL;
m_pRangeReplace = NULL;
m_pRangeOrg = NULL;
m_pScanRange = NULL;
m_pApp = NULL;
}
catch (_com_error &e)
{
dump_com_error(e);
}
}
m_bWordIsRunning = false;
}

but now i got the error in msword.tlh file. that's file is auto generate file.
<b>error is C2011 'enum redefinition'</b>

is anyone help me for that problem ?

Thanks,
tun
QuestionRe: excel problem Pin
David Crow12-Sep-07 5:33
David Crow12-Sep-07 5:33 
QuestionProjectsettings for dual core cpu's? Pin
bosfan12-Sep-07 4:19
bosfan12-Sep-07 4:19 
AnswerRe: Projectsettings for dual core cpu's? Pin
Randor 12-Sep-07 4:22
professional Randor 12-Sep-07 4:22 
GeneralRe: Projectsettings for dual core cpu's? Pin
bosfan12-Sep-07 4:28
bosfan12-Sep-07 4:28 
GeneralRe: Projectsettings for dual core cpu's? Pin
carrivick12-Sep-07 21:50
carrivick12-Sep-07 21:50 
GeneralRe: Projectsettings for dual core cpu's? Pin
bosfan12-Sep-07 21:55
bosfan12-Sep-07 21:55 
Questiontemplate specialization Pin
Russell'12-Sep-07 3:51
Russell'12-Sep-07 3:51 
AnswerRe: template specialization Pin
Nelek12-Sep-07 3:57
protectorNelek12-Sep-07 3:57 
GeneralRe: template specialization Pin
Russell'12-Sep-07 4:01
Russell'12-Sep-07 4:01 
GeneralRe: template specialization Pin
Nelek12-Sep-07 4:37
protectorNelek12-Sep-07 4:37 
GeneralRe: template specialization Pin
Russell'12-Sep-07 5:55
Russell'12-Sep-07 5:55 
GeneralRe: template specialization Pin
Nelek12-Sep-07 21:45
protectorNelek12-Sep-07 21:45 
AnswerRe: template specialization Pin
Cedric Moonen12-Sep-07 4:08
Cedric Moonen12-Sep-07 4:08 
GeneralRe: template specialization Pin
Nelek12-Sep-07 4:32
protectorNelek12-Sep-07 4:32 
GeneralRe: template specialization Pin
Russell'12-Sep-07 5:15
Russell'12-Sep-07 5:15 
GeneralRe: template specialization Pin
Russell'12-Sep-07 4:35
Russell'12-Sep-07 4:35 
QuestionC++ templates Pin
minkowski12-Sep-07 2:48
minkowski12-Sep-07 2:48 

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.