|
While I usually try to avoid any message boxes that do not stem from my own code, I now am facing a box that comes from MFC, but the weird thing is that it is empty... which is not that helpful. I stumbled upon this a few times during testing, but never cared since I removed the various DDV_XXX functions later that caused those boxes. This only happens in Release build, which uses statically linked MFC, so I suppose it has something to do with that...
Is there any way to get some more meaningful message boxes with statically linked MFC?
http://www.renderpal.com
http://www.shoran.de
|
|
|
|
|
Do you use custom DDV processing? Can you post the DDV code that causes this? What VS version?
|
|
|
|
|
No and no; the VS version is 2005. If I knew where exactly this errors pops ups, I'd be much further... I am also not sure if it is a DDV call, since I barely use them.
http://www.renderpal.com
http://www.shoran.de
|
|
|
|
|
Daniel 'Tak' M. wrote: I now am facing a box that comes from MFC
What do you mean by this? I don't think you will get random message boxes without writing some code.
Daniel 'Tak' M. wrote: I stumbled upon this a few times during testing, but never cared
Big mistake.
I must get a clever new signature for 2011.
|
|
|
|
|
I suggest you follow the tried and true and procudure of getting a stack trace when the problem occurs. You may want to alter the settings for the release build so that a pdb file is built (so you get a more meaningful stack).
Steve
|
|
|
|
|
My main problem is not to find out where it occurs, the main problem is why all warnings and errors from MFC are empty... It doesn't happen only this one time, it happens for every DDV call as well, for example, and I'd really prefer some more meaningful message boxes (crazy, I know). Is there, for example, a resource DLL that has to be shipped with my program so that MFC can load its error messages properly? Something like that...
http://www.renderpal.com
http://www.shoran.de
|
|
|
|
|
Daniel 'Tak' M. wrote: Is there, for example, a resource DLL
If you create a standard MFC app and choose the defaults, you will see that "afxres.rc" is included in the project's .rc file.
|
|
|
|
|
- Consider a class that is used as a utility by many of your classes.
- The classes that can use it (I'm calling it the host or parent class for now) must, derive from some abstract base class .
- When you instantiate the utility class, the constructor takes a reference to the host or parent class so it can call the base class methods the hosts are required to implement. This reference is stored as a member in the utility class object instance.
(NOTE: lifetime issues are taken care of properly since the utility class object is a member of the host but that is unrelated)
What do you refer to this member variable (reference) for the hosting class as?
I've been using...
m_parent
m_host
However, I'm wondering if these don't convey the relationship properly.
What terms do some of you use for such a relationship?
|
|
|
|
|
How about m_container or maybe m_utilizer ?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
thanks.
I sometimes wish there was a programmers thesaurus to help find meaningful class and variable names that match intent. MS Word thesaurus only goes so far. 
|
|
|
|
|
Or at least an online random class/variable name generator similar to these[^], it could spit out smart-sounding names like: m_denominatorEqualizerFactor or somesuch.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
Hello folks!
Am not sure where to ask this so i thought i ask here, maybe you fellas know the answer. If i write a Visual Studio Add-in in VC++, is there any way to "hook" the up-to-date check VS does when compiling files? When you hit "Build", VS checks what files have changed and what files are up-to-date and builds only the ones that are outdated. VS seems to be also using the pch file and perhaps pdb file to determine this, i guess it is needed when using precompiled headers. What i would like to do is handle the up-to-date check for certain files a bit differently than others. E.g. the project has a file called "source.cpp", when the up-to-date check is done, i'd like my method to be called with the name (or full path) of "source.cpp" and the corresponding pch, e.g. "c:\vsprojects\theproject\debug\vc70.pch", then for some files i'd just like to pass this along to the "default" handler but for certain files i'd like to "redirect" the path to the pch to somewhere else. Anyone knows how this could be done?
Thanks in advance for any pointers (preferably not NULL pointers ).
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
the "up-to-date" check is done by the compiler / linker by comparing the timestamp of the exe/dll to that of it's component .obj files, the .obj files timestamps are compared to those of the associated .c or .cpp files, the .c / .cpp files are compared to those of it's included files. If any of the timestamps are greater that triggers a build of the appropriate .c/.cpp file(s), then the .obj files are then linked to make the target .exe/.dll file. So, if you want a .cpp file to be built based on some other file's timestamp you need to find a way to tell the compiler (or Visual Studio) to do so.
There is a way to hook into the build process in the way you describe by making a Visual Studio extension. Look here[^] for info about that.
"If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams
|
|
|
|
|
I've been experimenting a bit and what i see is that VS passes only those .cpp files to the compiler which need to be updated in the first place so the up-to-date check isn't done by the compiler (could be that the compiler itself also does some check against the boject files, i don't know that, but as said, it gets the list of outdated files in the first place). Also, if the pch file is removed, VS passes all(?) the files to the compiler even tough the obj files are still there and the sources are not modified. I supose this is done because if a header changes this is the way for VS to know what cpp files include it and need to be rebuilt, but if the pch is missing then it falls back to rebuilding everything to reproduce the pch file. Ah, and another thing, i'm talking VS2003 (i know, it's old, but i have no other options).
Thanks for the link, i will check it out.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
You are right as pertains to VS passing only those files needing to be recompiled.
The reason for passing all of the files in the case of the deleted / missing .PCH file is it is the compiler that builds it.
"If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams
|
|
|
|
|
Have you checked nmake?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Now i did, but it doesn't seem to be involved, isn't nmake used only for makefile projects?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
Code-o-mat wrote: ...but it doesn't seem to be involved, isn't nmake used only for makefile projects?
Yes, but I was just giving you something else to consider. I often times do not solve problems directly, but give folks ideas and suggestions that they can then take a step further and decide if its right for them or not.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
The idea was good, thank you. Indeed sometimes all people need is a kick in the right direction and then they can tumble down the stairs themselfs. Most of the time i am just looking for that kick when asking questions, getting the complete solution on a plate is no fun.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
How can I get direct access of disk and partition of disk instead UAC enabled or disabled?
There is a utility which provides direct access called RAWDISK from eldos.
But this is paid, Is there anything free?
|
|
|
|
|
Firstly, this is not a C/C++ question, so it does not belong in this forum.
Secondly, if you are looking for free software then a Google search should be your first port of call.
I must get a clever new signature for 2011.
|
|
|
|
|
Do you realize UAC is a feature, not a bug?
(it looks like a bug, I should admit).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I want the color of every pixel of bitmap image, so that I can extract alpha value of it.
I have tried GetPixel, but it is very slow. I tried GetDIBits as well but it's not giving me the proper color as compare to GetPixel gives. Can somebody help me??
|
|
|
|
|
Amrit Agr wrote: I tried GetDIBits as well but it's not giving me the proper color as compare to GetPixel gives.
What do you intend, specifically (i.e. are you sure you got the right pixel value, could you post some code)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
The buffer returned by GetDIBits holds the pixel data in a way that isn't very intuitive:
- The pixel data is stored bottom-up, which means line 0 is the bottom of the image.
- The pixel values are stored as blue/green/red rather than red/green/blue.
- Each line is 4byte-alligned. So if your bitmap would be 24bpp (3 bytes) and the image width is 125 pixels, the expected line length would be 3*125 = 375, but it is in fact rounded up to 376, where the 376th byte contains no information.
modified 13-Sep-18 21:01pm.
|
|
|
|