Excuse me,dear sir.Recenntly I am building a MDI project with several views only one document.There are some views from cview,some from CScrollview,and others from CformView.We have many CButton controls on the views derived from CFromview.Now I want use those button controls to switch those views.namely every button is corresponding with one view.How to do this ??
That is a tall order, not really that simple.
Take a look at this article http://www.codeproject.com/dialog/visualfx.asp.
The author essentially puts all views in a splitter.
Let me know if I can be of any help after you read it.
PS English is not my native language however in an informal enviroment like this group is you do not need to start "excuse me..."
I can speak only for myself but this is a very friendly bunch.
Just say "Hi" in future.
nice to hear from you.
Well I am currently developing an application which has three documents and they all have pretty much same "static" views. Presently I do not need dynamic / new views and have put such creation on back burner. But I do remeber your solution and have a copy of it in my project - thanks.
I do like mentioned visual framework but I keep running into problems with it. Right now I have changed the way the documents are manipulated ( document alters the text file) and one of the views has a rich text control attached to display the text file.
And it asserts on creation of the view... It worked fine when the file got procesed in the view itself. So I am debugging,
I faced out with such assertions during my project. It can be that you are trying to initialize the values of the control in the constructor of the view. Does will crash because the view is being created but it is not yet. So the controls that needs relationships with the frame which contains them, doesn't have the handlers in this moment and an assertion comes.
I solved it creating/initializating/charging datas for the controls in the OnInitialUpdate ();
maybe works for u too
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
Once you get the other process running, if you want to wait for it to finish,
you're getting out of newbie territory.
If you want the spawning app to remain responsive, it needs to process window
messages while waiting for the spawned app to complete. There's lots of ways
to do this.
Here's an example of one method for you to study.
1) creates another process (I used Notepad as an example)
2) disables the main window of the calling app so the user can't do anything there
(note that this example was tested from the main window class. You may need to
enable/disable your app's main window a little differently, depending on where this code
3) enters a modal loop to wait for the spawned process to terminate. To keep
the calling app responsive in the meantime, queued window messages are dispatched.
4) enables the main window of the calling app so the user can continue
*Edit* Replace those stupid smilies with capital 'P's LOL
// Handle the return value from DoModal
switch ( nRet )
memset(&StartupInfo, 0, sizeof(STARTUPINFO));
StartupInfo.cb = sizeof(STARTUPINFO);
// StartupInfo.lpReserved = 0;
// StartupInfo.lpDesktop = 0;
// StartupInfo.lpTitle = 0;
// StartupInfo.dwX = 0;
// StartupInfo.dwY = 0;
// StartupInfo.dwXSize = 100;
// StartupInfo.dwYSize = 100;
// StartupInfo.dwXCountChars = 0;
// StartupInfo.dwYCountChars = 0;
// StartupInfo.dwFillAttribute = 0;
StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
StartupInfo.wShowWindow = SW_SHOWDEFAULT;
if (::CreateProcess(_T("C:\\WINDOWS\\notepad.exe"), // LPCTSTR lpApplicationName,
NULL, // LPTSTR lpCommandLine,
0, // LPSECURITY_ATTRIBUTES lpProcessAttributes,
0, // LPSECURITY_ATTRIBUTES lpThreadAttributes,
FALSE, // BOOL bInheritHandles,
NORMAL_PRIORITY_CLASS, // DWORD dwCreationFlags,
0, // LPVOID lpEnvironment,
0, // LPCTSTR lpCurrentDirectory,
&StartupInfo, // LPSTARTUPINFO lpStartupInfo,
&;ProcessInfo // LPPROCESS_INFORMATION lpProcessInformation
// Disable the main application window so user can't do anything
// Wait for the spawned process to terminate
DWORD dwWaitRet = ::MsgWaitForMultipleObjects(1, &;ProcessInfo.hProcess, FALSE, INFINITE, QS_ALLEVENTS);
if (WAIT_OBJECT_0 == dwWaitRet)
// Spawned app has terminated
else if (WAIT_OBJECT_0 + 1 == dwWaitRet)
// Queued window message(s) available
// Dispatch all queued messages
while (::PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
// Re-enable the main application window
I hope this gives you some ideas to work with. There's many ways to do this.
This example is relatively simple and doesn't involve multiple threads.
I'd like to create online backups of my Visual Studio directories. I work from a location with a reeeeeaaaallllllyyyyy sllllloooowwww connection, so I was thinking of creating as minimal backups as possible. Has anyone solved this problem?
I was thinking that I only need the .vcproj, the .rc, the source code (.cc and .h) to be able to completely recreate the project.
I back up every couple of hours or after a major code problem gets solved/overcome.
In order to make it all fit in a reasonable space, I just delete the .ncb file, release folder , and debug folders. Those seem to be the biggest users of disk space (for medium to large projects at least) IMO.
I have solved the problem... removing the bind() function execution.
Acording with the MSDN documentation:
"The bind function is used on an unconnected socket before subsequent calls to the connect or listen functions. It is used to bind to either connection-oriented (stream) or connectionless (datagram) sockets. When a socket is created with a call to the socket function, it exists in a namespace (address family), but it has no name assigned to it. Use the bind function to establish the local association of the socket by assigning a local name to an unnamed socket."
I understood that the bind function is not necessary, because I only want to send datagrams with a SOCKET to server and receive the responses by the same SOCKET, and the WSAAsyncSelect function grants the data response to the app.
I've been looking through the MSDN documentation, but I haven't found how to add topics to html help in a VS2003 project. In particular, some how dialog controls must be maped to IDs in the HTML help project file. (I found how to get from there to the html files.) Could anyone explain how this happens?