Click here to Skip to main content
15,896,269 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionConvert unsigned 16 bit Word Pin
simonpearson3-Oct-05 12:50
simonpearson3-Oct-05 12:50 
AnswerRe: Convert unsigned 16 bit Word Pin
Fired Fish3-Oct-05 13:56
Fired Fish3-Oct-05 13:56 
GeneralRe: Convert unsigned 16 bit Word Pin
Prakash Nadar3-Oct-05 22:18
Prakash Nadar3-Oct-05 22:18 
AnswerRe: Convert unsigned 16 bit Word Pin
Chris Losinger3-Oct-05 14:00
professionalChris Losinger3-Oct-05 14:00 
AnswerRe: Convert unsigned 16 bit Word Pin
Rick York3-Oct-05 16:34
mveRick York3-Oct-05 16:34 
QuestionReading and writing some data from an Excel file Pin
zohresaeed3-Oct-05 12:48
zohresaeed3-Oct-05 12:48 
AnswerRe: Reading and writing some data from an Excel file Pin
Simon Yan3-Oct-05 18:14
Simon Yan3-Oct-05 18:14 
AnswerRe: Reading and writing some data from an Excel file Pin
Lane Yu3-Oct-05 19:02
Lane Yu3-Oct-05 19:02 
The following VB code is FYI, you must change it to VC

////////////////////////////////////////////////////////////////

Public Function SheetToArray(strFilename As String, intSheetIndex As Integer, intRows As Integer, intColums As Integer, strArray() As String) As Boolean

'Declare objects

Dim excapp As Excel.Application

Dim excbook As Excel.Workbook

Dim excsheet As Excel.Worksheet

ReDim strArray(1 To intRows, 1 To intColums)

Dim intLoopR As Integer
Dim intLoopC As Integer

'Create objects

Set excapp = CreateObject("Excel.application")

Set excbook = excapp.Workbooks.Open(strFilename)

Set excsheet = excbook.Worksheets(intSheetIndex)


'Read the table and fill the array

For intLoopR = 1 To intRows

For intLoopC = 1 To intColums

strArray(intLoopR, intLoopC) = excsheet.Cells(intLoopR, intLoopC)
'excsheet.Range(excsheet.Cells(1, 1), excsheet.Cells(5, 5)).Select

Next intLoopC

Next intLoopR


'Close Excel

excbook.Close
excapp.Quit


'Clear the objects

Set excapp = Nothing

Set excbook = Nothing

Set excsheet = Nothing

SheetToArray = True

Exit Function

End Function


Lane
China
AnswerRe: Reading and writing some data from an Excel file Pin
David Crow4-Oct-05 3:22
David Crow4-Oct-05 3:22 
Questionlaunching Dev manager Pin
act_x3-Oct-05 12:26
act_x3-Oct-05 12:26 
AnswerRe: launching Dev manager Pin
Prakash Nadar3-Oct-05 15:11
Prakash Nadar3-Oct-05 15:11 
AnswerRe: launching Dev manager Pin
David Crow4-Oct-05 3:31
David Crow4-Oct-05 3:31 
Questionwhat's the difference between them Pin
valerie993-Oct-05 10:31
valerie993-Oct-05 10:31 
AnswerRe: what's the difference between them Pin
Prakash Nadar3-Oct-05 15:13
Prakash Nadar3-Oct-05 15:13 
QuestionSimple question Pin
Alex Cutovoi3-Oct-05 9:09
Alex Cutovoi3-Oct-05 9:09 
AnswerRe: Simple question Pin
David Crow3-Oct-05 9:20
David Crow3-Oct-05 9:20 
GeneralRe: Simple question Pin
Fired Fish3-Oct-05 14:02
Fired Fish3-Oct-05 14:02 
AnswerRe: Simple question Pin
Prakash Nadar3-Oct-05 15:18
Prakash Nadar3-Oct-05 15:18 
GeneralRe: Simple question Pin
Rick York3-Oct-05 16:37
mveRick York3-Oct-05 16:37 
GeneralRe: Simple question Pin
Prakash Nadar3-Oct-05 16:44
Prakash Nadar3-Oct-05 16:44 
Question_beginthread and calling convention __fastcall error Pin
DaviziN3-Oct-05 8:08
DaviziN3-Oct-05 8:08 
QuestionRe: _beginthread and calling convention __fastcall error Pin
David Crow3-Oct-05 9:21
David Crow3-Oct-05 9:21 
AnswerRe: _beginthread and calling convention __fastcall error Pin
Shog93-Oct-05 11:51
sitebuilderShog93-Oct-05 11:51 
GeneralRe: _beginthread and calling convention __fastcall error Pin
DaviziN3-Oct-05 20:53
DaviziN3-Oct-05 20:53 
GeneralRe: _beginthread and calling convention __fastcall error Pin
David Crow4-Oct-05 2:37
David Crow4-Oct-05 2:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.