Jump to content


Check out our Community Blogs

dargueta

Member Since 07 Oct 2007
Offline Last Active May 18 2019 05:29 PM
*****

#344056 Looping until a user presses a key?

Posted by dargueta on 22 January 2008 - 08:01 PM

Found it--it's a really illogical name for the function:


char userBuffer[64];
//erase the buffer - not necessary if done once, but if done
//multiple times then yes.
memset(userBuffer,NULL,64);
//read the user name into the buffer
ReadUserName(&userBuffer,63);
//check the value of the user name
if(strcmp("MyUserName",userBuffer) != 0)
printf("ACCESS DENIED.\n");

  • -1


#344050 Help

Posted by dargueta on 22 January 2008 - 07:18 PM

I think I know what you're talking about. Bring up the toolbox (should be a tab on the left or right side). Right click in the toolbox, select "Choose Items...". A dialog box should pop up with a lot of different controls to choose from. Notice that there are three tabs--if the control you're looking for isn't in the first section (.NET Framework Components), tab into the second or third and see if it's there.

As for the menu editor, you can do either, but it depends on your keyboard shortcut settings. Just do it through the menus.
  • 1


#343813 Looping until a user presses a key?

Posted by dargueta on 20 January 2008 - 05:40 PM

To get around TASKKILLER, just make the program open a copy of itself when it gets a close message. I don't know how to do that offhand, but I know there's a way. I'll check and let you know as soon as I find out.
  • 1


#343525 Extracting singel digits from an int.

Posted by dargueta on 17 January 2008 - 01:51 PM

Use the modulus base ten of the number after removing the preceding digits.


int extractDigit(int number, int place)
{
for(int i = 0; i < place; ++i)
number /= 10; //get rid of the preceding digits
return number % 10; //now ignore all of the following ones
}


To make it more generic, so that you can extract hex digits, just replace the tens with a variable called radix that'll be passed in as an argument.
  • 1




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download