|
I am using Gradient fill
i mproblem is how to fill single color gradient
what i am trying to say is ... whats the way to fill single color gradient
other than reg r blue r grean?
when i mix up the colors it not coming properly
but i can fill red r blue r grean single color
but i wanna fill with sky blue color but not dark blue color
please some one let me know how to do that .. i know know there is a way to do ... can some one give me info
|
|
|
|
|
sarat wrote: but i wanna fill with sky blue color but not dark blue color
Then specify two (different) light blue tones for both the starting and ending color.
What is the difficulty about?
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.
[my articles]
|
|
|
|
|
can i send u a mail
i wanna post and attach the screen shots to exactly the prob i am facing
ok
|
|
|
|
|
what to fill in the TRIVERTEX structure for sky blue color
i wanna paint a dialog with starting with sky blue color at the botton and ending with white color at the top
what r the hex values i need to assign for bule grean and red of the following structure
here is the sample code... whic gives light grean color
please some one hlep me
TRIVERTEX vertex[2] ;
vertex[0].x = 0;
vertex[0].y = 0;
vertex[0].Red = 0x0000;
vertex[0].Green = 0x8000;
vertex[0].Blue = 0x8000;
vertex[0].Alpha = 0x0000;
vertex[1].x = 300;
vertex[1].y = 80;
vertex[1].Red = 0x0000;
vertex[1].Green = 0xd000;
vertex[1].Blue = 0xd000;
vertex[1].Alpha = 0x0000;
|
|
|
|
|
Heyy guys
i got it ....
just we need to append 00 to hex value
means if the hex value is FB we need to append "00" -> FB00
but dont think abt actual FB00 value ... u will get confused ... be wat ever it is .. append "00" to Hex val
|
|
|
|
|
Hi all,
I am working on a VC++ project using VS2003 which comprises of several nested namespaces, classes, and type definitions. I have a problem which I really do not understand, as far as I am aware, this SHOULD work
This Works:
<br />
namespace Root<br />
{<br />
class MyClass<br />
{<br />
public:<br />
MyClass(int input = Nested::TemplateClass<int>::constant_value);<br />
...<br />
};<br />
};<br />
But this DOESNT
<br />
namespace Root<br />
{<br />
typedef Root::Nested::TemplateClass<int> NESTED_CLASS;<br />
<br />
class MyClass<br />
{<br />
public:<br />
MyClass(int input = NESTED_CLASS::constant_value);<br />
};<br />
};<br />
Compiler Errors (Edited, forgot to post originally)
Sorry, I meant to have pasted the compiler errors . Here they are:
error C2065: 'constant_value' : undeclared identifier
error C2653: 'TemplateClass<int>' : is not a class or namespace name
The project that I am working on is very big, and has a lot of files. I am unable to reproduce the same problem in a simple test project.
Does anybody know what might be the cause of this weird problem?
Cheers!
Lea Hayes
modified on Tuesday, January 22, 2008 8:17:40 AM
|
|
|
|
|
IMHO one of the points is: do you really need such a mess?
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.
[my articles]
|
|
|
|
|
Hi,
The design behind the software engineering works quite well (imo). Related classes are grouped within their respective namespaces, and the classes are reasonably straightforward to use.
I have found that the following works, so defines remain an option, but I would have rather used typedefs:
<br />
#define NESTED_CLASS Nested::TemplateClass<int><br />
namespace Root<br />
{<br />
class MyClass<br />
{<br />
public:<br />
MyClass(int input = NESTED_CLASS::constant_value);<br />
...<br />
};<br />
};<br />
|
|
|
|
|
lhayes00 wrote: The design behind the software engineering works quite well (imo).
I'm quite sure it works.
Maybe using the original typedef outside namespace block works as well as the #define .
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.
[my articles]
|
|
|
|
|
I think that I have found the root of the problem...
The template class has an enum inside it:
template<typename _Ty> class TemplateClass<br />
{<br />
public:<br />
enum ConstantValue<br />
{<br />
constant_value = 17<br />
};<br />
};
The type definition works when the enum is taken out of the template class. So the following works:
enum ConstantValue { constant_Value = 17 };<br />
<br />
template<typename _Ty> class TemplateClass<br />
{<br />
public:<br />
...<br />
};<br />
<br />
...<br />
<br />
typedef Root::Nested::TemplateClass<int> NESTED_CLASS;
I still do not understand why this is, but at least I have a solution now. I found a BUG report on the Microsoft website which addresses this very issue with template functions, the remedee there is to typedef the enum...typedef'ing the enum within the template class didn't improve the situation for me though.
http://support.microsoft.com/kb/125495[^]">
I thought it was worth posting the solution in case somebody else has a similar issue. It would be interesting if someone was able to give a reason as to why this problem occurs.
Thanks for your advice.
|
|
|
|
|
But why do you need anymore the typedef (now you have a not-nested enum )?
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.
[my articles]
|
|
|
|
|
I only demonstrated the part which was not compiling, the template class in question does get used extensively when assigned to particular types.
for example,
typedef TemplateClass<int> IntVersion;<br />
typedef TemplateClass<float> FloatVersion;<br />
<br />
IntVersion a;<br />
a.foo();<br />
<br />
Bar(a);
Obviously the enum can now be accessed via the appropriate namespace. Before it was accessed via the template class (which in some ways was better because it grouped it with context), but having it in the namespace isn't exactly end of the world.
The template class will still be used for its primary purposes.
|
|
|
|
|
"doesn't work"
don't provide too much information, someone might actually help you.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Sorry, I meant to have pasted the compiler errors . Here they are:
error C2065: 'constant_value' : undeclared identifier
error C2653: 'TemplateClass<int>' : is not a class or namespace name
|
|
|
|
|
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.
[my articles]
|
|
|
|
|
Hi,
I'm facing a problem reading data from Serial Port using VC++. I have to read data every 12 msec from the serial port. I'm using Overlapped method and ReadFile() function to read data. The time gap between two data stream is 12.5 msec. At one streatch I'm able to read only 8 bytes. Anyone knows what could be the problem?
Please help..
|
|
|
|
|
Forget about the "real-time" aspect of it. Windows is not a real-time operating system so you'll never be able to read data every 12 msec precisely. And you don't need to. The only thing you need to do is read data when data is available. So, what you could do is read data and if you read only 8 bytes, then continue reading until you received 12 bytes.
Once this is donc, you process your data and read the next data.
|
|
|
|
|
Cedric Moonen wrote: then continue reading until you received 12 bytes
Is it a magic number or have you the CPMRU (Code Project Mind Reader Unit) turned on?
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.
[my articles]
|
|
|
|
|
Ouch, yes I misread his message. I thought I needed to read 12 bytes. But you get the idea
|
|
|
|
|
|
It seems like a hard day for me today. I should really read 7 times my post before pressing the post message button.
|
|
|
|
|
I have no clue how many bytes I should read. Every 12 msec data is coming to serial port, but ReadFile() function reads only 8 bytes at one instance. Why is it so? Any idea what the EV_BREAK in WaitCommEvent() does? Please help, very urgent.
|
|
|
|
|
Susanmat wrote: I have no clue how many bytes I should read.
That's already a big problem. You should be able to know how many bytes you need to read. Where is this data coming from and what is contained in it ? Can't you send first a byte that contains the size of the 'packet' ?
Susanmat wrote: Every 12 msec data is coming to serial port, but ReadFile() function reads only 8 bytes at one instance. Why is it so?
Please post some relevant code because I don't have eyes sitting in front of your computer. Probably it is just because there is only 8 bytes in the buffer.
Susanmat wrote: Any idea what the EV_BREAK in WaitCommEvent() does?
I think it is when a break character is sent on the serial port (if it is enabled).
Susanmat wrote: Please help, very urgent
This is a forum were people help for free on their spare time. If you cannot wait and need *urgent* help, then go on rentacoder and pay for somebody.
|
|
|
|
|
Hello everyone,
I have tested try-catch works with structured exception, to my surprise. Previously I think we have to use __try and __except.
Any comments? Here is my test code and I am using Visual Studio 2008.
#include <iostream>
using namespace std;
int main()
{
int* address = NULL;
try{
(*address) = 1024;
} catch (...)
{
cout << "access violation caught" << endl;
}
return 0;
}
thanks in advance,
George
|
|
|
|
|
George_George wrote: Any comments?
Yes, you're a bit late indeed, such code works as well with VS6 compiler.
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.
[my articles]
|
|
|
|