| | |
Rename variables in .dll to manipulate excel files???
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2009
Posts: 2
Reputation:
Solved Threads: 0
Hey, I've been researching ways to code in C++ and manipulate excel files (i.e. read and write data). Right now I've written macros in VBA that output a .csv file that is read by my C++ program. It all works, but I'm still wondering if I can just write all my code in C++.
My question is concerning some code that I found that claims to allow manipulation of Excel using C++. The problem with the code (as far as I can tell) is that the program tries to open a .dll file and rename variables in the .dll file. From what I've read, .dll's are binary and can't be edited like a simple text file.
The full code start on page 62 of this pdf: http://www.maths.manchester.ac.uk/~ahazel/EXCEL_C++.pdf
I think the code is flawed in trying to rename variables in the .dll, which it can't do since .dll's are in binary. I don't really know, though. Here's the code that won't compile:
Any ideas? Thanks.
My question is concerning some code that I found that claims to allow manipulation of Excel using C++. The problem with the code (as far as I can tell) is that the program tries to open a .dll file and rename variables in the .dll file. From what I've read, .dll's are binary and can't be edited like a simple text file.
The full code start on page 62 of this pdf: http://www.maths.manchester.ac.uk/~ahazel/EXCEL_C++.pdf
I think the code is flawed in trying to rename variables in the .dll, which it can't do since .dll's are in binary. I don't really know, though. Here's the code that won't compile:
C++ Syntax (Toggle Plain Text)
#import \ "C:\Program Files\Common Files\Microsoft Shared\OFFICE11\mso.dll" \ rename("DocumentProperties", "DocumentPropertiesXL") \ rename("RGB", "RBGXL")
Any ideas? Thanks.
•
•
Join Date: Aug 2008
Posts: 83
Reputation:
Solved Threads: 18
Take a look at http://msdn.microsoft.com/en-us/libr...b6(VS.71).aspx. The rename attribute doesn't actually rename anything within the DLL, it simply gives an alias for any property to avoid naming conflicts.
•
•
Join Date: Jul 2009
Posts: 2
Reputation:
Solved Threads: 0
I guess I don't really know why I'm getting any errors, then. I'm using Dev-C++, and the compiler is giving me a number of errors (a few are listed below).
I don't really know what to make of them. When I double click them so that I can see where the error is, it opens mso.dll and shows me where the error is. The reason I thought the problem was that the .dll file is in binary and the compiler can't read it is because I'm looking at mso.dll and all I see are squares and other meaningless symbols. I think I read on the msdn site that the import directive creates a primary and secondary header file -- shouldn't this be where the renaming is occurring?
Here are some of the errors that I am receiving from the code I listed in my first post:
7:1 C:\Crane Program\Testing.cpp [Warning] extra tokens at end of #import directive
8 C:\Crane Program\Testing.cpp In file included from C:\Crane Program\Testing.cpp
1 C:\Program Files\Common Files\Microsoft Shared\OFFICE11\mso.dll stray '\144' in program
8 C:\Crane Program\Testing.cpp In file included from C:\Crane Program\Testing.cpp
1:4 C:\Program Files\Common Files\Microsoft Shared\OFFICE11\mso.dll [Warning] null character(s) ignored
1 C:\Program Files\Common Files\Microsoft Shared\OFFICE11\mso.dll stray '\3' in program
I don't really know what to make of them. When I double click them so that I can see where the error is, it opens mso.dll and shows me where the error is. The reason I thought the problem was that the .dll file is in binary and the compiler can't read it is because I'm looking at mso.dll and all I see are squares and other meaningless symbols. I think I read on the msdn site that the import directive creates a primary and secondary header file -- shouldn't this be where the renaming is occurring?
Here are some of the errors that I am receiving from the code I listed in my first post:
7:1 C:\Crane Program\Testing.cpp [Warning] extra tokens at end of #import directive
8 C:\Crane Program\Testing.cpp In file included from C:\Crane Program\Testing.cpp
1 C:\Program Files\Common Files\Microsoft Shared\OFFICE11\mso.dll stray '\144' in program
8 C:\Crane Program\Testing.cpp In file included from C:\Crane Program\Testing.cpp
1:4 C:\Program Files\Common Files\Microsoft Shared\OFFICE11\mso.dll [Warning] null character(s) ignored
1 C:\Program Files\Common Files\Microsoft Shared\OFFICE11\mso.dll stray '\3' in program
![]() |
Similar Threads
- retreive data from excel files (C++)
- Cannot open Excel Files anymore!! (Windows NT / 2000 / XP)
- Manipulate Excel file using C++?? (C++)
- Opening several excel files in one window (Visual Basic 4 / 5 / 6)
- Batch file in ASP.Net to convert Excel files into higher version (ASP.NET)
Other Threads in the C++ Forum
- Previous Thread: Adding Menu to windows dialog created with DialogBox()
- Next Thread: Template question
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count data database delete deploy developer dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game getline givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings struct temperature template text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





