|
I think I would use an imagelist.
Load all bmp's in there and switch accordingly.
hope this helps.
(eg. for setting an icon to a button I did this:
icon = (HICON)::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_PRINT), IMAGE_ICON, 16, 15, LR_DEFAULTCOLOR);<br />
pPrintbutton->SetIcon(icon);<br />
I presume it's round about the same for a bmp)
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
--------------------Configuration: xt3 - Win32 Debug--------------------
Linking...
nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in libcpmtd.lib(delop.obj)
xt3.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
xt3.exe - 2 error(s), 0 warning(s)
What causes this? And what should I do to fix it easily.
Thanks very much.
|
|
|
|
|
|
Linker Tools Error LNK2005
symbol already defined in object
The given symbol, displayed in its decorated form, was multiply defined.
Tips
One of the following may be a cause:
The most common cause of this error is accidentally linking with both the single-threaded and multithreaded libraries. Ensure that the application project file includes only the appropriate libraries and that any third-party libraries have appropriately created single-threaded or multithreaded versions.
The given symbol was a packaged function (created by compiling with /Gy) and was included in more than one file but was changed between compilations. Recompile all files that include the symbol.
The given symbol was defined differently in two member objects in different libraries, and both member objects were used.
An absolute was defined twice, with a different value in each definition.
This error is followed by fatal error LNK1169.
|
|
|
|
|
hi,
I'm a developper and i'm lookin for books oriented to non beginner on different subjects :
- comrehensive information on run-time librairies and their ideology (ie memory working, the dipatching of messages between objects and their ordonation, error enhancing with (very) old dlls)
- fuzzy logic
- neural networks
- algorythms of mostly used video and audio formats (compilable and shareware if exists)
- a comprehensive one on multithreading and if possible parrallelism
thanks if you can help me, being jobless i prefer stuff on line or in numereical form
styx
|
|
|
|
|
Hi,
I am new to VC++ and would like to know that if I have a C++ console
application and want to add it to a VC++ MFCAppwizard project, how do
I do it? The problem I am facing is thatwhen I add those .cpp files to
the project, I am unable to compile the code as the compiler
apparently is unable to resolve classes defined in the console
application. To give you the exact nature of the problem, I have a C++ console application which I want to import to VC++ and add forms and UI.
Is this problem something to do with "using namespace .."? I
would like to get some pointers on how to solve this problem.
Thanks.
Sid
|
|
|
|
|
It's highly unlikely that your default code is using namespaces, if you've put stuff in a namespace ( and good for you if you have ), then you just need a using statement to scope it. You should just be able to add your classes, unless your classes rely on libraries that your MFC project does not use, then you need to add them to the project settings. Again, unless you added them to the C++ console project, I don't see this being the case. What errors do you get ? It's kind of hard to help you fix a problem if I don't know what the actual problem is
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Hi,
May be very simple question, but I can't find the answer. Please help me.
class A{
public:
const int My_some_const;
int k;
A(int k_):k(k){};
}
class B:public A{
B(int k):A(k) //<---How to initialize Mysome_const without passing the value througth constructor of A????
}
Thanks in advance,
Boni
|
|
|
|
|
Boniolopez wrote:
How to initialize Mysome_const without passing the value througth constructor of A????
Why? What's wrong with using the constructor?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
The constructor of B must have the described signature (specific for the application)
|
|
|
|
|
Boniolopez wrote:
The constructor of B must have the described signature
Sorry, I still don't understand what the problem is. Are you saying you're not allowed to explicity call A's constructor?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
class A {
public:
const int My_some_const;
int k;
A(int k_) : k (k) {};
}
class B : public A {
B(int k) : k(k), My_some_const(1) { };
}
Is that what your looking for? That initialises both member variables without going through the base constructor
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
Hi Alan,
I want to do exactly das wat you wrote. Unfortunetly your solution (was my solution too is not compilable. It produces error C2758. The same stuff with tamplate produces error C2614.
Any help is very appreciated!!!
|
|
|
|
|
When looking form base class, it dosen't know someone is going to derive from it and its const will be initilized there.
There is no spoon.
mail
|
|
|
|
|
You can't use the assigment operator to intialize My_some_const because My_some_const is a const member of the class and cannot appear on the left side of an assignment statement. The only way to initialize My_some_const is via constructor member initialization list.
That initializes My_some_const to 10:
class A{
public:
const int My_some_const;
int k;
A(int k_):k(k),My_some_const(10){};
}
class B:public A{
B(int k):A(k)
}
|
|
|
|
|
|
Hi there,
I have an mdi app, child window containing a cscrollview. Obviously the user can create new child windows using the window>New Window menu item. When they have created more than one view, I would like the multiple child windows to scroll synchronously. I mean that when an active child window's view is scrolled, all the other child window's views scroll along at the same time.
I can't think of a way to do this! I tried maintaining a CPoint in the document class, updated by the view whenever it is scrolled, and adding a ScrollToPosition command in the update function of the view. But it was very messy and didn't quite work correctly.
Does anybody know if there's a neat clean way I can do this, perhaps sending windows messages directly between child windows or something?
Thanks for any help,
Mick
|
|
|
|
|
mickelliot wrote:
When they have created more than one view, I would like the multiple child windows to scroll synchronously.
Any reason why? The whole point of the New Window menu item is so that users can see different parts of the same document at once. Having them all automatically scroll to the same point sort of defeats the purpose.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi Ryan,
Thanks for replying.
The idea is that each view will contain the same view of the same data, but with different parameters so that the view "looks" different. I can best explain myself by asking you to imagine an MDI bitmap editor. You load in a bitmap, which appears in a new child frame, and set its magnification to 100%. You then open a new window and set the magnification of the new view to 200%. Now, when you scroll around the 100% view, you want the 200% view to move along with it appropriately (i.e. in the same direction and twice as fast), so that each view contains the same area of the bitmap but just at different magnifications.
The idea would be to make this an option for the user - i.e. they can either open two child windows and use them to view different parts of the document, or they can adjust the parameters of each view and synchronize the two windows.
Mick
|
|
|
|
|
One way would be to handle WM_HSCROLL and WM_VSCROLL in each view. Whenever the view is scrolled, get the current scroll position. Each document (GetDocument() ) has a list of all the views attached to it (GetFirstViewPosition() , GetNextView() ). Just loop through for each view and call SetScrollPosition() .
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I'm writing a dialog based application.
I'd like to know how to show an animation on the dialog!!
Please Help Me!!!
Thanks in advance!!!!
|
|
|
|
|
An mpeg using DirectX or MediaPlayer is the obvious choice, I guess.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
if you looking for Image Animation,then go for any good image library
that will solve your problem.
One Good Image Library IS 'CXImage',search for it IN CP
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
hi
if you wanna play some AVI file on your dialog then you can do it via CAnimateCtrl class provided with MFC
cheers
Azam
|
|
|
|
|
Thanks to all of you on yours suggestions!!!!!!
|
|
|
|