|
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
|
|
|
|
|
Try creating DLL through ATL COM and make each function as interface.
<bold>- Nilesh
<italics>"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
There are two things you need to do:
First define your functions in the DLL so VB can call them correctly:
// DLL external entry points for VB
long WINAPI MyTestFun1(HWND hwnd, int a, int b)
long WINAPI MyTestFun2(HWND hwnd, int a, int b)
// Then you will need a def file for the DLL so the entries are public and VB can pull them out
LIBRARY MDLL
DESCRIPTION 'Test DLL'
EXETYPE WINDOWS
EXPORTS
MyTestFun1 @1
MyTestFun2 @2
Your VB defines look correct so it should work with these changes.
|
|
|
|
|
Good day,
I want to create a CListBox in which item index 0 & 1 have image(bmp or icon) with text and the next indexes are plain text. How can i achieve it?
I have search examples and found an image listbox but when i insert plain text on the successing index, still the plain text will not be on its normal location that is on the leftmost area because the area now is reserve for image, but i only wanted index 0 and index 1 to have an image, the rest is plain text.
Thanks a lot.
More Power!
|
|
|
|
|
What styles does the listbox have?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
LBS_NOTIFY | WS_VSCROLL | WS_BORDER
Selection:Single,
Owner Draw:Fixed,
Has String enabled,
Thanks...
|
|
|
|