tli file syntax errors

Posted on 2004-12-01
Last Modified: 2008-02-01
I have a C++ file and it imports from a C# library like this:

#import "myLib.tlb"
using namespace myLib;

When I compile I get tons of syntx errors in the tli file - this is a file that is automatically generated right?

error C2059: syntax error : '::'
error C2059: syntax error : 'constant'
error C2143: syntax error : missing ';' before '::'
error C2143: syntax error : missing ';' before '{'
error C2238: unexpected token(s) preceding ';'
error C2447: '{' : missing function header (old-style formal list?)
error C2589: 'constant' : illegal token on right side of '::'
warning C4091: 'inline ' : ignored on left of 'long' when no variable is declared
warning C4278: 'WM_USER': identifier in type library 'myLib.tlb' is already a macro; use the 'rename' qualifier

any ideas?
Question by:emily_hall
    LVL 20

    Expert Comment

    sounds like a c# - question, you better ask it in the c# - area ....
    LVL 1

    Author Comment

    My automatically generated C++ code is what is not compiling.  Using my C# library from my other application which is in VB.NET has never given me any problems.

    I think the problem lies with the way I import the library in C++...


    LVL 1

    Author Comment

    I found the problem - had a function called WM_USER() in the C# library which C++ did not like.  Changed the name and all is well.

    Accepted Solution

    Closed, 250 points refunded.
    Community Support Moderator

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
      Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
    The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
    The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now