Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I have written a .NET class library (using Visual C++ 2005 and old syntax) which is exposed to VB6 via COM Interop. The assembly works quite satisfactorily. I recently decided to enhance it by documenting all classes and class members; this is done by qualifying items with a Description attribute, like:
C#
[Description("This is my class")]
public __gc class MyClass
{
    [Description("This is the constructor")]
    MyClass();
}

These helpstrings are well recognized and displayed by the Object Browser in Visual C++. They are also retrieved by the Object Browser in VB6.

But there is a but: the trick does not work for properties.
C#
[Description("This is my property")]
__property void set_Value(int Value);
__property int get_Value();

does not let the description appear in the Object Browser of VB6. Repeating the description for the getter does not help.

I have found several posts giving a solution in C#:
C#
int Value
{
    [Description("This is my property")]
    set;
    [Description("This is my property")]
    get;
}

I tried different ways, but I couldn't find an equivalent syntactic trick in C++.

Has anyone solved this ?
Posted
Updated 22-Apr-13 12:23pm
v3
Comments
Sergey Alexandrovich Kryukov 22-Apr-13 18:45pm    
Why, why, if you already develop in .NET, export anything as COM, ever? To provide it to a VB6 application? Why do you think VB6 even exists? Want to waste your time for nothing?
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900