|
Again, once you have grasped the MFC serialization fundamentals (please see the link to the documentation I provided in the below thread), you'll find yourself how to serialize the CTreeCtrl object.
Veni, vidi, vici.
|
|
|
|
|
Why file? Thats so Windows 3.11's win.ini
Do it in the registry.
But here you go.
|
|
|
|
|
Actually serialization has (almost) nothing to do with .ini files and it still a well-alive technique (one may argue that .ini files too are still used).
Veni, vidi, vici.
|
|
|
|
|
Again you are always right.
The Wiki page states:
Serialization is the process of converting a data structure or object state into a format that can be stored (for example, in a file or memory buffer, or transmitted across a network connection link) and "resurrected" later in the same or another computer environment.
http://en.wikipedia.org/wiki/Serialization[^]
The INI file format is an informal standard for configuration files for some platforms or software. INI files are simple text files with a basic structure composed of "sections" and "properties".
http://en.wikipedia.org/wiki/INI_file[^]
|
|
|
|
|
TopCoder23 wrote: Again you are always right.
May I forward your sentence to Mrs 'The Wife'?
Veni, vidi, vici.
|
|
|
|
|
thanks its done from ur help...
|
|
|
|
|
|
Hi all,
please guide me or help me to use serialization in my dialog based application.
thanks.
|
|
|
|
|
You have been a member here long enough to know that questions like this can be researched quite easily by using Google and/or MSDN. For MSDN you can go directly to the CArchive class and learn how to use that.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
There is nothing special in using serialization in a dialog based appication. You might start reading the documentation[^] in order to implement it.
Veni, vidi, vici.
|
|
|
|
|
|
|
|
Hi,
I have a Worker thread started in my main thread CWinAPP
and I am trying to do a SendMessage to a CDIalog
seems I can only do a Send/PostMessage to the CMainFrame Main Window
can someone corrabrate or dispute this
and if so is there a way to get a Message to the CDialog
thanks
|
|
|
|
|
What kind of communication you want to make with the dialog?
Is that dialog is alive when you send the message?
Note that the Post message will not block your thread, and sendmessage will.
|
|
|
|
|
The Thread is Created in the CWinApp::Initinstance
seems like either Send/PostMessage always references the MainWinow CMainFrame
I keep on getting CInvalidArg exception because my WIndow Handle is the CDialog
|
|
|
|
|
Before trying to use threads to communicate with the GUI I strongly suggest you reading some Newcomer's articles about. You may start, for instance with "Using Worker Threads"[^].
Veni, vidi, vici.
|
|
|
|
|
Please answer :
- Whereby does the secondory thread know the dialog ?
- When will the first message be sent ?
They sought it with thimbles, they sought it with care;
They pursued it with forks and hope;
They threatened its life with a railway-share;
They charmed it with smiles and soap.
|
|
|
|
|
I save a CWnd * or Cialog * pointer in a global object on the heap
The thread retervies that pointer
However it seems that the Send/PostMessage can only send messages to the CMainFrame
|
|
|
|
|
Do you have such an "if" statement ? :
{
HWND hDlg = g_pcDialog->GetSafeHwnd();
if (hDlg) {
::SendMessage(hDlg, WM_COMMAND, IDOK, 0);
}
}
They sought it with thimbles, they sought it with care;
They pursued it with forks and hope;
They threatened its life with a railway-share;
They charmed it with smiles and soap.
modified 30-Jul-12 8:48am.
|
|
|
|
|
ForNow wrote:
However it seems that the Send/PostMessage can only send messages to the CMainFrame
That's not true... you can post messages to any HWND[^] (which is the appropriate method versus saving a CWnd or CDialog). In another words, you can send messages to anything that has a window associated with it (not the only way, but it's a good generic statement), which sort of leads to a common way of messaging to classes that don't have other framework characteristics, make an invisible window for them that others can use as messaging targets.
|
|
|
|
|
Note that SendMessage() cannot be used to send messages to controls that were *not* created by the thread sending the message. See my answer to This Question[^]
|
|
|
|
|
I'm having a wee bit of a problem on my new system.
I installed Visual Studio 2008 on my new laptop (my old system died). I had already tried to use
ML and Link and mspdb80.dll which were in my TOOLS directory, but the system said that "mspdb80 is
the wrong version, check installation", so I tried the install. I had already used bcdedit.exe to
modify the path to add my TOOLS directory (there is no more autoexec.bat in Windows 7 - and I was
coming from Windows XP).
Now when I execute bcdedit.exe (as administrator) I now just get a flash on the screen (starts to
execute then immediately quits). I wrote a pathedit.bat file to execute bcdedit.exe (from its
location in the Windows 7), then pause. I get the following when I execute it
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
\mail\autoexec>pathedit
(which contains:
C:\Windows\System32\bcdedit.exe
pause
\mail\autoexec>C:\Windows\System32\bcdedit.exe
'C:\Windows\System32\bcdedit.exe' is not recognized as an internal or external command,
operable program or batch file.
\mail\autoexec>pause
Press any key to continue . . .
Several interesting things are apparent. Why does the batch file execution identify itself as
"Microsoft Windows [Version 6.1.7601]"
My system is Windows 7 Home Premium (from Control Panel:System).
Secondly, why does Windows now say that bcdedit.exe "is not recognized..."
Has the installation of Visual Studio 2008 clobbered Windows 7? It did not report any errors,
but I have not tested Visual Studio yet.
Note the following PATH display.
The first entry is where I added the path to my TOOLS directory before I installed Visual Studio.
The last entry (at least the last entry - I don't have a copy of the path from before the Visual
Studio install) is where Visual Studio added the entry for "Microsoft SQL Server\90\Tools\binn\" and
I had noticed that installation as it installed.
PATH=F:\DATA(F)\xxxxxxxxxx\yy\TOOLS;C:\Program Files (x86)\HP SimplePass 2012\x64;C:\Program Files (
x86)\HP SimplePass 2012\;;C:\Program Files\Broadcom\Broadcom 802.11\Driver;;C:\Program Files (x86)\A
MD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Program Files\Common Files\Microsoft Sha
red\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system
32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files
(x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShare
d\;C:\Program Files (x86)\Common Files\Roxio Shared\12.0\DLLShared\;C:\Program Files (x86)\Windows L
ive\Shared;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\WIDCOMM\Blue
tooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files\Broadcom\WHL\;
C:\Program Files\Broadcom\WHL\syswow64;C:\Program Files\Broadcom\WHL\SysWow64\;C:\Program Files\Broa
dcom\WHL\SysWow64\syswow64;c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\
What should I do other than restore the system from before the installation attempt?
I did take a full system Norton Ghost save to my backup external drives (actually, a Symantic
Recovery Disk full save with the system shut down).
Has anyone else run into this?
Has anyone got any ideas?
Dave.
|
|
|
|
|
I don't think your system is hosed.
Windows version 6.0 was Vista. 6.1 is "Win 7"
Forget what I wrote below. I was wrong.
Go to your start menu and locate the Visual Studio Tools folder. Then launch the "Visual Studio 2008 Command Prompt".
This will set the environment variables to their proper values. BCDEdit is located in the SDK folder, not \Windows\System32.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Richard,
Thank you for the prompt reply. Without Visual Studio installed, The path I used for bcdedit.exe was correct, and I used it to add my TOOLS path. I guess that there is a registry entry that pointed to it, and the registry was changed when Visual Studio installed. Now that the registry does not point there anymore, Windows 7 refuses to accept the old .exe. The "help" didn't say how to get into bcdedit,exe, only that it was the new method to replace autoexec.bat, so I used explorer and search to find it the first time.
I'll try your method.
Dave.
|
|
|
|