|
You can use this sample:
#include <stdlib.h>
#include <stdio.h>
void main( void )
{
char buffer[20];
int i = 3445;
long l = -344115L;
unsigned long ul = 1234567890UL;
_itoa( i, buffer, 10 );
printf( "String of integer %d (radix 10): %s\n", i, buffer );
_itoa( i, buffer, 16 );
printf( "String of integer %d (radix 16): 0x%s\n", i, buffer );
_itoa( i, buffer, 2 );
printf( "String of integer %d (radix 2): %s\n", i, buffer );
_ltoa( l, buffer, 16 );
printf( "String of long int %ld (radix 16): 0x%s\n", l,
buffer );
_ultoa( ul, buffer, 16 );
printf( "String of unsigned long %lu (radix 16): 0x%s\n", ul,
buffer );
}
Output
String of integer 3445 (radix 10): 3445
String of integer 3445 (radix 16): 0xd75
String of integer 3445 (radix 2): 110101110101
String of long int -344115 (radix 16): 0xfffabfcd
String of unsigned long 1234567890 (radix 16): 0x499602d2
Omar
|
|
|
|
|
Do a search on MSDN for _itoa. You may come across: atoi, atof, atol, _itoa, _itow, ltoa, ltow, strod, strol, stroul, _ultoa, _wtoi, _wtol, _ultow. Lots of conversion functions for you!
Danny
|
|
|
|
|
How to write data to blank CD using VC
thanx
by
KK
|
|
|
|
|
Hello.
If you are using Windows XP, then there are two built-in CD-burning APIs.
The simplest one is ICDBurn.
If you need more control, use IMAPI (also in XP).
Else, I suggest you buy a Nero license and use the Nero API/SDK (which is free to download and use).
It might be a bit complex, but there are a lot of samples out there, just Google for them.
I use the Nero API/SDK for burning data-CD's and DVD's for a customers software and it works very, very well.
-- modified at 7:58 Thursday 22nd September, 2005
|
|
|
|
|
thanx for ur information
by
- KK -
|
|
|
|
|
Maybe you can try with NeroAPI[^]
<bold>- Nilesh
<italics>"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
How to read excel files in VC
thanx
by
KK
|
|
|
|
|
|
thanx for solution
Any other solution (not using Database) for reading Excel file
by
KK
|
|
|
|
|
I don't know KK...
This was one article i came across, when i was searching for somethins...
We'll wait for somebody else' reply....
Good luck....
|
|
|
|
|
You can use Excel automation also. Make a search on google (or this website)
|
|
|
|
|
You can find info on many file formats here inclusing Excel.
http://www.wotsit.org/[^]
If you vote me down, my score will only get lower
|
|
|
|
|
use Excel automation
CApplication app;
CRange range;
CWorkbook book;
CWorkbooks books;
CWorksheet sheet;
CWorksheets sheets;
VARIANT ret;
COleVariant covTrue((short)TRUE),covFalse((short)FALSE),covOptional((long)DISP_E_PARAMNOTFOUND,VT_ERROR);
try
{
CoInitialize(NULL);
if(!app.CreateDispatch("Excel.Application"))
{
AfxMessageBox("Cannot start Excel");
return;
}
books = app.get_Workbooks();
book = books.Open(fname,covOptional,covOptional,covOptional,covOptional
,covOptional,covOptional,covOptional,covOptional
,covOptional,covOptional,covOptional,covOptional
,covOptional,covOptional); // different for different ver of Excel
// check msdn website
sheets = book.get_Worksheets();
sheet = sheets.get_Item(COleVariant((short)1));
sprintf(cell,"%c%d",alpha[k],j); // eg A1, A2, etc
range = sheet.get_Range(COleVariant(cell),COleVariant(cell));
ret = range.get_Value2();
CString t = ret.bstrVal; // t will hold the value of the cell
books.Close();
app.Quit(); // close excel application remember to close application
}
catch(COleException *e)
{
char buf[1024];
sprintf(buf, "COleException %081x.", (long)e->m_sc);
}
catch(COleDispatchException *e)
{
char buf[1024];
sprintf(buf, "COleDispatchException %081x.", (long)e->m_wCode);
}
catch(...)
{
char buf[1024];
sprintf(buf, "General Exception");
}
hope tis helps
Thomas
|
|
|
|
|
I use Visual Studio 6. Is it possible to select a rectangular area that does not start from column zero, and copy that text?
|
|
|
|
|
Are you refering to Visual studio editor???
|
|
|
|
|
i think he means into the source editor ; the behavior is the one we could find into UltraEdit under the feature called "Column mode selection".
but i don't know how to do this in VS6...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
In the source editor you can press Alt key and select using the mouse.
|
|
|
|
|
excelent...
thanks, and thank you also for Mr Flace (who is the poster of the original question)...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Awesome! this is what I was looking for. Thanks.
|
|
|
|
|
But one thing, while pasting the recangle block you have to give necessary blank lines, else will be appended to the exiting lines....
|
|
|
|
|
actually, in some cases that is desirable too!
|
|
|
|
|
True..
|
|
|
|
|
I have a project that I need to communicate with another host PC using MODBUS/ TCP. I have no idea in doing this MODBUS TCP program. Can give some source code in doing this MODBUS TCP. I really need help.
THANKS for help.
|
|
|
|
|
|
i created a DLL with some functions that i'd use in a VB or someother application,
but the problem is for every exported function , i need to do like
[code]
Private Declare Function MyTestFun1 Lib "MDLL.dll" (ByVal hWnd As Long, ByVal a As Integer, b As Integer) As Integer
Private Declare Function MyTestFun2 Lib "MDLL.dll" (ByVal hWnd As Long, ByVal a As Integer, b As Integer) As Integer
[/code]
what i need is like, when u create an object using Microsoft scripting runtime, you'll get access to FileSystemObject. (fso)
so in VB, you do like
[code]
Dim fso as new fileSystemObject
later on you'd use all functions by fso.(dot)..
[/code]
how'd i do my own dll like MSScripting runtime..?
regards,
Rookie
-- modified at 4:37 Thursday 22nd September, 2005
|
|
|
|
|