|
|
Hi all.
I'm using unmanaged C++ MFC application. And I need to get Excel interfaces. As I know I need to import TypeLib using MFC wizzard. Wizzard is creating a header, excel.tlh and excel.tli files. When i start to compile project, there is 100's of errors in excel.tlh.
So the question is: what i've done improperly? May be I need to include additional libraries and headers (tried to include ole.h and ole32.lib). May be someone know some articles, where I can find information about it?
Thank's a lot
|
|
|
|
|
|
Unknown identifiers, syntax errors, type redefenitions.
I tried do the same for MapInfo - it works.
I found articles about excel and it doesnt works, may be my excel is corrupted?
|
|
|
|
|
progDes wrote: As I know I need to import TypeLib using MFC wizzard.
Which type library did you use?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
im using Excel 11 or 10 typelib (TLB), which is in Excel.exe file
|
|
|
|
|
I just did the same thing (I'm using Excel 2003 whose type library comes from excel.exe) and it works fine. The only files that were created are excel.h and excel.cpp .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The TLH and TLI files creating during compilation when #import is executing. I found step by step microsoft sample, but it doesnt works (at home and on work both Office 2003). What VS do you using. I saw that earlier VS creating h and cpp files, but my VS2005 create only .h
|
|
|
|
|
progDes wrote: What VS do you using.
I am using VS6.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
That's the point. Now i'm thinking about finding Excel 5.0 or 9.0 library, may be it can work. I think, i just have bad office on two computers, installed from 1 CD
|
|
|
|
|
progDes wrote: I think, i just have bad office on two computers...
Can you try using the "bad" type library with VB?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yes and its works in VB in managed C++ in C#, and even 5.0 library doesnt work in C++.
Something wrong here, what can I do improperly?
|
|
|
|
|
OK, I'll try to list my actions.
1) Creating a ialog based MFC application (other parameters is by default)
2) Add->Class->MFC class from TypeLib
The window contains library list and list of classes that can be created.
3) Selecting the _Application class (only 1 for example) and header is CApplication.h
4) OK
5) Run (it works)
6) Include CApplication.h into any file
7) Run (100's of error)
in the top of the header there is #import directive. I've reduced error count by changing attributes of it. So, can you list me your attributes, please?
-- modified at 11:20 Tuesday 12th June, 2007
|
|
|
|
|
Ha-Ha!!!
Here is the answer.
Need to comment the line in header file
#import "C:\\Program Files\\Microsoft Office\\OFFICE11\\EXCEL.EXE" no_namespace
I dont know why, but when i've commented it the code began work
|
|
|
|
|
Hello,
Suddenly my project has started giving me error saying a certain .bsr file doesnot exist.I rebuild the project but in vain.
DO I need to make another project or I can do something with the existing project.
Thanks
Pritha
|
|
|
|
|
prithaa wrote: uddenly my project has started giving me error saying a certain .bsr file doesnot exist.
isa it bsr or bsc
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I believe these are browsing symbols. I always disable them as they add a significant amount to the compile time and I rarely used them when they were activated.
John
|
|
|
|
|
Hello,
The file is .bsr file.And I get error saying .bsr file doesnot exist.Should I make another project or there is some way to correct the error
Thanks
Pritha
|
|
|
|
|
I am sorry, I got that confused with a .bsc file which is the symbols file. I would just create a new project and put your project files in it.
John
|
|
|
|
|
Hello,
Thanks
I did that I just wanted to confirm.
Pritha
|
|
|
|
|
Hello,
If I have a menu with 4 menu options and I want to attach a popup menu to one of the menu options then is it possible ?
I have tried ModifyMenu() function with MF_POPUP parameter but it did not work.When I want to change the string with MF_STRING parameter I am able to do it.
Thanks
Pritha
|
|
|
|
|
|
Hello,
Thanks for your reply
I have the following code
CMenu M;
M.CreateMenu
M.AppendMenu(MF_STRING, id_DAta, "Data");
M.AppendMenu(MF_STRING, id_Edit, "Edit");
M.AppendMenu(MF_STRING, id_Model, "Model");
Now the above code works.
How should I have popup menu like the following attached to Data. I do not want to add to the 3 menu options above
CMenu M1;
M1.CreatePopupMenu
M1.AppendMenu(MF_STRING, id_Data1, "Data1");
M1.AppendMenu(MF_STRING, id_Data2, "Data2");
M1.AppendMenu(MF_STRING, id_Data3, "Data3");
Thanks
Prithaa
|
|
|
|
|
|