|
CMDIChildWnd *pMDIActive;
while( pMDIActive = MDIGetActive() )
{
pMDIActive->SendMessage(WM_CLOSE);
}
Regards,
Ram
|
|
|
|
|
yes,I did it with following code:
BOOL CALLBACK EnumChildProc(HWND hwndChild, LPARAM lParam)
{
::SendMessage(hwndChild,WM_CLOSE,0,0);
return TRUE;
}
void CMainFrame::OnWindowCloseall()
{
// TODO: 在此添加命令处理程序代码
::EnumChildWindows(m_hWndMDIClient,EnumChildProc,0);
}
life is like a box of chocolate,you never know what you r going to get.
|
|
|
|
|
thank you for your reply.
I found anoter function:
CDocTemplate* pTemplate = pDocument->GetDocTemplate();<br />
pTemplate->CloseAllDocuments(true);
though I don't know the progress of the function.
|
|
|
|
|
zeus_master wrote: pTemplate->CloseAllDocuments(true);
I'm glad you found this. I can't believe that EnumChildWindows() and SendMessage() were suggested.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
In my project, I want to display some Greman or Japanese word in the list box, but me word already is unicode and it can be displayed in the static control. But it can't display in the list box....How can I solve this problem??
CListCtrl::SetItem( iIndex, iColumn, LVIF_TEXT, pszText, 0, 0, 0, 0 )
Thx
-- modified at 21:46 Sunday 16th July, 2006
|
|
|
|
|
|
Thx a lot
|
|
|
|
|
Dear All,
I have an application which interacts with DLL inturn to a driver..
So when I press a button(named Load Driver) I should call a dll function.In this function i need to display a message that driver is loading and this displayed message should disappear after few minutes...
For displaying this message i created a dialog ( using createDialog) and destroyed it after few minutes,But the problem is, the control (here static text) inside this dialog is not displaying and this createdialog tries to use
dialog which i have in application .DLL is win32 prog..
Manjunath S
GESL
Bangalore
|
|
|
|
|
is ur dll created with MFC? if yes, add this AFX_MANAGE_STATE(AfxGetStaticModuleState()); at the beginning of your exporting function in dll.
life is like a box of chocolate,you never know what you r going to get.
|
|
|
|
|
Dll is not Using MFC.Its a normal Dll
Manjunath S
GESL
Bangalore
|
|
|
|
|
UpdateData(0) ?
|
|
|
|
|
What part of "Dll is not Using MFC." did you miss?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
if u r using HWND CreateDialog(HINSTANCE hInstance,LPCTSTR lpTemplate, HWND hWndParent,DLGPROC lpDialogFunc); to create a dialog, make sure the parameter hInstance is correctly dilivered, it must be the dll module's instance.
life is like a box of chocolate,you never know what you r going to get.
|
|
|
|
|
HI,
How to get DLL module's instance for createDialog...
Manjunath S
GESL
Bangalore
|
|
|
|
|
BOOL WINAPI DllMain(HANDLE hinstDLL, DWORD dwReason, LPVOID lpvReserved); the first parameter is the dllmodule's instance.
life is like a box of chocolate,you never know what you r going to get.
|
|
|
|
|
Manjunath S wrote: But the problem is, the control (here static text) inside this dialog is not displaying...
Are there any other controls on the dialog that are not being displayed? If so, it sounds like a secondary thread is needed as the UI thread is too busy servicing other messages.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Errors:
Sentence error LNK2001: unresolved external symbol "protected: virtual int __thiscall CSentenceList::HowManyWords(char const *)" (?HowManyWords@CSentenceList@@MAEHPBD@Z)
Sentence error LNK2001: unresolved external symbol "protected: virtual void __thiscall CSentenceList::swapWithNext(void)" (?swapWithNext@CSentenceList@@MAEXXZ)
Sentence error LNK2001: unresolved external symbol "protected: virtual void __thiscall CSentenceList::storeSentence(char const *)" (?storeSentence@CSentenceList@@MAEXPBD@Z)
Sentence error LNK2019: unresolved external symbol "public: __thiscall CSentenceArray::CSentenceArray(bool)" (??0CSentenceArray@@QAE@_N@Z) referenced in function "public: __thiscall CSentenceList::CSentenceList(bool)" (??0CSentenceList@@QAE@_N@Z)
Sentence error LNK2019: unresolved external symbol "public: virtual __thiscall CSentenceArray::~CSentenceArray(void)" (??1CSentenceArray@@UAE@XZ) referenced in function "public: virtual __thiscall CSentenceList::~CSentenceList(void)" (??1CSentenceList@@UAE@XZ)
SentenceAr.h
#pragma once
#include <ostream>
using namespace std;
class CSentenceArray
// Sentences stored as an array
{ public:
CSentenceArray(bool bCreateArray);
virtual ~CSentenceArray(void);
void readFromFile (const char *pszFileName);
//void Display (ostream &Sentence);
void sortSentences(bool bAscending); // implements BubbleSort or quicksort
void Clear();
int FirstWord(const char *ptrWord);
int HowManyWords(const char *pszWord);
protected:
//virtual void storeSentence(const char *pszSentence);
//virtual const char *getNextSentence();
//virtual const char *peekNextSentence();
//virtual void swapWithNext();
//virtual void Reset();
//virtual void eraseAll();
private:
char *m_pSentences;
int m_iCurrentPos;
};
SentenceAr.cpp
#include "StdAfx.h"
#include ".\SentenceAr.h"
void CSentenceArray::sortSentences(bool bAscending) // implements BubbleSort or quicksort
{ int x = NULL;
}
void CSentenceArray::Clear()
{}
int CSentenceArray::FirstWord(const char *ptrWord)
{ return 0;}
int CSentenceArray::HowManyWords(const char *pszWord)
{ return 0;}
Jon
|
|
|
|
|
Did you saw MSDN for LNK2001
From the MSDN:
"unresolved external symbol "symbol"
Code references something (such as a function, variable, or label) that the linker can't find in the libraries and object files."
whitesky
|
|
|
|
|
Add your cpp file to your solutions explorer (I'm assuming you're using VS7.1), or File View (if using VS 6.0).
This tells the compiler where to find the implementation of the class definitions.
I Dream of Absolute Zero
|
|
|
|
|
CSentenceArray is not the same thing as CSentenceList .
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
How to hide (or not to create) the menu of an SDI project generated by the wizard code of VC++ 2005? Thanks!
Maxwell Chen
|
|
|
|
|
Maxwell Chen wrote: How to hide (or not to create) the menu of an SDI project
I figured it out.
1) To hide the menu, according to the source code of CDocTemplate, we have to do this way:
pDocTemplate = new CSingleDocTemplate(
0,
RUNTIME_CLASS(CTextEditorDoc),
RUNTIME_CLASS(CMainFrame),
RUNTIME_CLASS(CTextEditorView));
2) Then we will see the icon of the application not being loaded. We have to load it in CMainFrame::OnCreate.
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
Maxwell Chen
|
|
|
|
|
If you don't want the wizard created Menu at any time in your application then simply remove the IDR_MAINFRAME menu resource from your application. If you want to use it in some time then change the ID of the menu from IRD_MAINFRAME to some other
Do your Duty and Don't expect the Result
|
|
|
|
|
The compiler warns at the following
#include "StdAfx.h"
#include ".\sentencelist.h"
CSentenceList::CSentenceList(bool bCreateArray) : CSentenceArray(bCreateArray)
{ int x = NULL; //... this is where the compilation is interrupted
}
CSentenceList::~CSentenceList(void)
{
}
SentenceAr.h
#pragma once
#include <ostream>
using namespace std;
class CSentenceArray
// Sentences stored as an array
{ public:
CSentenceArray(bool bCreateArray);
virtual ~CSentenceArray(void);
void readFromFile (const char *pszFileName);
//void Display (ostream &Sentence);
void sortSentences(bool bAscending); // implements BubbleSort or quicksort
void Clear();
int FirstWord(const char *ptrWord);
int HowManyWords(const char *pszWord);
protected:
//virtual void storeSentence(const char *pszSentence);
//virtual const char *getNextSentence();
//virtual const char *peekNextSentence();
//virtual void swapWithNext();
//virtual void Reset();
//virtual void eraseAll();
private:
char *m_pSentences;
int m_iCurrentPos;
};
SentenceList.h
#pragma once
using namespace std;
#include "sentencear.h"
class CSentenceList :
// Sentences stored as a linked list
public CSentenceArray
{
public:
CSentenceList(bool bCreateArray);
virtual ~CSentenceList();
void deleteWord( const char *pszWord);
void printMaxSentences (ostream &out);
protected:
void CSentenceArray(bool bCreateArray);
virtual void storeSentence(const char *pszSentence);
virtual void swapWithNext();
virtual int HowManyWords(const char *pszWord);
};
Jon
|
|
|
|
|
there's no default constructor defined in your class. you should pass the bool value to the CSentenceArray class.
i.e the implementation code of CSentenceList constructor, you should pass teh bool value to as initialization list
CSentenceList::CSentenceList(bool bCreateArray) : CSentenceArray(bCreateArray)
{
}
hope it's clear
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
My Blog | Understanding State Patte
-- modified at 11:28 Sunday 16th July, 2006
|
|
|
|