Serving the Quantitative Finance Community

 
User avatar
robbie
Topic Author
Posts: 1
Joined: November 1st, 2002, 1:16 pm

excel dll on vista 64 bits using vs 2008

March 20th, 2009, 8:07 am

Dear all,I have for some years created excel add-ins using VC++6 on a 32 bits XP machine (I do not know much about dlls though, basically following a by-heart learned recipe). I have now bought a new machine which has 64 bits Vista and also upgraded to vs 2008.Unfortunately I have now problems with creating dlls. I cannot manage to transfer my old code or creating a new very simple one from scratch that works properly. I have actually managed to create a dll that seem to do what I want, but then I cannot debug it, instead I get the error message"Debugging information for 'EXCEL.EXE' cannot be found or does not match. Symbols not loaded."If I choose to continue EXCEL loads but does not stop at my breakpoints.My questions are hence:1. Anyone that are aware of how I can fix this?2. Anyone that are aware of a good tutorial about dlls using my system.Help is very much appreciated!!p.s. I have posted questions related to this in another thread, but I thought I'd start a new one to get the information more streamlined.ps
 
User avatar
untwigged
Posts: 2
Joined: January 14th, 2006, 3:21 pm

excel dll on vista 64 bits using vs 2008

March 20th, 2009, 12:23 pm

The "Debugging information for 'EXCEL.EXE' ..." message is fine, that means you do not have the source to Excel on your machine. You are only interested in debugging the dllAre you sure you are building in Debug mode? When you start debugging, if you look at the output window, does Visual studio say it has loaded symbols for your DLL? You should see something like'excel.exe': Loaded 'C:\...my.dll', Symbols loaded.Does this path match where you are building your DLL?
 
User avatar
robbie
Topic Author
Posts: 1
Joined: November 1st, 2002, 1:16 pm

excel dll on vista 64 bits using vs 2008

March 20th, 2009, 4:13 pm

Many thanks for your help!Let me tell you what I have done (warning that this post is a bit long). I have tried several ways due to sources found through google etc, but the main denominator is that I do not manage to debug any of them.I attach a zipped folder containing the following project which is an attempt to copy as much of the stuff I know from vc6 as possible. My system is VS 2008 and Vista 64 bits. As I have understood it Excel is however 32 bits so I cannot write 64 bits dll (?). This is what I did:1. I created a new project of type ATL project.2. Dynamics link library as server type.3. To this project I added a new class of type ATL Simple Object. Name: someMathThreading model: ApartmentAggregation: YesInterface: DualNo support alternatives ticked. (i.e. I did not change any of the already set options.)4. To this ATL class (under “IsomeMath”) I added a new method called multiply (takes two doubles as [in] and returns a double pointer as [out]. The method simply multiplies the two doubles.5. I then compiled under Debug-Win32 after having changed the following under project->properties:Configuration properties -> MIDL ->General->Target Environment: Microsoft Windows 64-bit on X64.Configuration properties ->Linker->Per-user redirection: YES. (if I do not do this I get a registration error).Configuration properties ->Linker->Advanced->Target Machine: MachineX86 (this was already there and I hence did not change it).6. I now built the solution and the hit Start Debugging. After having specified the link to excel I got the error message:“Debugging information for 'EXCEL.EXE' cannot be found or does not match. Symbols not loaded."7. I then instead choose “Start without debugging” and excel opens. I added a VBA module with a sub and through Tools->References I found the dll and managed to run the multiply routine which seemed to work.In summary: It seems like I have managed to link my dll with excel and get the the dll to run. I still however cannot debug it. Any ideas about what could be the problem? Help is greatly appreciated!
Attachments
dllTest1.zip
(30.65 KiB) Downloaded 72 times
 
User avatar
robbie
Topic Author
Posts: 1
Joined: November 1st, 2002, 1:16 pm

excel dll on vista 64 bits using vs 2008

March 20th, 2009, 4:16 pm

QuoteOriginally posted by: untwiggedThe "Debugging information for 'EXCEL.EXE' ..." message is fine, that means you do not have the source to Excel on your machine. You are only interested in debugging the dllAre you sure you are building in Debug mode? When you start debugging, if you look at the output window, does Visual studio say it has loaded symbols for your DLL? You should see something like'excel.exe': Loaded 'C:\...my.dll', Symbols loaded.Does this path match where you are building your DLL?To answer your a bit more precis question: There are lots of lines like "'excel.exe': Loaded ...dll", but there is none that actually loads my dll..
Last edited by robbie on March 19th, 2009, 11:00 pm, edited 1 time in total.
 
User avatar
untwigged
Posts: 2
Joined: January 14th, 2006, 3:21 pm

excel dll on vista 64 bits using vs 2008

March 20th, 2009, 4:25 pm

After you get to step 6, whilst still in the debugger, if you go tools->references, and find your DLL, and add it, does that all work ok? Does the output window show your DLL loaded then?
 
User avatar
robbie
Topic Author
Posts: 1
Joined: November 1st, 2002, 1:16 pm

excel dll on vista 64 bits using vs 2008

March 23rd, 2009, 12:31 pm

QuoteOriginally posted by: untwiggedAfter you get to step 6, whilst still in the debugger, if you go tools->references, and find your DLL, and add it, does that all work ok? Does the output window show your DLL loaded then?Many thanks for your help! It actually works now, I simply needed to ignore the error message and then (as you wrote) when I add/run the dll then it automatically links the dll and I manage to debug. I did test this in an earlier test project when I got the same errors message and then it didn't work (I probably did something else wrong) and I therefore thought that if I had this error message then it wouldn't work.Great!Back to work..