 |
|
 |
Hello When I try to automate word application, in Visual Studio 2005, I am getting 100s of Errors such as
"Error 7 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\documents and settings\sudhakar\desktop\m\testauto\testauto\debug\msword.tlh 13448"
How to resolve these errors.
Here is the below code as guided from http://support.microsoft.com/kb/178749
Thanks,
Sudhakar
if(!AfxOleInit()) // Your addition starts here.
{
AfxMessageBox("Cannot initialize COM dll");
return FALSE;
// End of your addition.
}
AfxEnableControlContainer();
CWordApplication app; // app is the Excel _Application object
// Start Excel and get Application object.
if(!app.CreateDispatch("Word.Application"))
{
AfxMessageBox("Cannot start Word and get Application object.");
return;
}
else
{
//Make the application visible and give the user control of
//Microsoft Word.
app.put_Visible(TRUE);
app.put_UserControl(TRUE);
}
|
|
|
|
 |
|
 |
Hello,
I compiled your code with Visual Studio 2005 with the C++ Code Analyzer enabled an get the following warnings:
ftab.cpp(298) : warning C6011: Dereferencing NULL pointer 'pTab': Lines: 275, 277, 278, 281, 282, 289, 292, 293, 294, 295, 296, 298
ftab.cpp(341) : warning C6011: Dereferencing NULL pointer 'pTab': Lines: 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341
ftab.cpp(590) : warning C6011: Dereferencing NULL pointer 'pTab': Lines: 572, 573, 575, 576, 581, 586, 587, 588, 589, 590
Andreas.
|
|
|
|
 |
|
 |
Hello,
I get the following errors warnings, if compiling with VS 2005.
ftab.h(78) : warning C4244: 'return' : conversion from 'INT_PTR' to 'int', possible loss of data
ftab.cpp(58) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
ftab.cpp(59) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
ftab.cpp(60) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
ftab.cpp(61) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
ftab.cpp(62) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
ftab.cpp(456) : error C2664: 'int CWnd::GetWindowTextW(LPTSTR,int) const' : cannot convert parameter 1 from 'char [4096]' to 'LPTSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
ftab.cpp(458) : error C2664: 'CFolderTab::SetText' : cannot convert parameter 1 from 'char [4096]' to 'LPCTSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
ftab.cpp(492) : error C2664: 'AppendMenuW' : cannot convert parameter 4 from 'const char [4]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
ftab.cpp(493) : error C2664: 'AppendMenuW' : cannot convert parameter 4 from 'const char [7]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
ftab.cpp(494) : error C2664: 'AppendMenuW' : cannot convert parameter 4 from 'const char [7]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
ftab.cpp(495) : error C2664: 'AppendMenuW' : cannot convert parameter 4 from 'const char [1]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
ftab.cpp(496) : error C2664: 'AppendMenuW' : cannot convert parameter 4 from 'const char [14]' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
ftab.cpp(586) : warning C4244: 'return' : conversion from '__w64 int' to 'BOOL', possible loss of data
ftab.cpp(720) : warning C4244: '=' : conversion from '__w64 int' to 'int', possible loss of data
ftab.cpp(786) : error C2664: 'strlen' : cannot convert parameter 1 from 'LPCTSTR' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
ftab.cpp(790) : warning C4312: 'type cast' : conversion from 'LONG' to 'WNDPROC' of greater size
ftab.cpp(791) : warning C4311: 'type cast' : pointer truncation from 'LRESULT (__stdcall *)(HWND,UINT,WPARAM,LPARAM)' to 'long'
Andreas.
|
|
|
|
 |
|
 |
Hello When I try to automate word application, in Visual Studio 2005, I am getting 100s of Errors such as
"Error 7 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\documents and settings\sudhakar\desktop\m\testauto\testauto\debug\msword.tlh 13448"
How to resolve these errors.
Here is the below code as guided from http://support.microsoft.com/kb/178749
Thanks,
Sudhakar
if(!AfxOleInit()) // Your addition starts here.
{
AfxMessageBox("Cannot initialize COM dll");
return FALSE;
// End of your addition.
}
AfxEnableControlContainer();
CWordApplication app; // app is the Excel _Application object
// Start Excel and get Application object.
if(!app.CreateDispatch("Word.Application"))
{
AfxMessageBox("Cannot start Word and get Application object.");
return;
}
else
{
//Make the application visible and give the user control of
//Microsoft Word.
app.put_Visible(TRUE);
app.put_UserControl(TRUE);
}
|
|
|
|
 |
|
 |
I use vc++6.0 to test your code, but it doesn't work.Why???Can you tell me how to use it under vc++6.0???
|
|
|
|
 |
|
 |
i wanna use the class to change the CFormView.
i add a CTabCtrl to CFrameWnd, but when i click the tab
the CTabCtrl cant get the focus and get the tabchange message?
i do just as follow
class CMainFrame : public CFrameWnd
{
private:
CTabCtrl m_tabCtrl;
...............
}
CMainFrame::OnCreateCleint(....)
{
CRect rc;
GetClientRect(&rc);
rc.top = rc.bottom + GetSysMetrics(SM_CXVSCROLL);
m_tabCtrl.Create(this, rc, WS_CHILD|WS_VISIBLE, ....); // I cant remember.
}
CMainFrame::OnSize(.....)
{
CRect rc;
GetClientRect(&rc);
rc.top = rc.bottom + GetSysMetrics(SM_CXVSCROLL);
m_tabCtrl.MoveWindow(&rc,....);
}
it display like what i want, but when i click the CTabCtrl, the CTabCtrl cant
get message and cant change the CFormView.
why??????????
ussthamcn@sina.com
huaam@hotmail.com
thanks
|
|
|
|
 |
|
 |
Could you show me the project in which you use this very interesting Excel-like tab control ? Thank you very much.
Here's my email :
zhu3374@163.com
|
|
|
|
 |
|
 |
I got to step 2 and see if the tab shows up I don't see anything
CFolderTabCtrl& ftc = FolderTabs;
VERIFY (ftc.Create (WS_CHILD|WS_VISIBLE, rc, this, 1, FTS_BUTTONS));
When I get to step 3
si.nMax = giPaperWdDP;
si.nPos = gisFlsHorzOffset;
si.nPage = gisFlsHorzInc;
gi value aren't defined
I ran into similar problem when I tried Paul DiLascia's code(For that one I added the code into MainFrame)
|
|
|
|
 |
|
 |
I too would like to see how this was implemented in an actual program. I would appreciate it if you could send anything that would better illustrate how to use it with CSrollView class.
Thanks
rfhn@hotmail,com
|
|
|
|
 |
|
 |
I'm very interested in your code, can you give me an example? I want to get an app and know how to use it. Thank you. Please send it to deer@webmail.hebut.edu.cn
|
|
|
|
 |
|
 |
Which view class are you using. CFolderTabCtrl does not work with CScrollView.
Marcus Carey
|
|
|
|
 |
|
|
 |
|
 |
I can see what it is and I can run Excel to play with the original tab control but I suggest you to upload a sample EXE so that people could handle it before they start using your code. anyway looks impressive.
|
|
|
|
 |
|
|
 |
|
 |
There is something wrong when the leftmost tab is not the very first beginning. For example, the leftmost tab begins with 100th one or more. The editor was located at the wrong position.
Here is a minor fixup listed below.
void CFolderTabCtrl::OnEditRenameSheet()
{
// get the position for the proposed edit box
CRect rc = GetTab(m_iCurItem)->GetRect();
//--- offset tab position ---
CFolderTab* firstTab = GetTab(m_iFirstTab);
int xOrigin = m_cxButtons;
if (firstTab)
xOrigin -= firstTab->GetRect().left;
rc.left += xOrigin ;
rc.right += xOrigin ;
// make the edit box smaller than the tab trapezoid
rc.top++;
rc.left += (CXOFFSET + CXMARGIN);
rc.right -= (CXOFFSET + CXMARGIN);
rc.bottom--;
...
}
|
|
|
|
 |
|
 |
Would you like give me some examples? I downloaded http://download.microsoft.com/download/msdnmagazine/code/Oct02/WXP/EN-US/CQA0210.exe, but it is not ok.
"StdAfx.h(8) : fatal error C1083: Cannot open include file: 'gdiplus.h': No such file or directory"
Thank you in advance
Cui Sheng
Shengcui@hotmail.com
|
|
|
|
 |
|
 |
You need to download gdiplus for microsoft's msdn site in order to use the example code that Paul has graciously provided.
Lynn
|
|
|
|
 |
|
 |
I mean how do you set demensions of rc ?
// create the folder tabs window
CFolderTabCtrl& ftc = FolderTabs;
VERIFY (ftc.Create (WS_CHILD|WS_VISIBLE, rc, this, 1, FTS_BUTTONS));
|
|
|
|
 |
|
 |
Here is my code that I used rc with:
// create the scroll bar windows
CRect rc (0,0,0,0);
VERIFY (HorzScrollBar.Create (WS_VISIBLE | WS_CHILD | SBS_HORZ,
rc, this, AFX_IDW_HSCROLL_FIRST));
VERIFY (VertScrollBar.Create (WS_VISIBLE | WS_CHILD | SBS_VERT,
rc, this, AFX_IDW_HSCROLL_FIRST + 1));
VERIFY (ScrollBarBox.Create (WS_VISIBLE | WS_CHILD | SBS_SIZEBOX,
rc, this, -1));
Lynn
|
|
|
|
 |
|
 |
Thank you very much. I looked at the code from Paul di Lascia and understood how he creates scrollbars and folders control.
I tried, like you did, to add folders control directly to my view (a form view to be more accurate), and it works not too bad. However, under Win XP, when resizing, scroll bars and folders inopportunely start blinking. The cause, I think, is folders control and scroll bars are components of the form view, and the form view draw them as any of its children. Nevertheless, with the folder frame, I don't get this inconvenient. On the other hand, the conception of this framework is more complicated.
Anyway, good work !
|
|
|
|
 |
|
 |
Thanks for your kind reply.
Sorry,I have forgotten to say thanks for 6 years.
Cui Sheng
|
|
|
|
 |
|
 |
This is exactly what I needed, thanks!
|
|
|
|
 |
|
 |
Could you show me the project in which you use this very interesting Excel-like tab control ? Thank you very much.
Here's my email :
YacineLAIDI95000@yahoo.fr
|
|
|
|
 |