|
Mark,
Thanks for the detailed response. It solved my problem.
Bob
|
|
|
|
|
Hi! I have a CBrush created with the CBrush(COLORREF crColor) constructor. I'd like to know if I can retrieve this colorref later from the CBrush, or do I have to store it in a variable? Thx
|
|
|
|
|
This method [^] looks promising (see the lbColor member of the LOGBRUSH [^] struct).
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're welcome.
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]
|
|
|
|
|
Hi,
Is it possible to enable/allow ActiveX controls inside my webbrowser control (CHtmlView).
Please do not say it is not possible!
Niki
PS: Background: I'm writing a database application where data is stored in html format. There are also popups (similar to the old WinHelp32) which are implemented using JavaScript (or similar things; these scripts are not written by me). When I open such a HTML file directly in IE I get the security warning (even when all files are local). In my webbrowser control I even do not get a warning but only script errors.
|
|
|
|
|
I have found CoInternetSetFeatureEnabled.
But nothing changes
I have already set FEATURE_WEBOC_POPUPMANAGEMENT, FEATURE_SECURITYBAND, FEATURE_LOCALMACHINE_LOCKDOWN, FEATURE_RESTRICT_ACTIVEXINSTALL. But nothing changes
I again get a script error with "Permission denied"
|
|
|
|
|
The problem was not the browser control itself but my async pluggable protocol!
I missed to handle PARSE_SECURE_URL for the secure manager so two different URLs in my protocol were essentially in a different domain.
So I got "permission denied"-messages when accessing different frames (cross frame scripting prevention)
Regards,
Niki
|
|
|
|
|
Hello, I have a problem with static variables and inheritance
<br />
<br />
class BVolume {<br />
protected:<br />
enum { NONE = 0, SPHERE, BOX, PLANE };<br />
public:<br />
static const unsigned short type = NONE;<br />
<br />
virtual bool TestCollision(BVolume * volume)=0;<br />
<br />
};<br />
<br />
<br />
<br />
class BBox : public BVolume {<br />
public:<br />
static const unsigned short type = BOX;<br />
<br />
bool TestCollision(BVolume * volume) { return Collision< volume -> type >(volume); }<br />
<br />
template< unsigned short type > bool Collision(BVolume * volume) { return false; }<br />
<br />
template< > bool Collision< BOX >(BVolume * box) { return BoxCollision(static_cast< BBox * >(box)); }<br />
template< > bool Collision< SPHERE >(BVolume * sphere) { return SphereCollision(static_cast< BSphere * >(sphere)); }<br />
<br />
bool BoxCollision(BBox * box) { return true; }
bool SphereCollision(BSphere * box) { return true; }
<br />
<br />
};<br />
<br />
<br />
<br />
BBox b1, b2;<br />
<br />
bool Collided() {<br />
<br />
return b1.TestCollision(&b2);<br />
<br />
}<br />
<br />
if(Collided()) std::cout << "Collided";<br />
else std::cout << "Not Collided";<br />
<br />
the code above outputs "Not Collided"
I found the problem but i don't know how to solve it.
Problem:
volume->type in BBox::TestCollision is NONE (it needs to be BOX or SPHERE here) because static is a Compile Time "Thing". I need something Run Time "Thing".
What can i do? Please Help me with that problem!
Thanks,
Kasya
|
|
|
|
|
Why don't you use a virtual method, for instance getType(), instead of a const?
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]
|
|
|
|
|
please tell me how? Like that:
virtual const unsigned short getType() { return BOX; }
It doesn't work i tested it.
If you mean another thing please tell me.
Thanks,
Kasya
|
|
|
|
|
This works for me:
class BVolume {
public:
enum { NONE = 0, SPHERE, BOX, PLANE };
static const unsigned short type = NONE;
virtual bool TestCollision(BVolume * volume)=0;
virtual const unsigned int getType(){ return NONE;}
};
class BBox : public BVolume {
public:
static const unsigned short type = BOX;
bool TestCollision(BVolume * volume) { return Collision< volume -> type >(volume); }
template< unsigned short type > bool Collision(BVolume * volume) { return false; }
bool BoxCollision(BBox * box) { return true; }
virtual const unsigned int getType(){ return BOX;}
};
void main()
{
BBox b1, b2;
BVolume *pv1 = &b1;
if ( pv1->getType() == BVolume::BOX) cout << "is a box" << endl;
}
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 get error when using this:
bool TestCollision(BoundingVolume * volume) { return Collision< volume->getType() >(volume); }
Error:
error C2975: 'type' : invalid template argument for 'BoundingBox::Collision', expected compile-time constant expression
modified on Sunday, January 4, 2009 12:06 PM
|
|
|
|
|
Why don't you exploit polymorphism instead of using template methods?
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]
|
|
|
|
|
Exploit is such a harsh word....I prefer "enslave".
Sorry for the OT interruption
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Sorry for the OT interruption
Oh, I know you wanted sooooooooooooo bad to be the first CP 's member to join the Happy Brigade [^] in 2009.
Welcome Mark!
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]
|
|
|
|
|
Wow! I had never heard of that list.
A dubious honor indeed! I am so honored!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You mean overload the functions. Then why i need BVolume Class here in my code. If i can do it with template please tell me how.
Thanks,
Kasya
|
|
|
|
|
You need it because polymorphism works this way. I actually don't see how templates can do the job, in your scenario.
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]
|
|
|
|
|
.
modified 15-Mar-19 22:04pm.
|
|
|
|
|
Devise a system of commands that the microcontroller sends to the C++ program, and then have the program carry out the commands.
What specifically is your question? What is it that you want to find out?
|
|
|
|
|
Message Closed
modified 15-Mar-19 22:04pm.
|
|
|
|
|
Wow. You're basically asking how to program for the Windows platform.
There's no simple answer, it's a long process of research and learning.
As for which headers and libraries to use, the answer is "all of them."
Why not start researching some of these things with MSDN and Google, and then come back when you have specific questions about a particular thing.
Have you ever written a Windows program before? Do you know how to use Visual Studio?
|
|
|
|
|
Message Closed
modified 15-Mar-19 22:02pm.
|
|
|
|
|