|
Thanks Skywalker,
but I am not sure how to do what you adviced. I looked up DIB and StretchDIBits(), but I cannot find an example of how to "string" images together.
If I understand correctly, your idea is to create a single image from all the images that I want to use and then just scroll that image in a ticker-like manner?
If you have some sample code, that would be greatly appreciated.
Thanks a lot,
-----------------
Genaro
|
|
|
|
|
Get the code from my article here at CP:
http://www.codeproject.com/opengl/anyTex.asp[^]
The code there is used for something else, but you can use the
code there with minor modification for what you need.
Just keep in contact if after that you still need some coding example.
SkyWalker
|
|
|
|
|
I'm not sure how I would go about using your class to do what I want. A good example of what I would like to do is http://www.codebrain.com/java/codebrainslider/index.html[^]
The only thing is that I would like to implement it in c++. Let me know if this is possible. Thank you,
-----------------
Genaro
|
|
|
|
|
Ok, tomorrow morning (Europe's time), I'll send you a small demo application
with an image ticker placed at the top of the screen (of course, you can place it wherever you want).
SkyWalker
|
|
|
|
|
I just add a member variable by right-clicking a class, I haven't assigned a value to it yet nor use it and when I ran the program, a windows message box prompt saying that my program caused an error and need to be closed. Than another message box appeared after that:
Debug Assertion Failed
path of my program
FILE: dbgheap.c (i don't have this file on my prog)
LINE: 1017
EXPRESSION:_BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
What's this?
|
|
|
|
|
you would do well to add member variables, etc, by hand. The IDE stuff works most of the time, but it's not really programming, and sometimes it just falls apart. I learned that the hard way when the IDE made a mess of a COM project, and I had to quickly learn how to add methods to COM by hand.
benjnp wrote:
FILE: dbgheap.c (i don't have this file on my prog)
No, this is part of the runtime. You'd be amazed how many files 'not in your project' get included when you hit 'compile'
Looks like you are accessing memory that is not valid to me.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Oh, so there's nothing I can do about it by now. I must learn how to add a member variable the hard way.
|
|
|
|
|
Well, it's hardly difficult. You check for an area that has the access you want, or add one at the bottom ( you should default to private member variables ), and you add it. It just looks like this ( in the .h file, inside the class definition )
int m_myInteger;
string m_theString;
etc.
Not a big deal, IMO. To add a method, you just add the signature in the .h file
void MyMethod(int s);
then in the .cpp file you do this
void MyClass::MyMethod(int s)
{
// do something.
}
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yup, sometimes, I override the MFC automation process by adding variables myself. But I think the error that I just encountered is a bit unusual. Just forget it, I'll just have to try get around it. Thanks
|
|
|
|
|
Try rebuilding all so that all files get re-compiled. If you are creating an object of that class in one file and deleting it in another file, you'll get that error (or similar) if one of the files didn't get compiled after adding the variable.
In normal situations you shouldn't need this because it's automatically handled through file dependencies, but I've ocasionally seen the IDE fail in that respect. A 'Rebuild All' usually fixes the problem in those cases.
Also, make sure you only have one header file for that class, or if for some reason you have duplicated it, make sure both copies are kept in sync.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
How do I use a Collection::Contains with a struct (The collection is full of structs)
When I try to pass the struct I get the error:
error C3627: Only a value type can be boxed
error C2664: 'System::Collections::Queue::Contains' : cannot convert parameter 1 from 'Point' to 'System::Object __gc *'
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
|
Point is:
struct Point
{
int x, y;
}
How can structs inherit, does that make it pretty much a class.
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
A struct IS a class. The only difference is that structs are default access public.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
A .NET struct is not a .NET class. I didn't read that bit, although I did check that I was not in the managed C++ forum, because I did think of that.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
When I use the APPWIZARD (EXE) to create a basic MFC application and if I select the "REGULAR MFC" option in the end, the program runs fine....But if I select the "MFC IN STATIC LIBRARY"..it shows LNK4003 error...
I am using the Enterprise Version of VC++ 6
Please help,,,,
Allwyn Ds
|
|
|
|
|
Allwyn D`souza wrote:
...it shows LNK4003 error...
Which library is the linker complaining about?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
it says:
C:\Program Files\Microsoft Visual Studio\VC98\LIB\libcmtd.lib : warning LNK4003: invalid library format; library ignored
C:\Program Files\Microsoft Visual Studio\VC98\LIB\libcmtd.lib : warning LNK4003: invalid library format; library ignored
nafxcwd.lib(winfrm2.obj) : error LNK2001: unresolved external symbol ___CxxFrameHandler
....
and the list goes on...
Kindly help !!!
|
|
|
|
|
It sounds like your linker options are askew. I don't know if you need to add Nafxcwd.lib and Libcmtd.lib to the list of libraries to ignore, or change the order in which the linker processes them.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I will try what you suggested and get back to you...
Actually, I just selected the "WIN32 Release" in the 'etting for' option.... and the code compiled and ran completely....
|
|
|
|
|
I just selected the "WIN32 Release" in the 'Setting for' option.in Project/Settings... and the code compiled and ran completely....
|
|
|
|
|
I am sorry I told you before that the code linked properly...actually the option just got resetted to "REGULAR share DLL" and the code ran fine....
Now I am back at the same point...
When I ignore the default libraries the options look like this:
/nologo /subsystem:windows /incremental:yes /pdb:"Debug/netmet1.pdb" /debug /machine:I386
/nodefaultlib /out:"Debug/netmet1.exe" /pdbtype:sept
and when I disable the ignore default libs..the options look like this....
/nologo /subsystem:windows /incremental:yes /pdb:"Debug/netmet1.pdb" /debug /machine:I386
/out:"Debug/netmet1.exe" /pdbtype:sept
What changes do i need to make to the above options...???
|
|
|
|
|
I'm working on a project that involves quite a bit of graphical drawing using GDI, and thus I need to eliminate flicker using memory DCs. I've used them extensively in my program, but I think I have overused them, causing the drawing to be unnecessarily slow. (A listview, a listbox, a few buttons, and the background of the main window AFAIK)
Perhaps allocating the memory bitmap in WM_CREATE instead of WM_PAINT will speed up the painting some, keeping in mind I need to reallocate when the size changes too.
A couple of questions, because I've had some inconsistent results. (I use the memdc from atlgdix.h for you WTL devs)
1) In the WM_ERASEBKGND handler, I've found that if I do not use Invalidate(FALSE); (indicating to invalidate without erasing the background), sometimes the window does not get redrawn correctly. Is it proper practice to use a WM_ERASEBKGND handler that looks like this?
OnEraseBkgnd()
{<br />
Invalidate(false);<br />
return true;
}
2) When using a custom/ownerdraw for a listbox/listview/treeview, would it be best to use one memory DC for each item as it is being updated, or would it be faster to use a memdc for the entire window and redraw that?
What I use now works, but seems unnecessarily slow, given that progs such as iTunes and WMP are extensively skinned and require lots of drawing, and I notice no flicker there. Is there a trick that I'm not seeing?
Thanks,
Shutter
-- modified at 12:22 Monday 19th September, 2005
|
|
|
|
|
Shutter wrote:
OnEraseBkgnd() // (prototype)
{
Invalidate(false);
return true; // erased bkgnd
}
Invalidate forces a paint message. The point of WM_ERASEBKGND is to NOT generate a paint message when you want to just draw the background. You'd do better to either do nothing, call the base method, or erase the background on the window yourself.
Christian Graus - Microsoft MVP - C++
|
|
|
|