dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 3 of 3 FirstFirst 123
Results 31 to 45 of 45

Thread: [RESOLVED] Re: How to learn c#

  1. #31
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,146

    Re: How to learn c#

    Quote Originally Posted by 2kaud View Post
    Yeah. I'd forgotten about def files. I haven't used them since about oh windows 3.11
    I haven't made a native Win32 dll since about oh 2004, and that was an ATL COM dll.

  2. #32
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,570

    Re: How to learn c#

    Quote Originally Posted by John E View Post
    5) C# supports both .NET Core and .NET Framework
    6) .NET Core is the type needed for cross-platform development (with Visual Studio)
    Something's beginning to dawn on me... VS2019 offers a number of C# sample projects for .NET Core (i.e. they'll run on a non-Windows platform). But unless I've missed something, all the cross-platform samples seem to be either class libraries (i.e. projects for building a DLL) or else they're console apps.

    So even with C# it doesn't seem possible to build a GUI app for cross-platform use. Have I missed something?
    "A problem well stated is a problem half solved. - Charles F. Kettering

  3. #33
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    6,900

    Re: How to learn c#

    Have a look at the picture on https://devblogs.microsoft.com/dotne...-applications/ This explains what is Windows only and what is x-platform with .net core.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.3.9)

  4. #34
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,146

    Re: How to learn c#

    In addition to the link above, you can also host a .net core web application in a browser in full screen mode.

  5. #35
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,570

    Re: How to learn c#

    Thanks guys - so if my app's not browser based, is my only other option to have a text mode / console app?

    I realised quite early on that .NET Core doesn't support Windows Forms - but I assumed there'd be some kind of GUI capability (but if there is, I can't seem to find any examples of it... )
    "A problem well stated is a problem half solved. - Charles F. Kettering

  6. #36
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    6,900

    Re: How to learn c#

    Quote Originally Posted by John E View Post
    Thanks guys - so if my app's not browser based, is my only other option to have a text mode / console app?

    I realised quite early on that .NET Core doesn't support Windows Forms - but I assumed there'd be some kind of GUI capability (but if there is, I can't seem to find any examples of it... )
    Windows forms, WPF etc are Desktop 'packs' that reside on top of .net core for Windows only. For x-platform GUI there is only ASP.NET core on top of .net core. So if you're NOT using a browser for the app/web application, then AFAIK you can't do x-platform GUI based upon .net core.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.3.9)

  7. #37
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,570

    Re: How to learn c#

    Groan... so here's what I've learned so far...

    1) Microsoft's one & only attempt at cross-platform development is .NET Core
    2) But it doesn't support GUI apps unless they're browser based
    3) And it won't support C++ (for which there are several cross-platform libraries available)
    4) But it does support C++/CLI which is clumsy and isn't cross-platform either (in fact, it's hard to see what C++/CLI brings to the party)

    Maybe I'm being over critical but to me, Microsoft's cross-platform efforts seem like an embarrassing, half-hearted joke. Why don't they just work on a cross-platform MSVC compiler which would solve so many of these problems?? Even if it was limited at first, it'd be a huge step in the right direction.

    I'm old enough to remember Borland C++. In its day it was more popular than Visual C++ - but through incompetence and arrogance it ended up as a joke and soon got overtaken by Microsoft. But Microsoft's dev tools are now heading the same way AFAICT.

    [rant over...]
    "A problem well stated is a problem half solved. - Charles F. Kettering

  8. #38
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    6,900

    Re: How to learn c#

    (in fact, it's hard to see what C++/CLI brings to the party)
    The fact that the functionality available within the .net framework could be used from within C++ for those that couldn't/wouldn't use .net framework from c#. C++/CLI is essentially Herb's baby. For C++, Microsoft now wants you to use C++/winrt which is UWP C++ for any Windows 10 device. So in that sense, C++/winrt is x-platform amongst any device using Windows 10 - but not for any device not using Windows 10.

    I well remember Borland C++/Turbo C++/Turbo Assembler. It's what I used for MS_DOS/Windows 3/3.1 etc way back when. The current equivalent is Embarcadero C++ Builder - which I understand is x-platform based upon the Clang compiler. See https://www.embarcadero.com/products/cbuilder
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.3.9)

  9. #39
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,570

    Re: How to learn c#

    Time to ditch Visual C++ and make a switch maybe? I remember Turbo Debugger from the old days but I can't remember how it stacked up against MSVC's debugger back then. But this looks promising from the Embarcadero site:-

    with integrated cross-platform native debugging. Using the C++Builder IDE, you can debug applications running remotely on Windows, macOS, iOS and Android!
    [Edit...] But than again, I've just noticed the price !!!
    Last edited by John E; November 1st, 2019 at 09:05 AM.
    "A problem well stated is a problem half solved. - Charles F. Kettering

  10. #40
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    6,900

    Re: How to learn c#

    But than again, I've just noticed the price !!!
    but did you see the Community Edition https://www.embarcadero.com/products/cbuilder/starter Its free until your individual revenue from C++Builder applications or company revenue reaches $5,000 US or your development team expands to more than 5 developers.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.3.9)

  11. #41
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,570

    Re: How to learn c#

    Quote Originally Posted by 2kaud View Post
    The current equivalent is Embarcadero C++ Builder - which I understand is x-platform based upon the Clang compiler. See https://www.embarcadero.com/products/cbuilder
    Interestingly, I just came across a Microsoft article which suggests that VS2019 can also be configured to use the Clang compiler, rather than VC++. I'm not sure how well it'd handle debugging (and there's no mention of OS-X being supported) but is sounds like a step in the right direction...
    "A problem well stated is a problem half solved. - Charles F. Kettering

  12. #42
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,146

    Re: How to learn c#

    Nearly everything is easier and simpler in .Net and Java.

    Is cross-platform the only reason for wanting to stick with C++?

  13. #43
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,570

    Re: How to learn c#

    Quote Originally Posted by Arjay View Post
    Is cross-platform the only reason for wanting to stick with C++?
    No, it's because the projects I'm involved with happen to be written in C++ (and they rely on 3rd party libraries which are also C++). And it just wouldn't be practical now to convert everything to some other language.

    6 or 7 years ago I tried making a move to gcc but I could never get used to it (especially the debugger). I guess maybe it's time to take another look - but back then...

    1) You couldn't set or unset break points on-the-fly (they all had to be set up before starting the debugger).
    2) Each break point added about a minute to the debugger's startup time (so with only 4 break points it'd take 4 minutes just to start the debugger!!)
    3) You couldn't change the value of variables during a debug session (nor the order of execution)

    and loads of other stuff - the gdb debugger back then was almost useless
    "A problem well stated is a problem half solved. - Charles F. Kettering

  14. #44
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,146

    Re: How to learn c#

    If it is possible to wrap the C++ functionality into a dll and expose that functionality with c-style functions, then you can call the dll in C# with pinvoke.

    Keep in mind that the dll can use C++ internally and call other dlls that use or expose C++ just as long as the functions called by pinvoke have C-style signatures.

  15. #45
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,570

    Re: How to learn c#

    Thanks again Arjay.

    Since my post from yesterday I've discovered that msbuild projects (which I assume means .vcxproj files in this case) can now be configured to use Clang directly. Previously, I think it was all being done via CMake.

    So it looks like Microsoft is finally making a serious effort at cross-platform support for C++ development (it's just taken VC++ out of the picture...)

    Let's consider this topic closed now and I'll post any further questions in one of the C++ forums.
    "A problem well stated is a problem half solved. - Charles F. Kettering

Page 3 of 3 FirstFirst 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)