|
Matt Gullett wrote:
McAfee makes compiled so slow I can't stand it.
You might try to exclude your development directories from checking completely. That should (and back in NT4 and VC4.2/VC5 did for me) reduce the McAffe overhead to not noticable.
|
|
|
|
|
no solution, but... same here.
-c
ABSURDITY:
A statement or belief manifestly inconsistent with one's own opinion.
|
|
|
|
|
can anyone help me on how to use the stl qsort and if possible give me examples. i am try to use qsort so that i can sort out values from smaller value to higher values. how do i do that? anyways, thank you very much...
Thank you very much,
John
Aloha from Hawaii
|
|
|
|
|
int MySort( const void *arg1, const void *arg2 )
{
return *(char*)arg1 - *(char*)arg2;
}
void main()
{
char sText[10];
strcpy(sText, "ASDFGHJKL");
qsort(sText, strlen(sText), sizeof(char), MySort);
printf(sText);
printf("\n");
}
Maxwell Chen
People say "No news is good news". Then, no bug is good bug!?
|
|
|
|
|
// Next time just use msdn.
Example
/* QSORT.C: This program reads the command-line
* parameters and uses qsort to sort them. It
* then displays the sorted arguments.
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
int compare( const void *arg1, const void *arg2 );
void main( int argc, char **argv )
{
int i;
/* Eliminate argv[0] from sort: */
argv++;
argc--;
/* Sort remaining args using Quicksort algorithm: */
qsort( (void *)argv, (size_t)argc, sizeof( char * ), compare );
/* Output sorted list: */
for( i = 0; i < argc; ++i )
printf( "%s ", argv[i] );
printf( "\n" );
}
int compare( const void *arg1, const void *arg2 )
{
/* Compare all of both strings: */
return _stricmp( * ( char** ) arg1, * ( char** ) arg2 );
}
Output
[C:\code]qsort every good boy deserves favor
boy deserves every favor good
Aizik Yair
Software Engineer
|
|
|
|
|
thank you very much for you guys help. i really appreciate it. i dont have a MSDN library so i couldnt do this problem. thank you very much again.
Thank you very much,
John
Aloha from Hawaii
|
|
|
|
|
John Cruz wrote:
i dont have a MSDN library
Have you seen http://msdn.microsoft.com/library ?
Kind regards to Hawaii.
|
|
|
|
|
I have created an Edit control dynamically with the help of CEdit class using the CreateEx member funtion...How to add a message handler funtion for that control. For example KeyPress event i want to handle. I would be greatfull if anybody let me know the answer for this question.
Reg
Guru
|
|
|
|
|
try using class wizard
Aizik Yair
Software Engineer
|
|
|
|
|
Copy the code, generated for edit events in a dialog by classWizard, to your project. Note, that you must specify unique ID for the edit for correct message handling.
|
|
|
|
|
Hi,
In my application, I have a given process (I get its identifier as a DWORD, a pseudo HANDLE and its name) and a given mutex name and I have to know if this given mutex belongs to the given process.
Does anybody know how to proceed ?
Thanks,
Robin.
|
|
|
|
|
Can you describe situation with more details?
For what purpose you want to check is mutex belong to given process?
Maybe you can create a table of pair mutex-PID in shared memory and when needed check is mutex belong to Process. (??? MapViewOfFile function can help with memory sharing ???)
|
|
|
|
|
Please, if somebody has ready solution (function for counting of words in a string), write it here. I just want to obtain number of words in LPSTR string.
Thanks!
|
|
|
|
|
You can use strtok. First define a string of separators and then use strtok to find all matching tokens and count them.
Best regards,
Alexandru Savescu
|
|
|
|
|
Thanks! Here was example:
* STRTOK.C: In this program, a loop uses strtok
* to print all the tokens (separated by commas
* or blanks) in the string named "string".
*/
#include <string.h>
#include <stdio.h>
char string[] = "A string\tof ,,tokens\nand some more tokens";
char seps[] = " ,\t\n";
char *token;
void main( void )
{
printf( "%s\n\nTokens:\n", string );
/* Establish string and get the first token: */
token = strtok( string, seps );
while( token != NULL )
{
/* While there are tokens in "string" */
printf( " %s\n", token );
/* Get next token: */
token = strtok( NULL, seps );
}
}
Output
A string of ,,tokens
and some more tokens
Tokens:
A
string
of
tokens
and
some
more
tokens
|
|
|
|
|
Who can point me to sample or article about using LPSECURITY_ATTRIBUTES in AfxBeginThread function?
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
What's the difference between COM and COM+?
If I create a COM DLL using VS.NET on XP, does this automatically mean it's a COM+ component?
Regards
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
|
Thanks Michael
So basically COM+ is COM plus some extra stuff
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Some problems on VC++ activex:
i try to add-in a telephony class from the below directory
Components and controls gallery->Registered Active X
control->Telephony class
Xtel.dll
but when i try to execute the application,it show application error:
[The instruction at "0x676c49ee" referenced memory at "0x00000008".The
memory could not be "read".]
and when i try to debug it,it show
676C49EE call dword ptr [ecx+8]
Do anyone have any idea what happen on it?
thanks...
|
|
|
|
|
Dear all,
In a dialog-based application, I have a main window. I want set it
with a changable size of the window as usually used window's application.
How to maximize, minimize or freely change the size of the window in
a dialog based application?
Thanks in advance!
xyz
|
|
|
|
|
Change the window styles.
First, in order to be able to resize the dialog you will want to remove the WS_DLGFRAME style from the dialog and replace it with a WS_THICKFRAME style.
In order to be able to maximize the dialog you will want to add the WS_MAXIMIZEBOX style to the dialog.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
And you can do all that in the Dialog editor.
Best regards,
Alexandru Savescu
|
|
|
|
|
Hi!
I have a preview control which draws metafiles. How can I draw metafile, but with colors which have been defined in my application?
Thanks for help!
|
|
|
|
|
I have got an anwser...
Enumerate metafile, and just before PlayMetaFileRecord() select desired pen.
|
|
|
|