|
toxcct wrote: So, it happened to you too ?!
What?
Honestly... , today several things happened to me.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
you too, you had to remove your html in your sig ?!
|
|
|
|
|
The compiler is too stupid?
how can you say that when you don't even understand the whole logic of the language ? the proof is the large amount of "stupid" questions you flood here.
what happends if you declare you private vi member as a vector<int> instead of a vector<int>& ?
and are you sure your sample is correct ? didn't you declare you member const either ?
|
|
|
|
|
|
I have toolbar resource having id IDR_FORMAT_TOOLBAR
there is button on toolbar having id ID_LINK_BUTTON
I want to enable this button in some function call
please help me for this...
Chetan
|
|
|
|
|
What about sending the TB_ENABLEBUTTON message http://msdn2.microsoft.com/en-us/library/bb787311.aspx[^]?
for instance:
SendMessage( hWndToolbar, TB_ENABLEBUTTON, ID_LINK_BUTTON, MAKELONG (TRUE, 0));
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
you need to handle ON_UPDATE_COMMAND_UI.
|
|
|
|
|
m_YourTB.EnableButton(ID_LINK_BUTTON, TRUE);
Regards,
Paresh.
|
|
|
|
|
When I call SetNewView, it's ok ,and the new formview (A) can receive message. But then I press a button in the view, and it called SetNewView to change to another formview (B), it looks ok, but B can't receive its messages, instead A receives, also, A's buttons will appear when I click on that area.
Here is how to do with CViews instead of CFormViews
http://msdn2.microsoft.com/en-us/library/s199bks0(VS.80).aspx#vcconswitchingfunctiona4[^]
BOOL CMyAlbumEditorApp::InitInstance()
{
#ifdef _AFXDLL
Enable3dControls();
#else
Enable3dControlsStatic();
#endif
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings();
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CMyAlbumEditorDoc),
RUNTIME_CLASS(CMainFrame),
RUNTIME_CLASS(CMyAlbumEditorView));
AddDocTemplate(pDocTemplate);
EnableShellOpen();
RegisterShellFileTypes(TRUE);
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
if (!ProcessShellCommand(cmdInfo))
return FALSE;
InitViews();
SetNewView(m_pStartView);
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
return TRUE;
}
void CMyAlbumEditorApp::InitViews()
{
m_pNativeView = ((CFrameWnd*)m_pMainWnd)->GetActiveView();
CDocument* pCurrentDoc = ((CFrameWnd*)m_pMainWnd)->GetActiveDocument();
CCreateContext newContext;
UINT viewID;
CRect rect(0, 0, 0, 0);
m_pStartView = (CView*) new CStartForm;
newContext.m_pNewDocTemplate = NULL;
newContext.m_pLastView = NULL;
newContext.m_pCurrentFrame = NULL;
newContext.m_pCurrentDoc = pCurrentDoc;
viewID = AFX_IDW_PANE_FIRST;
m_pStartView->Create(NULL, "StartFormViewName", WS_CHILD, rect, m_pMainWnd, viewID, &newContext);
m_pStartView->SendMessage(WM_INITIALUPDATE, 0, 0);
m_pAlbumPropertyView = (CView*) new CAlbumPropertyForm;
newContext.m_pNewViewClass = NULL;
newContext.m_pNewDocTemplate = NULL;
newContext.m_pLastView = NULL;
newContext.m_pCurrentFrame = NULL;
newContext.m_pCurrentDoc = pCurrentDoc;
viewID = AFX_IDW_PANE_FIRST;
m_pAlbumPropertyView->Create(NULL, "AlbumPropertyFormViewName", WS_CHILD, rect, m_pMainWnd, viewID, &newContext);
m_pAlbumPropertyView->SendMessage(WM_INITIALUPDATE, 0, 0);
}
void CMyAlbumEditorApp::SetNewView(CView *pNV)
{
#ifndef _WIN32
::SetWindowWord(m_pNativeView->m_hWnd, GWW_ID, ::GetWindowWord(pNV->m_hWnd, GWW_ID));
#else
::SetWindowLong(m_pNativeView->m_hWnd, GWL_ID, ::GetWindowLong(pNV->m_hWnd, GWL_ID));
#endif
((CFrameWnd*) m_pMainWnd)->SetActiveView(pNV);
((CFrameWnd*) m_pMainWnd)->RecalcLayout();
pNV->ShowWindow(SW_SHOW);
}
modified on Tuesday, December 04, 2007 9:25:01 AM
|
|
|
|
|
If the area is cover by the previous formview, then messages in that area is handled by the previous formview, otherwise, it receives the message.
How strange! Why?
|
|
|
|
|
All CFormViews have the same ID, does it cause the problem?
viewID = AFX_IDW_PANE_FIRST
But if I change them to value other than AFX_IDW_PANE_FIRST, the view is even not changed.
How to do?
|
|
|
|
|
Mr followait,
you've been on this forum long enough to know the posting rules here.
1) when you post a code sample, you must use <pre></pre> tags rather than <code></code> .
2) you must post a relevant piece of code, NOT a whole huge file.
3) you're aware already of the Edit link at the bottom of your messages. instead of reposting a new message, edit the first ones.
4) don't just ask people "what's wrong". it's YOUR code, so YOU have to search what's wrong. at least, you have to prove that you tried it, by providing your debugging steps and the results, problems you encountered then.
|
|
|
|
|
1) ok
2) In fact, I had thought before post the piece of code, the context is needed, and it is only the framework, it is easy to read
3) ok, I just don't want people who had read the long message to search again for what I edited. next time, I'll be care
4) I've tried. I will add a line "with a CView, it works".
|
|
|
|
|
2) He didn't say it was difficult. He said it as a lot. You can try to find out which lines are giving the problem and comment a bit what is done before them, put the relevant code and put a comment with what you are trying to make.
3) When you edit a message it comes an auto "modified on .... at .... am/pm" so if u are adding you can put it below that line, if not you can always say "EDIT: I have changed...."
About your question of the Resource ID it has nothing to do. I have a programm with 1 main view (scroll view) and up to 63 secondary views derived from 5 different CFormViews (so the repettion index is 24x, 12x, 12x, 12x, 2x, 1x) and I dont change the resource name of the CFormView at all.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Hi,
I need to develop an editor, which need to support auto completion(like intellisense). Can any of you, suggest me which one is better to take up for implementation of intellisense in VC++,C#.
Any suggestions will be appreciated.
sree
|
|
|
|
|
I'm certain there is at least one article on CP about that.
and I'm also certain someone else suggested having a look at Scintilla[^].
|
|
|
|
|
How to copy a file from pocket PC to destktop PC.I want to get the best method.Please help me.Thank you!The follow is my code,but I need the better measure.Which fuction can do it?
CString strFileNamePC=_T("d:\\nini.txt");
CString strFileNamePPC=_T("\\nini.txt");
CFile oldFile;
oldFile.Open(strFileNamePC, CFile::modeWrite|CFile::modeCreate|CFile::typeBinary);
BSTR bstr = strFileNamePPC.AllocSysString();
SysFreeString(bstr);
CeRapiInit();
HANDLE h;
h = CeCreateFile(bstr, GENERIC_READ, 0/*cannot be shared*/, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
char cTemp[BUFFER_SIZE];
DWORD nbytes;
CString s;
int iTotBytes = 0;
DWORD n=CeGetFileSize(h,NULL);
if(h!=INVALID_HANDLE_VALUE)
{
AfxMessageBox("??");
while(CeReadFile(h, cTemp, (DWORD)n, &nbytes, NULL)&&nbytes>=1)
{
//if(nbytes>=1)
oldFile.Write(cTemp,n);
}
}
CeCloseHandle(h);
oldFile.Close();
CeRapiUninit();
Yunasheng Ni
|
|
|
|
|
I Want to work with word 2003,2007 in my mfc app .what file do i need?
i need to include msword.h but mfc i dont find msword.h
|
|
|
|
|
have you installed the Office SDK ?
|
|
|
|
|
|
|
But there isn't any Office word or something like that...
The Only thing is Word 2003 XML sdk
|
|
|
|
|
|
Can you send sdk link download for me?
thank you...
|
|
|
|
|
can you send office sdk download link ?
|
|
|
|
|