|
yes, of course !
TOXCCT >>> GEII power
|
|
|
|
|
Well, you kind of can do it in C++
template<__int64 T_val>
struct bin_help
{
template<__int64 T_base, __int64 T_bits>
struct inner
{
__int64 operator()()
{
return (((T_val)/T_base)%10)*(((__int64)2)<<T_bits)+bin_help<T_val>::inner<T_base/10,T_bits-1>()();
}
};
template<>
struct inner<10,0>
{
__int64 operator()()
{
return T_val%10;
}
};
};
template<__int64 T_val>
__int64 bin()
{
return bin_help<T_val>::inner<(__int64)100000000000,10>()();
}
For 10 digits of precision, the C++ compiler (tested with VS.Net 7.1) performs the calculation directly during compilation stage (at least in release builds), so
bin<10101>();
evaluates natively to
mov eax, 21
With 15 digits precision it stopped working, i don't know the real limit but i suppose 10 digits is good enough for the amount of inline function unrolling needed. BTW: Using partial function template specialization this could be solved much more easily (in fact this is planned for the next revision of the standard).
Error handling is obviously missing, so 5192 would also be accepted :-|
|
|
|
|
|
I don't think you can in C or C++, but if you want your part of the code obfuscating fun, you could always do this (in VC++ mind):
<br />
<br />
char the_char;<br />
<br />
__asm<br />
{<br />
mov the_char, 00100000b<br />
}<br />
<br />
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
ARSALAN MALIK
|
|
|
|
|
You can use base-8, base-10, and base-16 numbers only. If you want a number represented as base-2, it must be converted to a string.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
How can we delete a function from a class. Back with the VC++ 6, you can choose your function, right click and delete. But what about .net
<italic>Work hard and a bit of luck is the key to success.
You don`t need to be genius, to be rich.
|
|
|
|
|
. I was more concerned when tried to add OnInitDialog() to my dlg class !!!
There is no spoon.
mail
|
|
|
|
|
I guess we have to do it manually.
<italic>Work hard and a bit of luck is the key to success.
You don`t need to be genius, to be rich.
|
|
|
|
|
can someone tell me simply what a version control means for a vc++ project.
any help appreciated.
|
|
|
|
|
It means you are controlling the versions of that project. Some popular packages are SourceSafe and PVCS.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
i have a project that will use a small touchscreen...and the program uses combo box...the problem is the combo box dropdown button is very small...and it is quite hard to touch it on the screen...is there any way i can enlarge the drop down button on the combo box ??....
|
|
|
|
|
Click your mouse on the combo`s arrow
<italic>Work hard and a bit of luck is the key to success.
You don`t need to be genius, to be rich.
|
|
|
|
|
did you only read the question ???
he want the combo`s arrow to be bigger 'cause it appears to small to click easily on it...
SO, how to enlarge this button ?!
TOXCCT >>> GEII power
|
|
|
|
|
opps, you can enlarge the screen resolution, or use a magnifier
<italic>Work hard and a bit of luck is the key to success.
You don`t need to be genius, to be rich.
|
|
|
|
|
much better
TOXCCT >>> GEII power
|
|
|
|
|
Using a mouse severely defeats the whole purpose for using a touch-screen monitor.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Is it possible to create a window that will stay on top of everything? I have a project that needs a translucent window covering an area of the screen. I've created that window, and made it so that all mouse and keyboard commands go to the correct locations, but if the user causes a menu to drop down, it appears above mine, ruining the effect.
|
|
|
|
|
|
I'm afraid that this does not work. While the PasswordSpy program stays on top of the other programs, the menus of the other apps drop down in front of it. This is what I'm trying to avoid.
|
|
|
|
|
Hi
I am new to GDI+. I have been working for last two years on traditional GDI.
Well I am having a project in which i will require to perform following tasks and for the purpose of the same i want to use GDI+
1.0 Saving View content to the Image files, say JPG, BMP,etc
2.0 Antialiasing line and circle drawing to get smooth plot.
I am knowing that i have to redistribute teh gdiplus.dll in my application folder and set /BASE while building
I just want to know that:
1.0 What are other dependebncy for GDI porting?
2.0 Can we use GDI and GDI+ in one code?
3.0 How to save the content of view to Image file?
4.0 How to draw antialiased lines, etc?
Thanking You in advance
Sandeep Arya
Leave your mark wherever you go
|
|
|
|
|
Hi all,
I am getting an assertion failure error while executing my program. In my program I am declaring multiple instances of a class dynamically like...
Cube *C = new Cube[n];
Sphere *S = new Sphere[n1];
and till these statements the execytion is fine but after these I am callling a method of those instances individually in a loop...
if (n>=1)
for (i=1;i<=n;i++)
C[i].set_values(dis,dim,res1);
if (n1>=1)
for (i=1;i<=n1;i++)
S[i].set_values(dis,dim,res1);
when returning from this method it is giving me above error.
but if i used only one instance like
Cube C = new Cube();
C.set_values(dis,dim,res1);
then it is working fine....
I am not getting where I am goin wrong and here is the error.
Debug Assertion Failed!
Program: C:\....\xyz.exe
File:dbgdel.cpp
Line:47
Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
Press retry to debug the application..
anyone help me out from this.....
thanks in advance,
Suman
|
|
|
|
|
Suman Niranjan wrote:
if (n>=1)
for (i=1;i<=n;i++)
C[i].set_values(dis,dim,res1);
if (n1>=1)
for (i=1;i<=n1;i++)
S[i].set_values(dis,dim,res1);
Your program ran out of boundary! Remember this well:
An array starts from index 0. Thus you shall write this way:
if(n1 >= 1)
for(i = 0; i < n1; i++)
S[i].set_values(dis, dim, res1);
Maxwell Chen
|
|
|
|
|
Hi,
thanks.... damn it was shame on me, i was mistaken at such a low level funda principle... anyway i am just thinking of the instance numbers rather than the actual array implementation at the time of codin....
cheers,
Suman
|
|
|
|
|
'MeasureItem' and 'DrawItem' can do so. But is there a way changing item height via custom draw, or WM_NOTIFY messages?
Any help appreciation !
|
|
|
|
|
yshangcao wrote:
is there a way changing item height via custom draw, or WM_NOTIFY messages?
No. You can only do this with Owner Draw list controls (MeasureItem() )
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"
|
|
|
|