|
_itoa :
function convert the digits of the given value argument to a null-terminated character string and stores the result (up to 33 characters for _itoa) in string.
Cheers
"Peace of mind through Technology"
|
|
|
|
|
i have to implement this function in other plateform not on windows and there is no spelling mistaques this is _itot and _iota not itoa.
Thanks & Regards
Banks
|
|
|
|
|
From the DOCS:
_itot(int ,_TCHAR* ,int )
value - Number to be converted
string - String result
radix - Base of value; must be in the range 2 - 36
_itoa(int ,char *,int)
value - Number to be converted
string - String result
radix - Base of value; must be in the range 2 - 36
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I have to implement these function on other plateform not simply use these function so i want source code for these function not only syntax.
Thanks & Regards
Banks
|
|
|
|
|
What is the platform?
I am providing the code for the operation of _itoa(*,**,10);
* denotes integer variable
** denotes char*
<br />
char *convertinttochar(int num)<br />
{<br />
int ix=0;<br />
int jx=0;<br />
int kx=0;<br />
int xones=0;<br />
char xtemp[5];<br />
char xans[5];<br />
while (num!=0) <br />
{<br />
xones=num%10; <br />
xtemp[i]=(char)(xones+48);<br />
num=num/10; <br />
ix++; <br />
}<br />
for(jx=ix-1;jx>=0;jx--) <br />
{<br />
ans[kx]=temp[jx]; <br />
kx++;<br />
}<br />
ans[ix]='\0'; <br />
return (char *)ans;<br />
<br />
}
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 7:13 Friday 19th May, 2006
|
|
|
|
|
i don't want code for itoa . i have to implement _itot(...).
this function called on windows like this :
_itot(++nNumber, szNumber + 1, 10);
so can you explain me what is the purpose of this function _itot(...).
Thanks & Regards
Banks
|
|
|
|
|
Use the following Generic-Text Routine Mappings
if TCHAR.H Routine
_itot
if _UNICODE & _MBCS Not Defined
_itoa
if _MBCS Defined
_itoa
if _UNICODE Defined
_itow
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
It should be easy enough to implement your own itoa() function. It simply converts an integer to a string. Go through each digit of the integer using the % operator. If you have VC++ installed, you should already have the source to _itoa() .
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
Hi all,
I'm making a dll that read/write with a hardware device
which is connected with USB port.
My colleague says what I should do is
1.calling CreateFile() to get handle for the usb port
2.use ReadFile() or WriteFile() for reading and writing through the handle.
But, when I searched for this issue,
I saw some web pages that says I should use DeviceIoControl().
Please tell me which is right opinion,
and what's different between them.
thanks.
--Maekawa
|
|
|
|
|
I depends of the USB device you are using. USB communications are much more complex than simple serial communication. In fact, you have several pipes that can be either Bulk (no loss of data but no timing guaranties) or isochronous (time guaranties but not reliable). If you use DeviceIOControl, you are able to send command to the driver to make some special operations, like creating new pipes, sending data on a specific pipe, ... But of course, all of that depends of the driver (and what it provides as functionalities). As the driver is supplied with the device, you should have received documentation with it.
Now, the driver is perhaps done in a way to ease the development so it takes some specific actions when you call ReadFile and WriteFile (maybe there is only one pipe that was opened and calling these functions will simply read and write on the existing pipe).
So, if your colleague knows about what he's speaking, then it's ok
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
cedric, "USB!!" ..hmmm Yummy , take it up!
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
[My Current Status]
|
|
|
|
|
|
Ah, see it's an USB quesion, you'll certainly like it
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
[My Current Status]
|
|
|
|
|
Ok, I got it. Sorry, friday morning so the brain is already in week-end and is away
Yes, I used to work with USB devices for my previous job and I know more or less how USB communications work. In general, there is a lot of confusion because people treat that as a standard serial communication but it's much more complex in fact.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Cedric Moonen wrote: Ok, I got it. Sorry, friday morning so the brain is already in week-end and is away
Yeah, same here.. , waiting anxiously to pass another 8 hours , Ofcourse with some work done for the company ..
Cedric Moonen wrote: Yes, I used to work with USB devices for my previous job
Yeah, its good that at least there's someone to take care of the "USB" questions!!;)
Have a Nice weekend!
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
[My Current Status]
|
|
|
|
|
Yaa..u can use CreateFile,ReadFile and WriteFile for USB communication also.
Takanobu Maekawa wrote: I saw some web pages that says I should use DeviceIoControl().
But I have never come accross DeviceIoControl()..Can anybody tell me ,how to work with DeviceIoControl().
http://www.codeproject.com/system/cserialcom.asp[^]
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
Hi,
What is the operation performed by "Overlay Mixer" Filter in FilterGraph of DirectShow?
Is there any Filter that perform opertion same as VMR Filter having output pin? OR How I can use "Overlay Mixer" Filter?
Best Regards,
Aniket
|
|
|
|
|
Doin a simulation on web cache server...stored a web page like google on the hard disk of the machine actin as the wcs....fter the request is send by the client...the client receives the page without the .gif images on dem...is there something missin in the code written for it...
if(SUCCEEDED(hr))
{
HRESULT hr1 = m_pRecordset.CreateInstance(__uuidof(Recordset));
if(SUCCEEDED(hr1))
{
m_pRecordset->Open("SELECT * FROM wcs ;","Provider= MSDASQL.1 ;Data Source=wcs;Initial Catalog=;User Id=; Password=;",adOpenDynamic,adLockUnspecified,adCmdText);
while(!m_pRecordset->EndOfFile)
{
AfxMessageBox(( _bstr_t)m_pRecordset->GetFields()->GetItem("URL")->GetValue());
_bstr_t val=( _bstr_t)m_pRecordset->GetFields()->GetItem("URL")->GetValue();
if((strcmp(url,(char*)val))==0)
{
flag=1;//Page matched in DB
_bstr_t loc=( _bstr_t)m_pRecordset->GetFields()->GetItem("Location")->GetValue();
CFile f;
TCHAR* pFileName = _T(loc);
if( !f.Open( pFileName, CFile::modeRead,NULL) )
{
AfxMessageBox("cannot open file");
}
else
{
char *pbuf =new char [60000];
UINT nBytesRead = f.Read( pbuf, 60000 );
m_sConnected.Send(pbuf,60000);
AfxMessageBox("sent");
//UPDATING DB
_CommandPtr m_pCommand;
m_pCommand.CreateInstance(__uuidof(Command));
m_pCommand->ActiveConnection = m_pConnection;
m_pCommand->CommandText = "update wcs set no_of_accesses = no_of_accesses+1";
pRs.CreateInstance(__uuidof(Recordset));
pRs->PutRefSource(m_pCommand);
_variant_t vNull(DISP_E_PARAMNOTFOUND, VT_ERROR);
pRs->Open(&vNull, &vNull, adOpenDynamic, adLockOptimistic, adCmdUnknown);
}//open file
break;
}//if str compare
else
{
AfxMessageBox("else");
m_pRecordset->MoveNext();
}
}
-- modified at 1:53 Friday 19th May, 2006
|
|
|
|
|
Hi,
My server App is listening at an some IP at the port 1234.
I am using CSocket class, At client side CSocket.Create() will creat a random socket/port
Would the CSocket.Create() will be successfull at the client side where firewall is installed
and will the app start listening at that socket.
Thanks
Regards.
|
|
|
|
|
zahid_ash wrote: t client side CSocket.Create() will creat a random socket/portWould the CSocket.Create() will be successfull at the client side where firewall is installedand will the app start listening at that socket.
At Client End you will not Associate you Client Application to any port you just connect to port on that IP address where you server is listening!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
At server Side I will do:
CSocket sockSrvr;
sockSrvr.Create(PORT);
sockSrvr.Listen();
At Cleint side I will do as :
CSocket sockClient;
sockClient.Create();
sockClient.Connect( strIP, PORT );
When the line sockClient.Create(); will execute , would not it will create any random port on which it will recvie data from server. sned data to server via this created port.
Please calrify / make correction if I am wrong
Regards.
|
|
|
|
|
zahid_ash wrote: random port
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
[My Current Status]
|
|
|
|
|
hai, I want to know about pre compiled header files.
What are precompiled header files ?
Are they compile before compilation ?
How precompiled header files make the build much faster?
Thank you in advance.
|
|
|
|
|
The C++ compiler provides a mechanism for, in effect, taking a snapshot of the state of the compilation at a particular point and writing it to a disk file before completing the compilation; then, when recompiling the same source file or compiling another file with the same set of header files, it can recognize the ``snapshot point,'' verify that the corresponding precompiled header (``PCH'') file is reusable, and read it back in. Under the right circumstances, this can produce a dramatic improvement in compilation time; the trade-off is that PCH files can take a lot of disk space.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thank you very much.
Is there any relation to make file ? sorry if iam too beyond.
|
|
|
|