|
In other word,I mean is that available in these CPU's(AMD,Intel)?
Mazy
No sig. available now.
|
|
|
|
|
Well, my app is using CStringArray and CUIntArray, and I would like to know how to sort them, I mean, if I insert into my collection lots of times (example: "12:15", "18:25"...) I would like to know how to sort them ascendent or descendent. Same with CUIntArray.
Please help, I think this is interesting...
Thank you !!
Written by: Rafael Fernández López.
void life ( bool me, bool her )
{
if ( her )
{
me = true ;
}
else
{
me = false ;
} }
|
|
|
|
|
good one ,not the question but the Signature...take care...
utkarsh sharma
"Not everything that counts can be counted, and not everything that can be counted counts."
|
|
|
|
|
Yes, I'm from spain and my english is not very good. Well, do you know how to do it ?? I would like to have some kind of object/function/class that would be able to sort a collection or something like that.
Thanks in advance.
Written by: Rafael Fernández López.
void life ( bool me, bool her )
{
if ( her )
{
me = true ;
}
else
{
me = false ;
} }
|
|
|
|
|
/*Assuming we have a CStringArray strItems,
then this code sorts it using a very simple
bubble sort .There are many different
sorting algorithms which you could use
*/
for (int nOuter = 0; nOuter < strItems.GetSize() - 1; nOuter++)
{
for (int nInner = strItems.GetSize() - 1; nInner > nOuter; --nInner)
{
if (strItems[nInner - 1] > strItems[nInner])
{
CString strTemp = strItems[nInner];
strItems[nInner] = strItems[nInner - 1];
strItems[nInner - 1] = strTemp;
}//end of if
}//end of inner for
}// end of outer for
-----
and previous mail was not a fun of any body's english but I feel u'r signature is ossum..
utkarsh sharma
"Not everything that counts can be counted, and not everything that can be counted counts."
|
|
|
|
|
Well, i'm going to test it, thank you very much... altough I don't underestand that code completely because I don't think it will sort them alphabetical, but if you say so, I believe you.
PD: I know my english is not very good, and I'm sorry about that. Thank you for your effort.
Thank you so much !!!
Written by: Rafael Fernández López.
void life ( bool me, bool her )
{
if ( her )
{
me = true ;
}
else
{
me = false ;
} }
|
|
|
|
|
hi honey..
You can use the sample code sort a CStringArray object.
The main() function constructs a CStringArray object,
adds elements to it, prints out the elements,
calls the sort() member function to sort it, and then prints the sorted elements.
The sort() function uses the Bubble Sort algorithm to sort the array and calls the CompareAndSwap()
function to compare each string and swap them if necessary.
//Sample Code
/*
* Compile options needed: /MT
*/
class CSortStringArray : public CStringArray {
public:
void Sort();
private:
BOOL CompareAndSwap(int pos);
};
void CSortStringArray::Sort()
{
BOOL bNotDone = TRUE;
while (bNotDone)
{
bNotDone = FALSE;
for(int pos = 0;pos < GetUpperBound();pos++)
bNotDone |= CompareAndSwap(pos);
}
}
BOOL CSortStringArray::CompareAndSwap(int pos)
{
CString temp;
int posFirst = pos;
int posNext = pos + 1;
if (GetAt(posFirst).CompareNoCase(GetAt(posNext)) > 0)
{
temp = GetAt(posFirst);
SetAt(posFirst, GetAt(posNext));
SetAt(posNext, temp);
return TRUE;
}
return FALSE;
}
void main()
{
CSortStringArray sortArray;
sortArray.Add(CString("Zebra"));
sortArray.Add(CString("Bat"));
sortArray.Add(CString("Apple"));
sortArray.Add(CString("Mango"));
for (int i = 0; i <= sortArray.GetUpperBound(); i++)
cout << sortArray[i] << endl;
sortArray.Sort();
cout << endl;
for (int j = 0; j <= sortArray.GetUpperBound(); j++)
cout << sortArray[j] << endl;
}
take care...
utkarsh sharma
"Not everything that counts can be counted, and not everything that can be counted counts."
|
|
|
|
|
hi honey..
You can use the sample code sort a CStringArray object.
The main() function constructs a CStringArray object,
adds elements to it, prints out the elements,
calls the sort() member function to sort it, and then prints the sorted elements.
The sort() function uses the Bubble Sort algorithm to sort the array and calls the CompareAndSwap()
function to compare each string and swap them if necessary.
//Sample Code
/*
* Compile options needed: /MT
*/
class CSortStringArray : public CStringArray {
public:
void Sort();
private:
BOOL CompareAndSwap(int pos);
};
void CSortStringArray::Sort()
{
BOOL bNotDone = TRUE;
while (bNotDone)
{
bNotDone = FALSE;
for(int pos = 0;pos < GetUpperBound();pos++)
bNotDone |= CompareAndSwap(pos);
}
}
BOOL CSortStringArray::CompareAndSwap(int pos)
{
CString temp;
int posFirst = pos;
int posNext = pos + 1;
if (GetAt(posFirst).CompareNoCase(GetAt(posNext)) > 0)
{
temp = GetAt(posFirst);
SetAt(posFirst, GetAt(posNext));
SetAt(posNext, temp);
return TRUE;
}
return FALSE;
}
void main()
{
CSortStringArray sortArray;
sortArray.Add(CString("Zebra"));
sortArray.Add(CString("Bat"));
sortArray.Add(CString("Apple"));
sortArray.Add(CString("Mango"));
for (int i = 0; i <= sortArray.GetUpperBound(); i++)
cout << sortArray[i] << endl;
sortArray.Sort();
cout << endl;
for (int j = 0; j <= sortArray.GetUpperBound(); j++)
cout << sortArray[j] << endl;
}
take care...
utkarsh sharma
"Not everything that counts can be counted, and not everything that can be counted counts."
|
|
|
|
|
Hello,
I am in the process of making a remote controll like application. What I mean by "remote control", is the client program will send a command to the server (EX.run_program). Then the server program will recieve that command, and know how to handle it. Anyways, I want to know how I can do this. Any help will be appriciated!
|
|
|
|
|
simple http stuff will do for this if u have the correct way of running .exes on the server
"there is no spoon" biz stuff about me
|
|
|
|
|
Does DLL related to PCI driver? what is the connection between this things?
|
|
|
|
|
For some types of hardware, the manufacturer will include a DLL that applications use to communicate with the device driver.
For example, suppose you have an image capture board that accepts data from a digital camera. The manufacturer would give you a DLL that contained functions for controlling the camera and capturing images, since these functions are not covered by the normal Windows API. Your applications calls functions in the DLL, which in turn communicates with the device driver.
Software Zen: delete this;
|
|
|
|
|
hi..i 'm develop a driver for PCI expansion slot using C++. i have to access the PCI installation and detection as manually by using C++.can someone give me some idea in order to make a move ?pls help me coz i really need some help..tq (
|
|
|
|
|
i think you can use WMI for that..
see: msdn help on wmi for examples
|
|
|
|
|
During the time i compile my VC6.0 project in VC7.0
I get these error during linking process.
TestMC error LNK2001: unresolved external symbol "void __cdecl std::_Xlen(void)" (?_Xlen@std@@YAXXZ)
TestMC error LNK2001: unresolved external symbol "void __cdecl std::_Xran
What are the needed header files or static libraries?
thanks
|
|
|
|
|
I had similar problem when I compiled my VC6.0 on VC7.0.
I do not think you are missing files, just play with project settings.
In my case I fixed it by:
Linker\input\ignore all default libraries ->set it to--> NO.
Mark,
|
|
|
|
|
I am creating 2 secondary threads in my application.One of them runs constantly behind to poll for incoming files. The other one is created every 40 seconds.I've implemented the creation of thread using timer.This timer thread uses MAPI to check for incoming mails etc.
The problem is after this thread finishes checking the mails, the application pauses. i.e. the thread running behind stops.Sometimes it starts on its own after 20 secs or so. At times when it doesn't start,a user input like a mouse click or so does the trick and it starts.
The pausing is also intermittent so its very difficult to know exact reason why this is happening?
Any ideas?
Thanks in advance
|
|
|
|
|
It is tricky to debug multithreaded applications with in-depth knowledge of the design including calls to win32 API that waits for an event to complete.
Post more including including calls to WaitForSingleObject() if applicable.
Kuphryn
|
|
|
|
|
Hi, I will like to know what is the difference between malloc and localalloc?
Thanks.
|
|
|
|
|
look at return values at first (and than at LocalLock/Unlock help)
and:
The global and local functions supported for porting from 16-bit code, or maintaining source code compatibility with 16-bit Windows. The global and local functions are slower than other memory management functions and do not provide as many features. Therefore, new applications should use the heap functions. However, the global functions are still used with DDE and the clipboard functions.
Windows 95/98/Me: The heap managers are designed for memory blocks smaller than four megabytes. If you expect your memory blocks to be larger than one or two megabytes, you can avoid significant performance degradation by using the VirtualAlloc or VirtualAllocEx function instead.
|
|
|
|
|
Hi, thanks for your reply.
So do you mean both malloc and LocalAlloc actually allocates memory from the heap?
So I guess the main difference is really it's portability then, isn't it?
|
|
|
|
|
easiest is to look into malloc.c directly (in my case \Program Files\Microsoft Visual Studio\VC98\CRT\SRC)
you can find HeapAlloc there (#ifdef WINHEAP)
|
|
|
|
|
Hi,
any one have flex.exe please mail to me.
email : murali_utr@hotmail.com
murali@s-ecom.com
thanks in advance.
Happy New Year.
Murali.M
|
|
|
|
|
hi,
i got it. flex.exe is available in the following url.
http://www.monmouth.com/~wstreett/lex-yacc/lex-yacc.html
Have A Nice Day.
Murali.M
|
|
|
|
|
hai, i am a beginner of the c++ programming,and i am now doing a windows programming project of write and read through a serial port using c++. i have totaly no idea of how to do the windows programming.
i would able to write and read to the serial port in dos mode only. this is my simple program:
int main()
{
char path[BUFLEN];
DWORD byteswritten;
DWORD bytesread;
DCB portDCB;
char read[BUFLEN];
cout << "Enter the characters:" << endl;
cin.getline(path,100);
HANDLE comport;
comport = CreateFile("COM1:",
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
0, NULL);
if (comport == INVALID_HANDLE_VALUE)
{
cout << "Problem opening com port " << endl;
exit(1);
}
GetCommState(comport,&portDCB);
portDCB.BaudRate=14400;
portDCB.Parity=NOPARITY;
portDCB.StopBits=ONESTOPBIT;
portDCB.ByteSize = 8;
SetCommState(comport,&portDCB);
if(WriteFile(comport,path ,strlen(path),&byteswritten,NULL))
{
cout<<"******write to the com port******"<
|
|
|
|