combining managed and unmanaged (for the 100th time)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • New World Order Pigs

    combining managed and unmanaged (for the 100th time)

    Sorry if this is the wrong group, but it seems like a good place to start.
    I have a control, creating a dll written in c#/.net and some unmanaged code
    in c++ using embedded c++ V3. Yes, it is for PPC2002/PPC2003 but I don't
    believe that's the significant issue. My question is, can I create a
    solution that wraps the c++ in c# and combine that with the c# control and
    if so, is this the best way to combine these two elements? I'm not going to
    post this elsewhere and hope people can look past the PPC issues since I
    don't believe they matter at all here.

    Thanks for any assistance,
    NWOP.


  • Richard Burte

    #2
    Re: combining managed and unmanaged (for the 100th time)

    6.1. How do I call a function that is in a native DLL?

    Native DLL functions can be called through Platform Invoke (P/Invoke):

    Learn how to use the Platform Invoke (P/Invoke) feature of the .NET Compact
    Framework.

    Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.


    Explore advanced interoperabilit y on the .NET Compact Framework.

    Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.


    Learn how to create unmanaged functions that you can use in your Smart
    Device applications through Platform Invoke.

    Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.


    Learn how to marshal data between managed and unmanaged code using the .NET
    Compact Framework.

    Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.


    Learn how to use dumpbin.exe as an aid for declaring P/Invokes in Microsoft
    ..NET Compact Framework-based applications.

    Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.




    "New World Order Pigs" <lthompson@md-it.com.no.spam> wrote in message
    news:#18u#x1kDH A.1800@TK2MSFTN GP10.phx.gbl...[color=blue]
    > Sorry if this is the wrong group, but it seems like a good place to start.
    > I have a control, creating a dll written in c#/.net and some unmanaged[/color]
    code[color=blue]
    > in c++ using embedded c++ V3. Yes, it is for PPC2002/PPC2003 but I don't
    > believe that's the significant issue. My question is, can I create a
    > solution that wraps the c++ in c# and combine that with the c# control and
    > if so, is this the best way to combine these two elements? I'm not going[/color]
    to[color=blue]
    > post this elsewhere and hope people can look past the PPC issues since I
    > don't believe they matter at all here.
    >
    > Thanks for any assistance,
    > NWOP.
    >
    >[/color]


    Comment

    • New World Order Pigs

      #3
      Re: combining managed and unmanaged (for the 100th time)

      Thanks Richard. Some of these things I've looked at but one thing always
      seems to be missing-- I'm using an unmanaged c++ app to use a control (dll
      ultimately) written with c#/.net. My understanding is that managed code is
      interpreted and needs the runtime and as such, how do I take an unmanaged
      app and invoke managed code. Most of what I read is in the other direction
      and doesn't apply, at least directly and obviously. In any case, I'll look
      at these to see if I can gleen the info I need.

      Thanks again, NWOP.

      "Richard Burte" <rburte@online. microsoft.com> wrote in message
      news:#ANCaBClDH A.1708@TK2MSFTN GP12.phx.gbl...[color=blue]
      > 6.1. How do I call a function that is in a native DLL?
      >
      > Native DLL functions can be called through Platform Invoke (P/Invoke):
      >
      > Learn how to use the Platform Invoke (P/Invoke) feature of the .NET[/color]
      Compact[color=blue]
      > Framework.
      >
      >[/color]
      http://msdn.microsoft.com/library/en...ntrointerp.asp[color=blue]
      >
      > Explore advanced interoperabilit y on the .NET Compact Framework.
      >
      > http://msdn.microsoft.com/library/en...advinterop.asp
      >
      > Learn how to create unmanaged functions that you can use in your Smart
      > Device applications through Platform Invoke.
      >
      > http://msdn.microsoft.com/library/en...nagedfuncs.asp
      >
      > Learn how to marshal data between managed and unmanaged code using the[/color]
      ..NET[color=blue]
      > Compact Framework.
      >
      >[/color]
      Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.

      ..asp[color=blue]
      >
      > Learn how to use dumpbin.exe as an aid for declaring P/Invokes in[/color]
      Microsoft[color=blue]
      > .NET Compact Framework-based applications.
      >
      >[/color]
      Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.

      sp[color=blue]
      >
      >
      >
      > "New World Order Pigs" <lthompson@md-it.com.no.spam> wrote in message
      > news:#18u#x1kDH A.1800@TK2MSFTN GP10.phx.gbl...[color=green]
      > > Sorry if this is the wrong group, but it seems like a good place to[/color][/color]
      start.[color=blue][color=green]
      > > I have a control, creating a dll written in c#/.net and some unmanaged[/color]
      > code[color=green]
      > > in c++ using embedded c++ V3. Yes, it is for PPC2002/PPC2003 but I[/color][/color]
      don't[color=blue][color=green]
      > > believe that's the significant issue. My question is, can I create a
      > > solution that wraps the c++ in c# and combine that with the c# control[/color][/color]
      and[color=blue][color=green]
      > > if so, is this the best way to combine these two elements? I'm not[/color][/color]
      going[color=blue]
      > to[color=green]
      > > post this elsewhere and hope people can look past the PPC issues since I
      > > don't believe they matter at all here.
      > >
      > > Thanks for any assistance,
      > > NWOP.
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • New World Order Pigs

        #4
        Re: combining managed and unmanaged (for the 100th time)

        Yes, after looking at the articles they don't apply really. I've used
        pinvoke a number of times previously and it just doesn't apply. I can't
        "pinvoke" an entire application and then somehow design a managed control
        into that application. I literally have a managed control that needs to be
        put on an unmanaged form in an unmanaged application. I've seen some
        references to doing this, but none of them are satisfactory and I'm looking
        for a better way.

        Thanks to any and all, NWOP.

        "New World Order Pigs" <lthompson@md-it.com.no.spam> wrote in message
        news:OJD48nClDH A.2404@TK2MSFTN GP12.phx.gbl...[color=blue]
        > Thanks Richard. Some of these things I've looked at but one thing always
        > seems to be missing-- I'm using an unmanaged c++ app to use a control (dll
        > ultimately) written with c#/.net. My understanding is that managed code[/color]
        is[color=blue]
        > interpreted and needs the runtime and as such, how do I take an unmanaged
        > app and invoke managed code. Most of what I read is in the other[/color]
        direction[color=blue]
        > and doesn't apply, at least directly and obviously. In any case, I'll[/color]
        look[color=blue]
        > at these to see if I can gleen the info I need.
        >
        > Thanks again, NWOP.
        >
        > "Richard Burte" <rburte@online. microsoft.com> wrote in message
        > news:#ANCaBClDH A.1708@TK2MSFTN GP12.phx.gbl...[color=green]
        > > 6.1. How do I call a function that is in a native DLL?
        > >
        > > Native DLL functions can be called through Platform Invoke (P/Invoke):
        > >
        > > Learn how to use the Platform Invoke (P/Invoke) feature of the .NET[/color]
        > Compact[color=green]
        > > Framework.
        > >
        > >[/color]
        >[/color]
        http://msdn.microsoft.com/library/en...ntrointerp.asp[color=blue][color=green]
        > >
        > > Explore advanced interoperabilit y on the .NET Compact Framework.
        > >
        > >[/color][/color]
        http://msdn.microsoft.com/library/en...advinterop.asp[color=blue][color=green]
        > >
        > > Learn how to create unmanaged functions that you can use in your Smart
        > > Device applications through Platform Invoke.
        > >
        > >[/color][/color]
        http://msdn.microsoft.com/library/en...nagedfuncs.asp[color=blue][color=green]
        > >
        > > Learn how to marshal data between managed and unmanaged code using the[/color]
        > .NET[color=green]
        > > Compact Framework.
        > >
        > >[/color]
        >[/color]
        http://msdn.microsoft.com/library/en...rshallingtypes[color=blue]
        > .asp[color=green]
        > >
        > > Learn how to use dumpbin.exe as an aid for declaring P/Invokes in[/color]
        > Microsoft[color=green]
        > > .NET Compact Framework-based applications.
        > >
        > >[/color]
        >[/color]
        http://msdn.microsoft.com/library/en...mpbinpinvoke.a[color=blue]
        > sp[color=green]
        > >
        > >
        > >
        > > "New World Order Pigs" <lthompson@md-it.com.no.spam> wrote in message
        > > news:#18u#x1kDH A.1800@TK2MSFTN GP10.phx.gbl...[color=darkred]
        > > > Sorry if this is the wrong group, but it seems like a good place to[/color][/color]
        > start.[color=green][color=darkred]
        > > > I have a control, creating a dll written in c#/.net and some unmanaged[/color]
        > > code[color=darkred]
        > > > in c++ using embedded c++ V3. Yes, it is for PPC2002/PPC2003 but I[/color][/color]
        > don't[color=green][color=darkred]
        > > > believe that's the significant issue. My question is, can I create a
        > > > solution that wraps the c++ in c# and combine that with the c# control[/color][/color]
        > and[color=green][color=darkred]
        > > > if so, is this the best way to combine these two elements? I'm not[/color][/color]
        > going[color=green]
        > > to[color=darkred]
        > > > post this elsewhere and hope people can look past the PPC issues since[/color][/color][/color]
        I[color=blue][color=green][color=darkred]
        > > > don't believe they matter at all here.
        > > >
        > > > Thanks for any assistance,
        > > > NWOP.
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        Working...