|
thanks for the reply.
i will search for word list as you suggested, chinese is very popular hopefully i will find my lingo as well
thanks again
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Hello everyone,
I have some questions about the keyword "__cdecl",
1. What is the function of this keyword? I read through the MSDN document, but still confused. Could anyone give me some brief and clear descriptions which are better than Microsoft?
2. If I am porting the source codes from Windows to Linux, does on Linux platform exist similar (or the same) keyword like __cdecl? How should I port source codes which has __cdecl keyword?
thanks in advance,
George
|
|
|
|
|
George_George wrote: Could anyone give me some brief and clear descriptions which are better than Microsoft?
This[^] should do.
Nibu thomas
Software Developer
|
|
|
|
|
Cool stuff! Thank you Nibu!
Do you have any ideas of how to deal with such keyword when porting to Linux?
regards,
George
|
|
|
|
|
George_George wrote: Do you have any ideas of how to deal with such keyword when porting to Linux?
I don't think it should make a difference. It will work the same way in Linux too. Well these are standard calling conventions hence porting it to Linux shouldn't cause problems.
But the bottom line is that these are implemented by compilers so the makers will make sure they implement the standard conventions.
__cdecl should behave the same way.
Note: This is my personal opinion. I cannot say how correct these are.
Nibu thomas
Software Developer
|
|
|
|
|
Thanks Nibu!
What means "But the bottom line is that these are implemented by compilers so the makers will make sure they implement the standard conventions"? Do you mean some compiler vendor does not implement this option?
Another question is that, how could I verify that __cdecl works and works the same approach as that under Windows?
regards,
George
|
|
|
|
|
1. In fact you have several calling conventions. A calling convention define which part, from the caller or the callee, will clean the stack when the function return. You have the standard convention and the C calling convention. Typically, cleaning the stack means: when you call a function and supply parameters to this function, these parameters are pushed onto the stack. These parameters needs then to be pulled off the stack when returning from the function. The calling convention defines which part will clean the stack (sorry, but I don't remember for __cdecl which part clean the stack).
2. Sorry, no idea about that
|
|
|
|
|
Thank you Cedric!
Great answer!
regards,
George
|
|
|
|
|
George_George wrote: 2. If I am porting the source codes from Windows to Linux, does on Linux platform exist similar (or the same) keyword like __cdecl? How should I port source codes which has __cdecl keyword?
The GCC compiler has function attribute cdecl which appears to be similar in meaning, but the syntax is different:
http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Function-Attributes.html[^]
|
|
|
|
|
Thanks markkuk,
I found the attribute name is the same -- cdecl. Why do you say that the syntax is different?
regards,
George
|
|
|
|
|
Hi,
I am storing all the barcode into below declared list
<br />
typedef std::list<char* > SERIAL_NUM_BARCODE_LIST;<br />
SERIAL_NUM_BARCODE_LIST SerialNumDescList;<br />
Now before adding to list I have to check whether barcode exist in the list or not. If barcode does not exist than only I have to add it.
<br />
typedef std::list<char* >::iterator BARCODE_LIST_ITER;<br />
BARCODE_LIST_ITER BarcodeListIter; <br />
for(BarcodeListIter = SerialNumBarcodeList.begin(); BarcodeListIter != SerialNumBarcodeList.end();BarcodeListIter++)<br />
strcmp(SerialNumBarcodeList.front(),Barcode)<br />
Is there simple find method present in STL to check inside the list.
Thanks
|
|
|
|
|
You can simply compare the contents of the iterator (so, the string) with the name of the new barcode. To access the string through the iterator, just use this:
(*BarcodeListIter)
|
|
|
|
|
Ideally, you should store the barcodes as strings instead of a pointer. For example:
std::list<std::string> SerialNumBarcodeList;
...
std::list<string>::const_iterator it = std::find(SerialNumBarcodeList.begin(), SerialNumBarcodeList.end(), BarCode);
if (it != SerialNumBarcodeList.end())
{
...
}
-- modified at 2:56 Monday 27th March, 2006
|
|
|
|
|
Thank dear, I hope it will take care the boundary condition where it is checking the barcode with SerialNumBarcodeList.end()
|
|
|
|
|
Hi All,
How can I implement the shared memory concept with C language on windows platform?
Here I want to share a common data with 2-3 executable of C language files on windows platform.
Thanks in advance,
-Ramesh
|
|
|
|
|
For C++, you have quite a few classes in Codeproject's Threads and IPC section[^].
Examples:
CMemMap[^] Which seemed to inspire...
XQueue[^]
and even Microsoft's own CAtlFileMapping class[^].
Raymond chen notes another method[^], but this one opens a security hole.
But for managing variables via shared memory, you'll definitely want to use a helper class.
|
|
|
|
|
Hi,
Anyone know how to enumrate printers from active directoty ?
VikramS
|
|
|
|
|
there is a function called EnumPrinters() which can enum all printers, including networking's.
but I am not sure if it is related to your "active directory".
A nice hyper tool for optimizing your Microsoft html-help contents.
A best image tool for Windows C++ programmers, don't miss it!.
Includeh10
|
|
|
|
|
Hi all "Respected members "
I want to know as we can disable a button in vc++ like this:
GetDlgItem(IDC_SPLITBUTTON)->EnableWindow(FALSE);
and enable it like this:
GetDlgItem(IDC_SPLITBUTTON)->EnableWindow(TRUE);
How can we disable and enable a progress bar?
Thanks in Advance...
alok singh chauhan
-- modified at 1:23 Monday 27th March, 2006
|
|
|
|
|
ariesaloksingh wrote: I want to know as we can disable a button in vc++ like this:
GetDlgItem(IDC_SPLITBUTTON)->EnableWindow(FALSE);
and enable it like this:
GetDlgItem(IDC_SPLITBUTTON)->EnableWindow(TRUE);
How can we disable and enable a progress bar?
In the same way or using a control variable.
Nibu thomas
Software Developer
|
|
|
|
|
Sir i had tried that but that's not working.
alok singh chauhan
|
|
|
|
|
Can you post your code, pls ?
~RaGE();
|
|
|
|
|
Sir,i want that each time i execute this code written below(which is written in a button)the progress bar should progress and it should look like that, but
after 1st execute the progress bar is filled and next time it looks that it is not progressing.pls help me how can i make it look progress after 1st execute.
//Progress Bar
m_mprogress.SetRange(0,1);
//Read from merge file to Buffer
intnumRead= fread(buff1,sizeof(char),lmFileSize,mergeFile);
//Write from Buffer to merge file
intnumWrite= fwrite(buff1,sizeof(char),lmFileSize,newFile);
//Current Position of New file
fseek(newFile,0,SEEK_CUR);
m_mprogress.SetPos('1');
Sorry for my english
Thanks in Advance
alok singh chauhan
-- modified at 3:59 Monday 27th March, 2006
|
|
|
|
|
Explanantion of what goes wrong :
m_mprogress.SetRange(0,1);
With this you set the range of your progress bar from 0 to 1, so it has only one step !
m_mprogress.SetPos('1');
With this you set the position of the progress bar to 1, which is the end boundary of the progress bar you've set with SetRange(0,1);
What you need to do is following :
1. Compute the number of times you will call the function you want to monitor with the progress bar (let's say it is 'n')
2. Initialize the progress bar with m_mprogress.SetRange(0,n);
3. Everytime you want to incremente the progress bar, call m_mprogress.StepIt();
Hope this helps.
~RaGE();
|
|
|
|
|
Hi ,
hope this will help sorry for replying late .
CProgressDlg prgDlg;<br />
prgDlg.Create();<br />
prgDlg.SetRange(0,100);<br />
<br />
File_count_line.seekg (0, ios::end);<br />
int length_total_line = File_count_line.tellg();<br />
int nLoop = length_total_line/length_one_line;<br />
File_count_line.seekg (0,ios::begin );<br />
<br />
int length_one_line = File_count_line.tellg();<br />
<br />
double nPerc = (double)((double)length_one_line/length_total_line)*100;<br />
prgDlg.SetPos((int)nPerc);
Regards,
FarPointer
-- modified at 11:01 Sunday 2nd April, 2006
|
|
|
|