|
Hi i saw you asking code for all the questions.
And many people told you to have a look at MSDN first.
After getting the API you need, check its parameter and the way how it can be used in MSDN.
Refer here[^]
Do your Duty and Don't expect the Result
|
|
|
|
|
Do you know, Why all the people want you to search MSDN ?
Its simple, then only you can learn MFC and also other persons help won't work all the time.
If you search by yourself it won't forget and you may come across various other API and techniques. It might not be the thing u want, but it'll be helpful in the future and to know MFC.
If you depend on other persons, you can make your thing to work but u will forget it as quickly as possible and you'll not know the working technique behind it.
'www.msdn.microsoft.com' is the msdn site and use the search facility in it.
Do your Duty and Don't expect the Result
|
|
|
|
|
|
how to close all child windows in MDI?
like the VC->windows->Close All command
|
|
|
|
|
EnumChildWindows maybe helpful.
life is like a box of chocolate,you never know what you r going to get.
|
|
|
|
|
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
|
|
|
|