|
Hi Ryan,
Thanks for the help. The code is great and the application is for an embedded -> PC interface.
cheers
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|
|
Hi Ryan,
Is there is quick way for now making x a power of 2 after you have decided that it is not?
regards,
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|
|
RichardS wrote: Is there is quick way for now making x a power of 2 after you have decided that it is not?
Not that I know of. I've never had to do this. Would you round up or down?
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"
|
|
|
|
|
Round up.
So far I have a loop (for 32-bits) shifting 0x80000000 down until the & with x is successful, then shifting it back up by one.
regards,
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|
|
#define CK_ISPOW2(n) ( ((n)&((n)-1)) == 0 )
ullong FkGrainDn2( ullong S, ullong G )
{
S = S & ~(G-1);
return(S);
}
ullong FkGrainUp2( ullong S, ullong G )
{
G -= 1;
S = (S+G) & ~G;
return(S);
}
where:
S is value to round
G is a power of 2
...cmk
Save the whales - collect the whole set
|
|
|
|
|
#define ISPOWER2(x) (!((x)&((x)-1)))
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi all
could you please anyone tell me what is the equivalent of
CSimpleStringT::GetBuffer in C#
Thanks and Regards
Madhu
|
|
|
|
|
When using the "StretchBlt" copy the bitmap to the target DlgItem.
It success to draw it on the screen, but when i using "ShowWindow" and "SetWindowPos".
The image on the dlgitem will lost
have any method to keep the image in the screen when it hiden or resize ?
|
|
|
|
|
Do the StretchBlt (and any other drawing) in a WM_PAINT handler.
Steve
|
|
|
|
|
i want to handle the event WM_DROPFILES and i am using MFC dialog base application but the classwizar of this dialog does not show this event so how to handle this event if anyone know please answer me ASAP.
Bankey Khandelwal
Software Engineer
|
|
|
|
|
I gave you a link in the previous post. It has got all sorts of samples to demonstrate this to you. Please go through them.
Go through the article before you run them.
Nibu thomas
Software Developer
|
|
|
|
|
i am trying to made a class which have to drive from 'COleDropTarget'
but on my site installed visual studio does not show this class as base so please tell what is the reason.
Bankey Khandelwal
Software Engineer
|
|
|
|
|
Hello,
while typing a text box and when reaches the required text length, how to automatically stop the user to stop typing without making the text box look like readonly. Readonly is my temporary solution for stopping the user to enter text.... but its kinda lousy...
Please help
|
|
|
|
|
You can set the maximum text limit by sending the edit control an EM_LIMITTEXT message.
The Rob Blog Google Talk: robert.caldecott
|
|
|
|
|
...and to complete robert answer,
you can do this also thru the resource editor, by setting the right property of your edit box control.
|
|
|
|
|
m_myedit.SendMessage(EM_LIMITTEXT, (WPARAM)10, (LPARAM)NULL);
Nibu thomas
Software Developer
|
|
|
|
|
Hello people ,
i have a rather unique problem. in my application i have two tierd property sheets. (on the main dialog i have a property sheet with some pages and on each of the pages i have a property sheet and some pages)
all the property sheets are created at run time and the program wortks fine.
The problem starts when i try to add any control on the base dialog. in case a control is added, the program just doesnt pop any windows (file dialog for example) the whole application just hangs .
Can somebody tell me as to why this may be happening and what may be the possible solution.
The Debugger
|
|
|
|
|
Here’s my problem:
• I have an existing exe application that has Doc/View architecture (say A.exe).
• This needs to be converted into a DLL while retaining Doc/View architecture (say A.dll).
• All the resources and event handlers should reside in the dll.
• The second application (say B.exe) which needs to invoke above (A.dll) DLL also has its own Doc/View classes. The basic idea here is that both A and B should share the same data loaded in memory.
• User should be able to work independently on both A & B, means they should me modeless dialogs.
Thanks,
|
|
|
|
|
any body know which is header and library file for using
"IDropTargetHelper"
Bankey Khandelwal
Software Engineer
|
|
|
|
|
shlobj.h
Nibu thomas
Software Developer
|
|
|
|
|
it is right but which library file i have to link
Bankey Khandelwal
Software Engineer
|
|
|
|
|
looking at the MSDN[^], shell32.dll...
|
|
|
|
|
i have an assignment: write a program to translate simple words in English to another language such as Filipino. I don't know how to make such code... please help me.. thank you in advance.
|
|
|
|
|
Do you need to translate sentences or just individual words?
If you need to translate sentences, you'll need to develop an understanding of the grammatical syntax of the language (simple things like putting adjectives before or after nouns need to be sorted out). If you need only to translate individual words, you're basically just going to effectively be looking it up in a database of some kind and replacing the text with whatever you have in your database.
|
|
|
|
|
i juz need to translate individual words... what should i use to it? thanks...
|
|
|
|