|
And why it doesnt work?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I don't know.Maybe it use other windowsXP's dll? I copy user32.dll from winxp to win2000 and it don't work too.
|
|
|
|
|
PrintWindow is not supported in Win2K.
It is not enough to simply copy some DLLs from XP to make this work in Win2K.
I'm sure the call goes down to the kernel and calls some routines there.
So you will have to implement this the hard way without the PrintWindow function.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I have a problem with EAXDirectSoundCreate method call. If I created a DLL which uses MFC, and in the DLL's InitInstance() to revoke EAXDirectSoundCreate. When application runs, and loads the DLL, then EAXDirectSoundCreate executed, application will hang up inside of that method. Need your help here how to fix the problem. Thanks.
|
|
|
|
|
How do we build a network using visual c++..The network is assumed as graph.
|
|
|
|
|
We usually build networks using cables, hubs, switches,...
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]
|
|
|
|
|
We also use of a Repeaters and A network card.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I should admit you're more advanced.
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]
|
|
|
|
|
No, you must have asked her to search for VC++ in Orkut, FaceBook ,etc. That's what the OP is looking for.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
I should admit, you're more advanced too: How do you know the OP is a lady?
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]
|
|
|
|
|
You are right, no clue but I don't know why called the OP as she. lol Anyway let her clarify that one
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
She !!! it looks you forgot me,yes?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
No. Yes. No. Yes . lol Now I wont forget you anymore
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
of course you are first.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Have a look at the boost graph library. For quidance try ISBN 0-201-72914-8: The boost graph library user guide and reference manual; I recommend it.
|
|
|
|
|
Hi,
Has anyone come across a simple way of making an MFC toolbar button flash? I tried using pCmdUI->Enable() with an alternating enable/disable flag which looked great but of course the button is disabled half the time
TIA
Tony
|
|
|
|
|
How about alternating checked/unchecked?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi,
Thanks for the suggestion. I tried it and it looked OK but still not quite what I wanted. For info, I did manage to get the look I was after but I dont know if its the "correct" way to do it. I created two versions of the toolbar bitmap each showing the two states I needed. I loaded them into two image lists in CMainFrame::OnCreate(). I then swapped the image list into the toolbar on a timer, like this...
CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
...
m_il1.Create(IDR_MAINFRAME1, 32, 0,RGB(128,128,128));
m_il2.Create(IDR_MAINFRAME2, 32, 0,RGB(128,128,128));
...
}
CMainFrame::FlashToolbarButton()
{
static bool bSwap = true;
if(bSwap)
{
m_wndToolBar.GetToolBarCtrl().SetImageList(&m_il1);
bSwap = FALSE;
}
else
{
m_wndToolBar.GetToolBarCtrl().SetImageList(&m_il2);
bSwap = TRUE;
}
m_wndToolBar.Invalidate();
}
Probably very ugly - maybe someone else has a more elegant solution.
|
|
|
|
|
How about an owner drawn toolbar[^]?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
The code below produces the following compiling error:
STS_OP_temp_test.cpp: In constructor 'STS_OP_temp_test<U>::STS_OP_temp_test()':
STS_OP_temp_test.cpp:66: error: expected primary-expression before 'int'
STS_OP_temp_test.cpp:66: error: expected `;' before 'int'
I take the error to mean that the compiler can't resolve "cwtm.templateMethod". Either it doesn't think "cwtm" is defined, or it doesn't think cwtm has a method called "templateMethod".
If you don't quite understand the class template stuff happening here, go to this site:
http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=/com.ibm.xlcpp8a.doc/language/ref/template_template_arguments.htm
But that site doesn't solve my problem.
Thanks for your help.
#ifndef STS_OP_temp_test_HPP
#define STS_OP_temp_test_HPP
#include <typeinfo>
#include <iostream>
#include <string>
//------------------------------------------------------------------------------
template <typename T = int>
class Class_with_template_method
{
public:
//--------------------------------------------------------------------------
Class_with_template_method()
{}
//--------------------------------------------------------------------------
template <typename P>
void templateMethod()
{
std::cout << "Method template is of type: " << typeid(P).name() << std::endl;
}
};
//------------------------------------------------------------------------------
template <template<class T> class U>
class STS_OP_temp_test
{
public:
//--------------------------------------------------------------------------
STS_OP_temp_test()
{
cwtm.templateMethod<int>(); // Line 66 compiling error!!!
real_cwtm.templateMethod<int>();
}
U<int> cwtm;
Class_with_template_method<> real_cwtm;
};
int main()
{
STS_OP_temp_test<Class_with_template_method> C();//*/
return (1);
}
#endif
<div class="ForumMod">modified on Saturday, February 28, 2009 1:21 PM</div>
|
|
|
|
|
I've done some more testing and uncovered something interesting. The template method being called will work if the template parameter is not explicitly specified.
See the addtional method added to Class_with_template_method, "templatePassedIn". And the modified STS_OP_temp_test constructor.
#ifndef STS_OP_temp_test_HPP
#define STS_OP_temp_test_HPP
#include <typeinfo>
#include <iostream>
#include <string>
//------------------------------------------------------------------------------
template <typename T = int>
class Class_with_template_method
{
public:
//--------------------------------------------------------------------------
Class_with_template_method()
{}
//--------------------------------------------------------------------------
template <typename P>
void templateMethod()
{
std::cout << "Method template is of type: " << typeid(P).name() << std::endl;
}
//--------------------------------------------------------------------------
template <typename D>
void templatePassedIn(D p_passed)
{
std::cout << "Method template is of type: " << typeid(D).name() << std::endl
<< "And has value: " << p_passed << std::endl;
}
};
//------------------------------------------------------------------------------
template <template<typename> class U = Class_with_template_method >
class STS_OP_temp_test
{
public:
//--------------------------------------------------------------------------
STS_OP_temp_test()
{
cwtm.templatePassedIn(6); // works
cwtm.templatePassedIn<int>(6); // ERROR !!!
cwtm.templateMethod<int>(); // ERROR !!!
//------------------------------------------------------------------------------
real_cwtm.templateMethod<int>(); // works
real_cwtm.templatePassedIn(6); // works
real_cwtm.templatePassedIn<int>(6); // works
}
U<int> cwtm; // Care about template type
Class_with_template_method<> real_cwtm;
};
int main()
{
STS_OP_temp_test<> B();
return (1);
}
#endif
<div class="ForumMod">modified on Saturday, February 28, 2009 1:58 PM</div>
|
|
|
|
|
It's because there's no way for the compiler to tell when it's doing syntax checking that U<int>.templateMethod is a template function. So, you have to tell it, like so:
cwtm.template templateMethod<int>();
This compiles OK with gcc 4.0.1.
Interestingly, VC++9.0 doesn't care either way - it's happy to compile your original code or the variant with template added in.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Awesome! That worked. Thanks you very much.
So, if I owned a copy of the C++ Standard, would I have found the answer there?
How did you know this?
|
|
|
|
|
jim258kelly wrote: So, if I owned a copy of the C++ Standard, would I have found the answer there?
Possibly - the standard can take some decoding at times (yes, I have a copy). I don't know, I didn't look at the standard.
jim258kelly wrote: How did you know this?
Deduction really - you have to think 'what can the compiler infer, given what it knows'. You've told it that U is a template class, taking a single parameter. So when you assert that it has a member 'templateMethod', that's fine - it's willing to accept that. But when you add the '<', what does it mean? There are two options - it could be a less than operator or it could be a template parameter clause introduction - there's ambiguity. So, to disambiguate, either the compiler gets cleverer (looks like VC++2008 has done that) or you have to explicitly tell the compiler that 'templateMethod' is a template.
With templates, the two things that most often come up are 'can the compiler tell that this symbol is a template' (the case you had) or 'can the compiler tell this is a type', at which point you need to add a 'typename' qualifier, similar to the 'template' one. Consider the (contrived) code below. Without the 'typename', it won't compile (not with g++, anyway) because the compiler can't know that A::size_type is actually a type.
#include <vector>
#include <iostream>
template <class A>
struct GetSize
{
typename A::size_type operator()(A const& a) { return a.size(); }
};
int main()
{
std::vector<int> a(10);
std::cout << GetSize<std::vector<int> >()(a) << std::endl;
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I am trying to update my resource dll's string table at run time.
That means i want to expose my string table to the end user.
He should be able to update that file before the start up of the application.
And the updated strings should be displayed by the GUI.
One approach that i found is to read from the disk file each time i display string in the GUI.
However that makes my application slow.
I want that at the start up of the application, first it should update its resource dll based on the string table contained on a txt/csv file. And afterwards it should use strings stored in that dll for all its operations.
Please suggest me what can be the other optons to try with.
|
|
|
|