Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7675967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:05:29+00:00 2026-05-31T17:05:29+00:00

The problem is, I have a DLL and TLB that I created in C#.NET,

  • 0

The problem is, I have a DLL and TLB that I created in C#.NET, made it COM visible and wanted to expose the functions to my MFC C++ project – I made a test class first and it worked correctly, and didn’t get any errors from C++’s generated tlh. Now the actual DLL I want to use is giving me the following compilation errors:

error C2059: syntax error : '<'
error C2238: unexpected token(s) preceding ';'
error C2059: syntax error : '<'
error C2238: unexpected token(s) preceding ';'
error C2059: syntax error : '<'
error C2238: unexpected token(s) preceding ';'

From the following C++ generated tlh file:

//
// Type library items
//

struct __declspec(uuid("d6b19eb0-56bf-3c30-9f3a-ebafca303996"))
Class1;
// [ default ] interface _Class1
// interface _Object

struct __declspec(uuid("a7e7ae20-5fb3-3c3f-a9fb-1fac0128dea1"))
IProtracReader : IDispatch
{}

struct TagReadEvent
{
__int64 <Index>k__BackingField;     <<< These three lines are where the errors are.
__int64 <TagID>k__BackingField;
DATE <EventMoment>k__BackingField;
};

Does anyone know why the compiler is generating this file thats giving me errors? Any help is GREATLY appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T17:05:31+00:00Added an answer on May 31, 2026 at 5:05 pm

    These are fields that are generated by the C# compiler when you use automatic properties. Like:

    [ComVisible(true)]
    public class TagReadEvent {
        public long Index { get; set; }
        // etc...
    }
    

    You ought to go back and fix the C# code. Also use interfaces and keep classes/structs as [ClassInterface(ClassInterfaceType.None)] so that none of the implementation is exposed. The COM way. If you can’t then you can use the exclude attribute in the #import directive to skip the troublemakers. Like:

    #import "something.dll" exclude("TagReadEvent")
    

    The rename attribute can fix it too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my problem: I have an unmanaged dll that I made.I'm calling one of
I have problem in project i have dll, when i use function open show
Here is my dilemma: The Problem I have SubProgram (a DLL) that uses System.Data.SQLite
Here's my problem: I have an object that's referencing a DLL. I would like
I have a dll-type project that contains MSTest integration tests. On my machine the
I have a .NET dll which has some interfaces\classes which are exposed to com.
I have a simple COM dll with a method that takes two strings. In
I have a dll that contains a dot net assembly - common intermediate language.
The Problem: I have a forms project which instantiates a class that is defined
Problem: Have made a small mail program which works perfectly on my developer pc

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.