Rename variables in .dll to manipulate excel files???

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2009
Posts: 2
Reputation: timbuck2 is an unknown quantity at this point 
Solved Threads: 0
timbuck2 timbuck2 is offline Offline
Newbie Poster

Rename variables in .dll to manipulate excel files???

 
0
  #1
Jul 28th, 2009
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:

  1. #import \
  2. "C:\Program Files\Common Files\Microsoft Shared\OFFICE11\mso.dll" \
  3. rename("DocumentProperties", "DocumentPropertiesXL") \
  4. rename("RGB", "RBGXL")

Any ideas? Thanks.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 83
Reputation: nmaillet is an unknown quantity at this point 
Solved Threads: 18
nmaillet nmaillet is offline Offline
Junior Poster in Training

Re: Rename variables in .dll to manipulate excel files???

 
0
  #2
Jul 28th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 2
Reputation: timbuck2 is an unknown quantity at this point 
Solved Threads: 0
timbuck2 timbuck2 is offline Offline
Newbie Poster

Re: Rename variables in .dll to manipulate excel files???

 
0
  #3
Jul 28th, 2009
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC