|
try deleting the .ncb file, too
sometimes that helps
-c
"[it was..] one of those evenings when you feel that not only will there definitely be a revolution, but that the Association of Manufacturers will foot the bill."
-- Umberto Eco, Foucault's Pendulum
|
|
|
|
|
Thanks, this was the solution
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I want to insert my own warnings into code, to leave a fixed
record of things I have delayed doing. For example, I have
a function that converts a block of data into ASCII text, for
storage. However, the first quick and nasty implementation does
not get very good compression performance. So I want to insert
a line in the function saying something like:
#pragma message(__FILE__ " (" __LINE__ "): warning C1234: " \
"Need to improve the compression here.")
However I cann't get it to work right (__LINE__ is a number,
and #__LINE__ doesn't seem to work in this context.)
I seem to remember something here about this, but I couldn't find
it.
Any suggestions would be most helpful.
|
|
|
|
|
The # operator only works in a macro definition, not a #pragma , so do something like:
#define MAKESTR(x) #x
#pragma message "foo" MAKESTR(__LINE__) "bar"
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
None of the suggestions offered worked, so I asked the
same question on comp.lang.c++.moderated, and they
pointed out that you need to double expand the __LINE__
macro for some subtle reasons. Anyways, for future
readers interested in how to do it, here is what I
now use:
#define STRINGIZE(x) #x
#define EVAL_STRINGIZE(x) STRINGIZE(x)
#define WARN(warning) message(__FILE__ "("EVAL_STRINGIZE(__LINE__)"): warning C1000: " warning)
Put these macros in a general project header included
everywhere (I guess you could even put them in stdafx.h
if you are so inclined, personally, all my projects have
a file called Project.h that is the first included in every
header.)
Then whenever you want to issue a warning during compile
time just use this:
#pragma WARN("Using bubble sort here, a better algorithm is required")
which will appear on your compiler output (and task list if
using VC .Net), which you can F4 through. When you fix the
error, just remove the pragma.
|
|
|
|
|
ASSERT(0 && "I have to improve this code");
|
|
|
|
|
I have a dialog based app that I want to start maximized but it just doesn't want to happen. I'm using the following code:
BOOL CToolTabsDlg::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style &= WS_MAXIMIZE;
return CDialog::PreCreateWindow(cs);
} Does this not work on dialogs or am I doing something completely wrong?
Something I just tried was putting a breakpoint on the cs.style statement just to see if the value changed and my program didn't even break. Obviously I'm doing something wrong but I'm not sure what it is.
Any help would be much appreciated.
- monrobot13
|
|
|
|
|
Add this to your OnInitDialog() :
PostMessage (WM_SYSCOMMAND, SC_MAXIMIZE);
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Thanks Ravi!
Is there a reason why the PreCreateWindow function wouldn't work? I'm wondering.
- monrobot13
|
|
|
|
|
use ::IsWindow(m_hWnd) to see if the window is OK in PreCreateWindow()
includeh10
|
|
|
|
|
Don't do it in precreate window.
write the following code in OnInitDialog function
BOOL MyDialog::OnInitInstance()
{
//Some code generated by the framework
ShowWindow(SW_MAXIMIZE);
return TRUE;
}
This will work.
|
|
|
|
|
monrobot13 wrote:
cs.style &= WS_MAXIMIZE;
should be
cs.style |= WS_MAXIMIZE;
at the very least. "&= " removes the WS_MAXIMIZE bit.
Software Zen: delete this;
|
|
|
|
|
Hi.
I would like to know is it possible and how to internally (program) resize a dialog box. For example:
---------------------
| |
|edit box |
|button |
| |
---------------------
Given a dialog box with that looks like the one above, I would like to programmably resize it.
--------------------
| |
|edit box |
|button |
| |
| |
| |
| |
--------------------
In other words, I would like to expand and contracts the dialog frame.
Thanks,
Kuphryn
|
|
|
|
|
|
|
I've tried to load a bitmap sequence using VB.NET and .NET framework. Here's the spec:
(a) class Bitmap("filepath")
(b) 7kB per bitmap (or frame)
(c) 588 bitmaps in sequence - Therefore, preloading the entire sequence is impossible (will consume over 250MB RAM!!)
(d) 15 frames per second
The basic process is as follows:
(a) preload a certain number of bitmap
(b1) start a thread to start rendering pre-loaded bitmap to screen
(b2) at the same time, start another thread to continue loading the rest of the sequence into memory (bitmaps)
However, even at a low 15 frames per second, the buffer is emptied too fast and frames loading (b2) is not able to keep in pace with frames rendering (b1)... But on the other hand, pre-load the entire sequence is just impossible!!? I wonder how they do this in Windows Media Player or Adobe Premier. Premier was able to render my bitmap sequence without any jitter on the same machine!? So, can I conclude that "class Bitmap" constructor from .NET framework is not very efficient in loading bitmap? Should I try CBitmap and build a MFC app to test it out? Or should I build a DirectDraw SDI...?
What can I do? I was considering using Quicktime player (downloaded Quicktime SDK and got the sample working). But this option requires that we go thru the proper licencing process... so screw that...
Thanx!
|
|
|
|
|
forgot my email... my email is:
norman_lm_fung@hotmail.com
thanks!
norm
|
|
|
|
|
You can preload the images if you would like, even though you have 250 MB loaded into the heap, it will simply be paged, so you will not really be using 250 MB of ram. When the system needs the memory page that contains the next set of images, it will swap the page into memory.
The media players use a compressed form of the images and therefore preload all of the data (images) into memory, then render the frame when it is time to be displayed or at least pre-render it in a cache waiting to be displayed.
What I would suggest for you, if this is a possibility, is to convert your images to an AVI then use one of the media players to display the AVI.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
any idea where to get free avi player control? free for commercial distribution?
i am aware of CAnimateCtrl (VC6) and MCIWnd class (prolly also for VC6 only). Will u recommend....? And if I want to go with VB.NET, then is there any free control available?
|
|
|
|
|
You could just use the standard windows animation control. There are only about 6-10 functions that are required to use it. That is probably the control that is wrapped in the CAnimateCtrl of MFC.
Otherwise if you need advanced features you could look into the media player or even DirectShow.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Browsing through the zlib code I'm confused by the template code shown below. How or when would you make use of it? Can you give an example?
class ozstream
{
public:
ozstream() : m_fp(0), m_os(0) {
}
ostream& os() {
if (m_os == 0) m_os = new ostrstream;
return *m_os;
}
void os_flush() {
if (m_os && m_os->pcount()>0) {
ostrstream* oss = new ostrstream;
oss->fill(m_os->fill());
oss->flags(m_os->flags());
oss->precision(m_os->precision());
oss->width(m_os->width());
::gzwrite(m_fp, m_os->str(), m_os->pcount());
delete[] m_os->str(); delete m_os; m_os = oss;
}
}
};
template <class T>
inline ostream& operator<<(ozstream& zs, const T& x) {
zs.os_flush();
return zs.os() << x;
}
Todd Smith
|
|
|
|
|
It looks like it is simply overloading the << operator for arbitrary template types. Looking at the code, this means the << operator should work for any type T that the ostream operator << overloads.
So you should be able to do something like this:
<br />
ozstream :bob:;<br />
int i;<br />
char ch;<br />
double d;<br />
<br />
:bob: << i;<br />
:bob: << ch;<br />
:bob: << d;<br />
and it will Do The Right Thing. If you try to use << on a weird type that cannot be passed to an ostream, it will give you an error.
Even a broken clock is right twice a day.
|
|
|
|
|
I know that I need to use WNetAddConnection2 to map a network resource but when I use WNetCancelConnection, and then try to map again I get an error 1312. I noticed that I can use WNetUseConnection to make my mapping but how do I disconnect a mapped resource on my pc? Thanks
Tom Wright
Programmer
tawright915@yahoo.com
|
|
|
|
|
I'm trying to figure a way to print the flexgrid. Is there away?
Thanks
|
|
|
|
|
Hi,
when I make a shortcut to my application and choose a different icon, explorer shows me all icons from my resource. I want only 1 or two icons being possible for the explorer, how?
Thanks for your help!
|
|
|
|