|
Look at CDocument::UpdateAllViews. You could record the color change in the document and the call UpdateAllViews using a private hint value. In all the views let the OnUpdate handler do an Invalidate() when lHint == YourPrivateValue.
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Thanks for the reply...
Actually i have created many child windows using the architecture (i have MDI application) i have each separate view with the its own document and this view/ document i have loaed in to a new frame...
i want to update these frames ......
|
|
|
|
|
Put a function in the app class that iterates through all of the doc templates, and iterates through all the documents for each template and call UpdateAllViews(NULL) for each document.
void CMyApp::UpdateAllViews()
{
POSITION posTemplate = GetFirstDocTemplatePosition();
while (posTemplate)
{
CDocTemplate* pTemplate = (CDocTemplate*)GetNextDocTemplate(posTemplate);
POSITION posDoc = pTemplate->GetFirstDocPosition();
while (posDoc)
{
CDocument* pDocument = pTemplate->GetNextDoc(posDoc);
if ((pDocument=) != NULL)
{
pDocList->UpdateAllViews(NULL);
}
}
}
}
|
|
|
|
|
Thanks for the Reply....
I was alos following this approach but it is not working as i again used this way to solve my problem......
|
|
|
|
|
Then you will have to describe your problem in more detail. What exactly are you trying to update?
There is a parameter list associated with UpdateAllViews() which essentially allows you to control pretty much any aspect of the updating process.
Also, you cannot do this from the CMainFrame class without a moderate amount of extra work.
|
|
|
|
|
Here are the Details what i am facing.....
I Have Multiple frames in my Application. And all these frames are derived from CChildFrame and I have created Three views and documents attached with each frame.
For one frame i loaded one view and exactly one Document...
Now I have a problem for the updation of the frames...
|
|
|
|
|
You'll have to do three things:
1) Use this function call inside your iterator function (the one I gave you earlier):
posDoc->UpdateAllViews(NULL, (WPARAM)1);
2) In your view->OnUpdate() function, add code to handle the second parameter. If it's set to 1, update the frame like so:
GetParentFrame()->SendMessage(MY_MESSAGE, 0, 0);
3) Add a message handler in your frame class to handle the message.
|
|
|
|
|
I'd like to exchange text, audio or video information between two hosts threw NetMeeting API. But where can I find any tips on this topic? Thanks a lot.
Tiny Flying Elephant loves flying...
|
|
|
|
|
Have you looked at the Samples in the Platform SDK. I found them to be quiet useful when I did a little bit of NetMeeting Video work a while back.
Michael
|
|
|
|
|
hello,
i would like to know whether it is possible to use the CreateFile() function
on a netware drive. I have tried to create a handle on a directory by
pointing to \\servername\directory and map drive but somehow the error
return saying that the path is not found. Is there a problem with the
protocol cos the netware that i am using runs on IPX protocol.
Any help would be great.
Thanks
wye kean
|
|
|
|
|
How would I set up file saving/opening on this?
-Matt Newman
|
|
|
|
|
In OnSerialise, read and write the individual grid positions, and the other info you want ( grid size, column sizes, etc. )
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
OK. One last question I have pointer m_pGrid declared in C%Name%View how do I access it in C%Name%Doc? Thanks for the help.
-Matt Newman
|
|
|
|
|
CMainFrame* pMain = (CMainFrame*)AfxGetMainWnd();
CMyView * pView = (CMyView*)pMain->GetActiveView();
pView->m_pGrid->etc.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I am using a for statment to go through it all but how would I create a variable based on the cell it is working on say CString CellXY X and Y being the cell's coordinates?
-Matt Newman
|
|
|
|
|
I haven't done any serialisation for *ages* but I wold do something like this:
ar << m_pGrid->GetColumns()
ar << m_pGrid->GetRows()
for (int x = 0; x < m_pGrid->GetColumns(); ++x)
for (int y = 0; y < m_pGrid->GetRows(); ++y)
ar << m_pGrid->GetData(x,y);
I don't know if ANY of these functions exist or if I'm serialising properly, but you get the idea. You'd need to save the number of rows & columns first for when you read back in.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Ok I think I have it.
-Matt Newman
|
|
|
|
|
The Grid has Load/Save functions that will read and write from comma delimited files. There is a serialize function someone sent in that I will merge eventually.
cheers,
Chris Maunder (CodeProject)
|
|
|
|
|
OK. I just find the whole Doc/View annoyingly confusing and stupid. Oh well.
-Matt Newman
|
|
|
|
|
I am trying to write a custom AppWizard. I would like my AppWizard to be able to enable the "Build browser info file" facility. I can see how to do this using the "Project>Settings" menu option, but I can not see how to get a custom AppWizard to do this automatically. I thought it might involve using AddToolSettings, but what is the name of the tool (Is it bscmake?) and what is the command option that you use?
|
|
|
|
|
Hi Anonymous,
The tool is bscmake.exe
Try the following:
VARIANT dummy = {0};
CString browseInfoFileName;
CComPtr<IConfiguration> pConfigs;
//Place the following line into the string above:
/o"\my_project\output_folder/project_name.bsc"
pConfigs->AddToolSettings(L"bscmake.exe",
browseInfoFileName.AllocSysString(), dummy);
Better late than never
|
|
|
|
|
Hi,
I would like to post a . I think I have found the right way to do it, but it just will not work. It only works if I want to post an URL (like http://www.foo.com/res.asp&name=bart), but not if it is alot of text.
Below is some sample code, that I would like to use for sending an SMS message programatically.
try{
CString strHeaders = _T("Content-Type: application/x-www-form-urlencoded");
CString strFormData = _T("afsender=boetos&modtager=5555554578&besked=this+is+a+test");
CInternetSession session;
CHttpConnection* pConnection = session.GetHttpConnection(_T("212.112.128.11"));
if (pConnection)
{
CHttpFile* pFile = pConnection->OpenRequest(CHttpConnection::HTTP_VERB_POST, _T("/res.asp"));
ASSERT(pFile);
BOOL result = pFile->SendRequest(strHeaders, (LPVOID)(LPCTSTR)strFormData, strFormData.GetLength());
if (result)
{
CString strData;
CString strBuff;
while (pFile->ReadString(strBuff))
{
strData += strBuff;
strBuff.Empty();
}
FILE *f=fopen("res.html", "w");
if (f)
{
fprintf(f, strData);
fclose(f);
}
AfxMessageBox("Done!");
pFile->Close();
delete pFile;
}
}
pConnection->Close();
delete pConnection;
}
catch (CInternetException* pEx)
{
pEx->ReportError();
pEx->Delete();
return;
}
Can anybody tell me what goes wrong?
Regards,
Christian Skovdal Andersen
|
|
|
|
|
Hi all,
I wanna get file Created Date of file ...
I don't want to use MFC ...
Please help me ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
time_t GetFileDateString(const CString &csFQSrcPath, BOOL bMod)
{
struct _stat buf;
int result = _stat( csFQSrcPath, &buf );
if( result != 0 ) {
return "?/?/?";
}
time_t ft = buf.st_ctime;
if (bMod)
ft = buf.st_mtime;
return ft;
}
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Hi Chris
Thanks for your helps, Your help was useful ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|