Inheritance


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 1 of 2 12 LastLast
Results 1 to 15 of 25

Thread: Inheritance

  1. #1
    Alan Dean Guest

    Inheritance

    Hi All,

    Is it true that under VS.NET I will be able to inherit from C++ classes in
    VB, and compile this to a single executable?

    If so, this is VERY cool. We have a load of legacy code in C++ that I want
    to extend as core functionality then leverage through VB for RAD GUI
    development without necessarily having to encapsulate as Static or COM DLLs.

    Regards, Alan Dean



  2. #2
    Michael \(michka\) Kaplan Guest

    Re: Inheritance

    Provided that you convert the C++ code to be managed C++ running under the
    CLR, then yes, you will be able to do this. It is arguable as to whether
    this is more or less work than wrapping them in COM DLLs, though.

    TANSTAAFL, especially in .NET.

    --
    MichKa

    random junk of dubious value at the
    multilingual http://www.trigeminal.com/ and
    a new book on internationalization in VB at
    http://www.i18nWithVB.com/

    "Alan Dean" <adean@hotmail.com> wrote in message
    news:39e5877b@news.devx.com...
    > Hi All,
    >
    > Is it true that under VS.NET I will be able to inherit from C++ classes in
    > VB, and compile this to a single executable?
    >
    > If so, this is VERY cool. We have a load of legacy code in C++ that I want
    > to extend as core functionality then leverage through VB for RAD GUI
    > development without necessarily having to encapsulate as Static or COM

    DLLs.
    >
    > Regards, Alan Dean
    >
    >




  3. #3
    Mattias Sjögren Guest

    Re: Inheritance

    Alan,

    >Is it true that under VS.NET I will be able to inherit from C++ classes in
    >VB, and compile this to a single executable?


    I don't think so. You still have to compile the C++ code with the C++
    compiler and the VB code with the VB compiler, and that will give you
    two executables. They can be part of the same assembly though.


    Matt

    ============================================
    Mattias Sjögren - mattiass @ hem.passagen.se

  4. #4
    Alan Dean Guest

    Re: Inheritance

    Matt,

    So every additional language to VS7 requires it's own compiler?

    Alan

    "Mattias Sjögren" <mattiass.dont.want.spam@hem.passagen.se> wrote in message
    news:39e5aa98.44179336@news.devx.com...
    > Alan,
    >
    > >Is it true that under VS.NET I will be able to inherit from C++ classes

    in
    > >VB, and compile this to a single executable?

    >
    > I don't think so. You still have to compile the C++ code with the C++
    > compiler and the VB code with the VB compiler, and that will give you
    > two executables. They can be part of the same assembly though.
    >
    >
    > Matt
    >
    > ============================================
    > Mattias Sjögren - mattiass @ hem.passagen.se




  5. #5
    Rich Guest

    Re: Inheritance


    "Alan Dean" <adean@hotmail.com> wrote:
    >Matt,
    >
    >So every additional language to VS7 requires it's own compiler?
    >
    >Alan


    At this point, yes.

    Rich

  6. #6
    Michael \(michka\) Kaplan Guest

    Re: Inheritance

    You really see a point where THAT will change? Someone has to understand the
    syntax to move it to a common format.... so I do not see this ever changing
    unless they combine the compilers for marketing reasons.

    Also, these are not the compilers, there are sort of like preprocessors, in
    a way.

    --
    MichKa

    random junk of dubious value at the
    multilingual http://www.trigeminal.com/ and
    a new book on internationalization in VB at
    http://www.i18nWithVB.com/

    "Rich" <Rich@nospam.com> wrote in message news:39e5b783@news.devx.com...
    >
    > "Alan Dean" <adean@hotmail.com> wrote:
    > >Matt,
    > >
    > >So every additional language to VS7 requires it's own compiler?
    > >
    > >Alan

    >
    > At this point, yes.
    >
    > Rich




  7. #7
    Alan Dean Guest

    Re: Inheritance

    I'm not so happy now...

    MS seem to be making so many changes to VB for the sake of interoperability
    of all VS languages (esp. C#) and for inheritance that it seems crazy to
    stop short of permitting full compilation to a single release executable.

    Surely it would be worth the effort to support that. I would understand and
    accept if a contract was enforced at the interface between classes (such as
    maybe saying that only COM-compliant datatypes could be passed and so on).
    Does anyone have an idea what MS plans here?

    Alan

    "Mattias Sjögren" <mattiass.dont.want.spam@hem.passagen.se> wrote in message
    news:39e5aa98.44179336@news.devx.com...
    > Alan,
    >
    > >Is it true that under VS.NET I will be able to inherit from C++ classes

    in
    > >VB, and compile this to a single executable?

    >
    > I don't think so. You still have to compile the C++ code with the C++
    > compiler and the VB code with the VB compiler, and that will give you
    > two executables. They can be part of the same assembly though.
    >
    >
    > Matt
    >
    > ============================================
    > Mattias Sjögren - mattiass @ hem.passagen.se




  8. #8
    Michael \(michka\) Kaplan Guest

    Re: Inheritance

    Alan,

    Reality has to intrude just a bit.... different syntax implies different
    methods to process the code. So how can it be one compiler?

    Maybe one day they will let you combine everything into a single file....
    but if you do not even have to register the files anymore, who really cares
    if there are two files here?

    Why does this matter to you, in other words????

    --
    MichKa

    random junk of dubious value at the
    multilingual http://www.trigeminal.com/ and
    a new book on internationalization in VB at
    http://www.i18nWithVB.com/

    "Alan Dean" <adean@hotmail.com> wrote in message
    news:39e5c2a3@news.devx.com...
    > I'm not so happy now...
    >
    > MS seem to be making so many changes to VB for the sake of

    interoperability
    > of all VS languages (esp. C#) and for inheritance that it seems crazy to
    > stop short of permitting full compilation to a single release executable.
    >
    > Surely it would be worth the effort to support that. I would understand

    and
    > accept if a contract was enforced at the interface between classes (such

    as
    > maybe saying that only COM-compliant datatypes could be passed and so on).
    > Does anyone have an idea what MS plans here?
    >
    > Alan
    >
    > "Mattias Sjögren" <mattiass.dont.want.spam@hem.passagen.se> wrote in

    message
    > news:39e5aa98.44179336@news.devx.com...
    > > Alan,
    > >
    > > >Is it true that under VS.NET I will be able to inherit from C++ classes

    > in
    > > >VB, and compile this to a single executable?

    > >
    > > I don't think so. You still have to compile the C++ code with the C++
    > > compiler and the VB code with the VB compiler, and that will give you
    > > two executables. They can be part of the same assembly though.
    > >
    > >
    > > Matt
    > >
    > > ============================================
    > > Mattias Sjögren - mattiass @ hem.passagen.se

    >
    >




  9. #9
    Alan Dean Guest

    Re: Inheritance

    Michael,

    A perfect example is that we have source provided by our dongle supplier -
    this code is only licensed for C++ and is not portable. At the present we
    have to use a static DLL to provide the functionality to VB. If I could
    compile into a single executable, then the project would be more secure.

    Alan

    "Michael (michka) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com> wrote
    in message news:39e5c453$3@news.devx.com...
    > Alan,
    >
    > Reality has to intrude just a bit.... different syntax implies different
    > methods to process the code. So how can it be one compiler?
    >
    > Maybe one day they will let you combine everything into a single file....
    > but if you do not even have to register the files anymore, who really

    cares
    > if there are two files here?
    >
    > Why does this matter to you, in other words????
    >
    > --
    > MichKa
    >
    > random junk of dubious value at the
    > multilingual http://www.trigeminal.com/ and
    > a new book on internationalization in VB at
    > http://www.i18nWithVB.com/
    >
    > "Alan Dean" <adean@hotmail.com> wrote in message
    > news:39e5c2a3@news.devx.com...
    > > I'm not so happy now...
    > >
    > > MS seem to be making so many changes to VB for the sake of

    > interoperability
    > > of all VS languages (esp. C#) and for inheritance that it seems crazy to
    > > stop short of permitting full compilation to a single release

    executable.
    > >
    > > Surely it would be worth the effort to support that. I would understand

    > and
    > > accept if a contract was enforced at the interface between classes (such

    > as
    > > maybe saying that only COM-compliant datatypes could be passed and so

    on).
    > > Does anyone have an idea what MS plans here?
    > >
    > > Alan
    > >
    > > "Mattias Sjögren" <mattiass.dont.want.spam@hem.passagen.se> wrote in

    > message
    > > news:39e5aa98.44179336@news.devx.com...
    > > > Alan,
    > > >
    > > > >Is it true that under VS.NET I will be able to inherit from C++

    classes
    > > in
    > > > >VB, and compile this to a single executable?
    > > >
    > > > I don't think so. You still have to compile the C++ code with the C++
    > > > compiler and the VB code with the VB compiler, and that will give you
    > > > two executables. They can be part of the same assembly though.
    > > >
    > > >
    > > > Matt
    > > >
    > > > ============================================
    > > > Mattias Sjögren - mattiass @ hem.passagen.se

    > >
    > >

    >
    >




  10. #10
    Michael \(michka\) Kaplan Guest

    Re: Inheritance

    You are assuming that they would not consider this a violation of their
    license? Seems like a gray area to me.

    And the focus does seem a bit off, either way. This stuff is going to be a
    LOT easier to decompile, too.

    --
    MichKa

    random junk of dubious value at the
    multilingual http://www.trigeminal.com/ and
    a new book on internationalization in VB at
    http://www.i18nWithVB.com/

    "Alan Dean" <adean@hotmail.com> wrote in message
    news:39e5c6f1@news.devx.com...
    > Michael,
    >
    > A perfect example is that we have source provided by our dongle supplier -
    > this code is only licensed for C++ and is not portable. At the present we
    > have to use a static DLL to provide the functionality to VB. If I could
    > compile into a single executable, then the project would be more secure.
    >
    > Alan
    >
    > "Michael (michka) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com>

    wrote
    > in message news:39e5c453$3@news.devx.com...
    > > Alan,
    > >
    > > Reality has to intrude just a bit.... different syntax implies different
    > > methods to process the code. So how can it be one compiler?
    > >
    > > Maybe one day they will let you combine everything into a single

    file....
    > > but if you do not even have to register the files anymore, who really

    > cares
    > > if there are two files here?
    > >
    > > Why does this matter to you, in other words????
    > >
    > > --
    > > MichKa
    > >
    > > random junk of dubious value at the
    > > multilingual http://www.trigeminal.com/ and
    > > a new book on internationalization in VB at
    > > http://www.i18nWithVB.com/
    > >
    > > "Alan Dean" <adean@hotmail.com> wrote in message
    > > news:39e5c2a3@news.devx.com...
    > > > I'm not so happy now...
    > > >
    > > > MS seem to be making so many changes to VB for the sake of

    > > interoperability
    > > > of all VS languages (esp. C#) and for inheritance that it seems crazy

    to
    > > > stop short of permitting full compilation to a single release

    > executable.
    > > >
    > > > Surely it would be worth the effort to support that. I would

    understand
    > > and
    > > > accept if a contract was enforced at the interface between classes

    (such
    > > as
    > > > maybe saying that only COM-compliant datatypes could be passed and so

    > on).
    > > > Does anyone have an idea what MS plans here?
    > > >
    > > > Alan
    > > >
    > > > "Mattias Sjögren" <mattiass.dont.want.spam@hem.passagen.se> wrote in

    > > message
    > > > news:39e5aa98.44179336@news.devx.com...
    > > > > Alan,
    > > > >
    > > > > >Is it true that under VS.NET I will be able to inherit from C++

    > classes
    > > > in
    > > > > >VB, and compile this to a single executable?
    > > > >
    > > > > I don't think so. You still have to compile the C++ code with the

    C++
    > > > > compiler and the VB code with the VB compiler, and that will give

    you
    > > > > two executables. They can be part of the same assembly though.
    > > > >
    > > > >
    > > > > Matt
    > > > >
    > > > > ============================================
    > > > > Mattias Sjögren - mattiass @ hem.passagen.se
    > > >
    > > >

    > >
    > >

    >
    >




  11. #11
    Karl E. Peterson Guest

    Re: Inheritance

    That _used_ to be the job of a linker, not a compiler. HTH!
    --
    http://www.mvps.org/vb


    "Michael (michka) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com> wrote in
    message news:39e5c453$3@news.devx.com...
    > Alan,
    >
    > Reality has to intrude just a bit.... different syntax implies different
    > methods to process the code. So how can it be one compiler?
    >
    > Maybe one day they will let you combine everything into a single file....
    > but if you do not even have to register the files anymore, who really cares
    > if there are two files here?
    >
    > Why does this matter to you, in other words????
    >
    > --
    > MichKa
    >
    > random junk of dubious value at the
    > multilingual http://www.trigeminal.com/ and
    > a new book on internationalization in VB at
    > http://www.i18nWithVB.com/
    >
    > "Alan Dean" <adean@hotmail.com> wrote in message
    > news:39e5c2a3@news.devx.com...
    > > I'm not so happy now...
    > >
    > > MS seem to be making so many changes to VB for the sake of

    > interoperability
    > > of all VS languages (esp. C#) and for inheritance that it seems crazy to
    > > stop short of permitting full compilation to a single release executable.
    > >
    > > Surely it would be worth the effort to support that. I would understand

    > and
    > > accept if a contract was enforced at the interface between classes (such

    > as
    > > maybe saying that only COM-compliant datatypes could be passed and so on).
    > > Does anyone have an idea what MS plans here?
    > >
    > > Alan
    > >
    > > "Mattias Sjögren" <mattiass.dont.want.spam@hem.passagen.se> wrote in

    > message
    > > news:39e5aa98.44179336@news.devx.com...
    > > > Alan,
    > > >
    > > > >Is it true that under VS.NET I will be able to inherit from C++ classes

    > > in
    > > > >VB, and compile this to a single executable?
    > > >
    > > > I don't think so. You still have to compile the C++ code with the C++
    > > > compiler and the VB code with the VB compiler, and that will give you
    > > > two executables. They can be part of the same assembly though.
    > > >
    > > >
    > > > Matt
    > > >
    > > > ============================================
    > > > Mattias Sjögren - mattiass @ hem.passagen.se

    > >
    > >

    >
    >




  12. #12
    Michael \(michka\) Kaplan Guest

    Re: Inheritance

    Actually, the thing that is doing all the work to take VB vs. C# vs. C++ is
    neither, its more of a pre-processing compiler? :-)

    I did not see the point of adding the complexities of compiler theory,
    although we could do that if someone really needed it. Since the question
    was from someone who was asking about how to do an "all in one" solution, I
    figured it was not really worth it....

    --
    MichKa

    random junk of dubious value at the
    multilingual http://www.trigeminal.com/ and
    a new book on internationalization in VB at
    http://www.i18nWithVB.com/

    "Karl E. Peterson" <karl@mvps.org> wrote in message
    news:39e5dadc$1@news.devx.com...
    > That _used_ to be the job of a linker, not a compiler. HTH!
    > --
    > http://www.mvps.org/vb
    >
    >
    > "Michael (michka) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com>

    wrote in
    > message news:39e5c453$3@news.devx.com...
    > > Alan,
    > >
    > > Reality has to intrude just a bit.... different syntax implies different
    > > methods to process the code. So how can it be one compiler?
    > >
    > > Maybe one day they will let you combine everything into a single

    file....
    > > but if you do not even have to register the files anymore, who really

    cares
    > > if there are two files here?
    > >
    > > Why does this matter to you, in other words????
    > >
    > > --
    > > MichKa
    > >
    > > random junk of dubious value at the
    > > multilingual http://www.trigeminal.com/ and
    > > a new book on internationalization in VB at
    > > http://www.i18nWithVB.com/
    > >
    > > "Alan Dean" <adean@hotmail.com> wrote in message
    > > news:39e5c2a3@news.devx.com...
    > > > I'm not so happy now...
    > > >
    > > > MS seem to be making so many changes to VB for the sake of

    > > interoperability
    > > > of all VS languages (esp. C#) and for inheritance that it seems crazy

    to
    > > > stop short of permitting full compilation to a single release

    executable.
    > > >
    > > > Surely it would be worth the effort to support that. I would

    understand
    > > and
    > > > accept if a contract was enforced at the interface between classes

    (such
    > > as
    > > > maybe saying that only COM-compliant datatypes could be passed and so

    on).
    > > > Does anyone have an idea what MS plans here?
    > > >
    > > > Alan
    > > >
    > > > "Mattias Sjögren" <mattiass.dont.want.spam@hem.passagen.se> wrote in

    > > message
    > > > news:39e5aa98.44179336@news.devx.com...
    > > > > Alan,
    > > > >
    > > > > >Is it true that under VS.NET I will be able to inherit from C++

    classes
    > > > in
    > > > > >VB, and compile this to a single executable?
    > > > >
    > > > > I don't think so. You still have to compile the C++ code with the

    C++
    > > > > compiler and the VB code with the VB compiler, and that will give

    you
    > > > > two executables. They can be part of the same assembly though.
    > > > >
    > > > >
    > > > > Matt
    > > > >
    > > > > ============================================
    > > > > Mattias Sjögren - mattiass @ hem.passagen.se
    > > >
    > > >

    > >
    > >

    >
    >




  13. #13
    Rich Guest

    Re: Inheritance


    Whatever you want to call the "passes" or "stages" was irrelevant to the question.
    It was the following:

    >>So every additional language to VS7 requires it's own compiler?


    Whether you want to call it compiler, linker or interpreter/VM, the answer
    is still yes. If you check the installation, there are the files csc.exe
    for C# and vbc.exe for VB.NET. Hence, they are different...

    Rich

    --------------------------------------------------------------
    "Michael \(michka\) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com> wrote:
    >You really see a point where THAT will change? Someone has to understand

    the
    >syntax to move it to a common format.... so I do not see this ever changing
    >unless they combine the compilers for marketing reasons.
    >
    >Also, these are not the compilers, there are sort of like preprocessors,

    in
    >a way.
    >
    >--
    >MichKa
    >
    >random junk of dubious value at the
    >multilingual http://www.trigeminal.com/ and
    >a new book on internationalization in VB at
    >http://www.i18nWithVB.com/
    >
    >"Rich" <Rich@nospam.com> wrote in message news:39e5b783@news.devx.com...
    >>
    >> "Alan Dean" <adean@hotmail.com> wrote:
    >> >Matt,
    >> >
    >> >So every additional language to VS7 requires it's own compiler?
    >> >
    >> >Alan

    >>
    >> At this point, yes.
    >>
    >> Rich

    >
    >



  14. #14
    Jeff Peil Guest

    Re: Inheritance


    "Michael (michka) Kaplan" <former_mvp@spamfree.trigeminal.nospam.com> wrote
    in message news:39e5bf59@news.devx.com...
    > You really see a point where THAT will change? Someone has to understand

    the
    > syntax to move it to a common format.... so I do not see this ever

    changing
    > unless they combine the compilers for marketing reasons.
    >
    > Also, these are not the compilers, there are sort of like preprocessors,

    in
    > a way.


    People have debated in the past about CFront, is it a preprocessor, or a
    compiler. I'm in the compiler camp, just because a compiler targets a
    format that is then compiled again, that doesn't in my view fundamentally
    make it a preprocessor.

    When VB's compiler emitted p-code did you consider it a preprocessor and not
    a compiler? What if someone wrote a p-code to native code JIT compiler that
    would do persistent caching, would that change your viewpoint?

    What if someone created an implemented of the CLR that operated as an
    interpreter, and didn't support JITing?



  15. #15
    Bob O`Bob Guest

    Re: Inheritance

    Michael (michka) Kaplan wrote:
    >
    > You really see a point where THAT will change? Someone has to understand the
    > syntax to move it to a common format.... so I do not see this ever changing
    > unless they combine the compilers for marketing reasons.


    Actually I'm *certain* that it will happen eventually.
    It's analogous to a linker, at the IL level.

    >
    > Also, these are not the compilers, there are sort of like preprocessors, in
    > a way.



    Who cares what it gets called?



    Bob O`Bob
    --
    Watch for my new book, "Just The Only Complete Dummy's Hardcore Fast Track Pure
    Teach Yourself Guide to Mastering Advanced Essential Core Hands-On Step-by-Step
    Unleashed in 24 Hours, Special Edition, Gold, You'll ever Need Bible"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center