|
Thank you !
But I still dont understand, why this '&' is in the definition of windows
#define ON_COMMAND_EX(id, memberFxn)\
{ WM_COMMAND, CN_COMMAND, (WORD)id, (WORD)id, AfxSig_bw, \
(AFX_PMSG)(BOOL (AFX_MSG_CALL CCmdTarget::*) (UINT))&memberFxn },
and works when i use the original macro.
-----
Mit freundlichen Grüssen/Best Regards/Un cordial saludo.
Ing. José Manuel Hostalet Wandosell, Fraunhofer IPA, Abt.323/Robotersysteme
Nobelstrasse 12, D-70569 Stuttgart (Germany)
mailto:jose.hostalet@ipa.fhg.de, http://www.ipa.fhg.de
|
|
|
|
|
|
When I loaded up VC++ 6.0 today and went to my resource editor to edit a dialog box in my project, every time I double clicked on a part of it the MFC Class Wizard popped up and told me to add the dialog to a class. I am not using MFC, I have no idea how this setting got turned on and more importantly I don't know how to get rid of it so I can get on with my project. Someone please tell me how to de-activate this feature it is driving me nuts Thanks!
|
|
|
|
|
Tools - Options - Compatibility - uncheck "Double-click in Dialog editor edits code (MFC only)".
By this way feature is deactivated completely. I really don't know what to do if you want to deactivate it only for non-MFC projects.
|
|
|
|
|
Thanks a lot, that did the trick.
|
|
|
|
|
Hi all,
I developped a MDI application that shows a timetable for an appointment system. It basically show staff members and the appointments they are assigned. Each appointment is represented using a derived CWnd object. You get information on appointments by hovering on them using another CWnd derived object.
My problem is that I've got a lot of flicker when i'm dragging appointments or when I hovering on appointments. It really flicker when there's a lot of appointments showing up.
I tried implementing double-buffering but it didn't change anything, any idea?
Pyt
|
|
|
|
|
Try to show the information by testing for a time lag
of say about 500 ms to 1 sec.
I think windows tooltips are also implemented in this manner
|
|
|
|
|
You can should draw at first to a memory dc and the draw to the screen.
Another solution is to use timers for redrawing.
My experience is also if it doesn´t work, may be there an conceptional mistake.
(Oversized solution)
IMHO: that each appointment is a CWnd seems to be no good idea. I would internally work with an array and access it via the screen coordinates. The output would be simple Retangles.
Try it @ home. (B&B)
|
|
|
|
|
Hi,
The thing is that my controls are drawing themselves and that I already implemented a memory dc in the drawing code.
Could the problem be that my view is not actually drawing the controls, but just sending a WM_PAINT message to each of my derived CWnd controls ?
|
|
|
|
|
You´re right. You have understood the principle architecture of the Windows API.
My suggestion implies that the area would be drawn by the "containing" window.
Try it @ home. (B&B)
|
|
|
|
|
Thanks for the info, i'll give it a go.
Pyt
|
|
|
|
|
|
By the way, did you know that 'flicker' is dutch 'slang' for a homosexual guy?
Imagine what MS-Word said a few years ago when I typed in a meeting report that one of our applications had a flicker-problem...
(I know this really belongs in the lounge-forum, but I couldn't resist, sorry).
Enjoy life, this is not a rehearsal !!!
|
|
|
|
|
Is there a way to find the minimum necessary size for the buffer argument of vsprintf before making the call?
rechi
|
|
|
|
|
sprintf works by calling a the low-level output function (_output) with a stream handle. that same output function handles all printf-style output (printf, sprintf, fprintf, etc). the output function simply outputs to a stream, which can grow as large as necessary.
so... to simulate it... run down the format string, parse it, add up the size of all the output specs. not easy.
-c
A conclusion is simply the place where someone got tired of thinking.
|
|
|
|
|
Use _vsnprintf and if it returns -1, your buffer is too small.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
If you have MFC installed (with VC6), the CString member "FormatV" (which is internally called by "Format"), does this sort of checking (i.e., runs through the format specifications and makes a "guess" at what size the buffer should be). The code for this function is in "YOUR_ROOT_MSDEV_DIRECTORY_HERE\vc98\mfc\src\strex.cpp"
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
I have an application where I want to find out the details of a DLL - version, internal name etc. if possible.
There is an original DLL which I need to check and replace with another of the same name.
Any ideas ?
Thanks.
Elaine
Would you like to meet my teddy bear ?
|
|
|
|
|
You can read the version resource from them:
Here's a snippet from my code that does a very simple resource reading. (m_sArquivo has the fileName)
DWORD dwDummyHandle;
CString sArquivo(m_sArquivo.c_str());
DWORD dwSize = GetFileVersionInfoSize(sArquivo.LockBuffer(), &dwDummyHandle);
sArquivo.ReleaseBuffer();
if (dwSize == 0)
throw CWin32Error();
BYTE *lpBuffer = new BYTE[dwSize];
if (!GetFileVersionInfo(sArquivo.LockBuffer(), dwDummyHandle, dwSize, lpBuffer))
{
delete []lpBuffer;
throw CWin32Error();
}
VS_FIXEDFILEINFO *vInfo;
UINT uInfoSize;
if (!VerQueryValue(lpBuffer, _T("\\"), (LPVOID*)&vInfo, &uInfoSize))
{
delete []lpBuffer;
throw CWin32Error();
}
if (uInfoSize == 0)
{
delete []lpBuffer;
throw CWin32Error();
}
std::strstream out;
out << HIWORD(vInfo->dwFileVersionMS) << "."
<< LOWORD(vInfo->dwFileVersionMS) << "."
<< HIWORD(vInfo->dwFileVersionLS) << "."
<< LOWORD(vInfo->dwFileVersionLS) << std::ends;
delete []lpBuffer;
return out.str();
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
I create a project where I include a file.h in another folder in the same project.
when I used #include "myfile.h"
the compiler don't find the file.
How can I do for find it ?
Best Regards
youssef
|
|
|
|
|
use
#include "dir/myfile.h"
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
or add the path ( relative path, not absolute ) to the "additional include directories" in the C++ tab of the project settings.
|
|
|
|
|
If the thumb compiler doesn´t find the file because he doesn´t find the file you must show him the file.
Try it @ home. (B&B)
|
|
|
|
|
The workspace pane lists the following function incorrectly:
<br />
void Show(CRect rectTitle, LPCTSTR lpszTitleText, int xoffset = 0, LPRECT lpHoverRect = NULL, const LOGFONT* lpLogFont = NULL, COLORREF crTextClr = CLR_DEFAULT, COLORREF crBackClr = CLR_DEFAULT);<br />
It will say:
<br />
Show(CRect rectTitle, LPCTSTR lpszTitleText, int xoffset)<br />
When double-clicked, VS shows a messagebox saying it can't find the definition(implementation) of this function. (Well, duh...)
When it's changed (LPRECT changed to something like CRect*), the workspace pane will list the function as:
Show(CRect rectTitle, LPCTSTR lpszTitleText,int xoffset, CRect* lpHoverRect, const int LOGFONT)
Again, it goes awry, and this time it screws up bad... VERY bad. Making a
The only way to get a correct listing in the workspace pane is by removing the default-values....
This bug does not influence the compiling, fortunatly, but it makes debugging these botched functions a bit annoying. (select a different function, then scroll to the botched up one.)
|
|
|
|
|
Hello, everybody. I have an application in which I will have a control box with several data to fill in, several data to be updated, and some command buttons. I also like to add menu facilities.
If I used the mfc (exe) wizard application, either I create a single document or a control-box based application. So,
1. How do I include a control box without having a menu command to invoke it, I mean that the control box appears when I start the application.
2. How do I include menues facilities to the control-box based application?
I have been looking the online help, ans some manuals I have got without success.
Thank you very much,
Eric Manuel Rosales Pena Alfaro
PhD student
Unversity of Essex
Wivenhoe Park
Colchester, CO4 3SQ
Essex, Uk
email: emrosa@essex.ac.uk
tel: +44-01206-87311
|
|
|
|