|
Thanks ravi.
That was a really good hint.
Now I use
csDir = (*m_pRecentFileList)[nMRUIndex];
instead of my first try
m_pRecentFileList->GetDisplayName(csDir,nMRUIndex,"",0,true);
and it works fine.
|
|
|
|
|
By now I can generate some dib bitmap in a MDI application dynamic, so there are many bitmap in a view.In one hand,I need to manipulate these bitmap by the mouse, for example, drag a bitmap to somewhere else, or enlarge a bitmap by drag a bitmap's edge and so on.Another hand, I also need to manipulate these bitmap in while,such as printing the whole view.
What should do?
I think I need define a new view class or control which can contain and display one bitmap.then I only need the manipulate the view class or control.
andy
|
|
|
|
|
|
thank you, Selvam.
andy
|
|
|
|
|
How do I make my dialog box initially visible with MFC?
|
|
|
|
|
say detailedly .
CDialog dlg;
dlg.DoModal() ??
|
|
|
|
|
I had tried that. Actually I want to use the dialog box as a toolbar, that is why i want it visible. I have .cpp and .h files for the toolbar class derived from CDialog. I included the .h file in MainFrm.cpp. I also have CToolBarNew m_wndToolBarNew; in the protected section ofCMainFrame class. But it still gives compiler error: missing storage-class or type specifiers
|
|
|
|
|
Kapgan wrote:
I included the .h file in MainFrm.cpp.
Put it in the MainFrm.h file.
Why aren't you extending CToolBar?
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
- -Uknown.
|
|
|
|
|
What is the simplest way to create a socket for UDP transfer
|
|
|
|
|
The "simplest" way is to search codeproject instead of asking here!
Don't try it, just do it!
|
|
|
|
|
How to implement the concept of Media Gateways in VoIP.
What are the values for parameters of the socket() function in VC++ to send RTP datagrams.
|
|
|
|
|
Hi all,
I am currently evaluating SSL components from IPWorks to
implement https protocol for client-server communication.
But it is a bit expensive, do anyone have any experience on using it
or are there any other cheaper component for SSL communication ?
Thanks
|
|
|
|
|
Check out OpenSSL.
Kuphryn
|
|
|
|
|
MS XML Core[^]
ed
~"Watch your thoughts; they become your words. Watch your words they become your actions.
Watch your actions; they become your habits. Watch your habits; they become your character.
Watch your character; it becomes your destiny."
- -Uknown.
|
|
|
|
|
I was wondering if any has info on the undocumented menu control messages, similar to the button messages: BM_CLICK, etc.
I found a really simple way to subclass the menu by changing its windows-class wnd proc.
First create an invisible menu window with the class name of "#32768" called from the CMainFrame's OnCreate, using it as a parent:
hwnd = CreateWindow( "#32768", "", WS_CHILD, 0,0,10,10,
pParent->m_hWnd, (HMENU) 0, AfxGetInstanceHandle(), &cs );
Then replace the window-class wnd proc with your own:
s_OldWindowProc = (WNDPROC) SetClassLong( hwnd,
GCL_WNDPROC, (DWORD) WindowProc );
Then destroy the window because you don't need it anymore - all menus in your app have the same class wnd proc.
In your "WindowProc" you send all the messages to the orginal class proc using CallWindowProc().
Here are the messages and what they seem to do:
0x000001E5: -Draw mouseover item and send statusbar msg.
0x000001EF: -Send out the command msg
0x000001E4: -End of popup menu
0x000001ED: -Process lbuttondown, draw pressed item, send statusbar msg
0x000001EB: -Handles when to send the command and terminate the popup
Now I think I have enough to override all the drawing so I can replace it with my own, while maintaining full menu functionality, even though I have to use LockWindowsUpdate() to prevent drawing on 0x01E5 and 0x01ED, while calling the orginal proc.
But it would be great to get the message names and the info they have in the Params, which would make skinning the menus a lot easier. Any help or info on where I can this information would be greatly appreciated.
BTW, thanks to .dan.g. and his orignal article on the subject for a lot of the information: http://www.codeproject.com/menu/skinmenu.asp
|
|
|
|
|
Hi All,
Looking for a way to dynamically control the lock and unlock a file between processes on a Unix machine using C++. Is it best to use the POSIX resource control?
Thanks in advance.
Ken
|
|
|
|
|
I have a program which shuts a system down with the following:-
rc = ExitWindowsEx(EWX_SHUTDOWN | EWX_FORCE, 0);
pApp->LogString("Completed shutdown");
if (!rc)
dwError = GetLastError();
I suppose about half the time, this code operates on the Win98 system without a problem and shuts down O.K. However, on other occasions it hangs. Is this a known problem with Win98 ?? - I believe the O/S is up to date. Any ideas would be appreciated !
Doug
|
|
|
|
|
From the MSDN docs on ExitWindowsEx
[quote]
EWX_FORCE Forces processes to terminate. When this flag is set, the system does not send the WM_QUERYENDSESSION and WM_ENDSESSION messages. This can cause the applications to lose data. Therefore, you should only use this flag in an emergency.
Windows 95/98/Me: Because of the design of the shell, calling ExitWindowsEx with EWX_FORCE fails to completely log off the user (the system terminates the applications and displays the Enter Windows Password dialog box, however, the user's desktop remains.) To log off the user forcibly, terminate the Explorer process before calling ExitWindowsEx with EWX_LOGOFF and EWX_FORCE.
[/quote]
Drop the EWX_FORCE flag.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Thanks for the response - I had already seen the quoted text but, at the time, decided that (within my usage) there was no "data" to be lost. It's some time since I tried it without the EWX_FORCE flag so the following may be entirely wrong, but I've got a feeling I end up with the "Enter Windows Password dialog box, and I didn't know how to "terminate the explorer process". Can you explain how I would go about that ? Incidently (and I forgot to post this originally), when the shut down DOES fail/hang, there is just a desktop background without any icons, taskbar, etc. Anyhow, I'll try it again without the EWX_FORCE flag to refresh my memory ! Appreciate any help with the termination of the Windows Password dialog though !
Doug
|
|
|
|
|
I have now removed the EWX_FORCE flag and, on this occasion, no 'hang' occured. However the problem (without use of the flag)is when there is a network connection - during the shutdown process, a dialog appears stating that 'n' users are connected and proceeding will cause their disconnection; the dialog ultimately requests confirmation that shutdown should continue. How do I avoid this dialog without using the EWX_FORCE flag (assuming that that is the cause of the 'hang' during shutdown) Thanks in advance for any help on this !
Doug
|
|
|
|
|
I think your major problem is Win98 itself. It will sometimes (frequently) hang even when you use the Start->Shutdown->Shutdown commands. I believe it is a bug in the OS and there is not much you can do about it.
The problem I have with EWX_FORCE is that it suppresses the usual shutdown sequence that many apps use, and simply kills them. I would be very annoyed if any app that I had installed on my machine did that. If you feel you must use it go ahead, just seems very extreme to me.
As for the dialogs that popup, you could use a CBT_HOOK to catch any windows that are created while your code is running, and simply send a WM_CLOSE message to them. Just a suggestion, I do not know if it work or not.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Hi,
I'm trying to prevent certain Microsoft Platform SDK headers from being included into my project. Is there a view that shows the list of files as the compiler is compiling them, along with the header files that get included in the compile process? The output view that the compiler show is not detailed enough, it doesn't show which file actually #include a file.
Thanks
Hua-Ying
|
|
|
|
|
|
Are you using MS Visual Studio? What version?
In Studio 2003, you can go to Project Properties, C/C++, Advanced and change "Show Includes" to "Yes".
-----------------------------
Get trial copy of comment generating tool CommentMakerPro, std::string and std::string containers viewer FeinEvaluatorPro and windows manager for Microsoft Visual Studio .NET FeinWindows at www.FeinSoftware.com
|
|
|
|
|
Both suggestions were very helpful!
Thanks
Hua-Ying
|
|
|
|