I'm trying to create a function that can loop through a list of Windows::Forms::Controls (I know there's no loop below, I'm just keeping it simple for sake of testing) and perform a task. Right now I have a function which works properly:
You are mixing C++ template and .NET generics. This is OK is you understand what are you doing.
In your specific case, this is classic C++ template problem. To call templated function C++ compiler must see the function implementation, and not only prototype. So, you can instantiate IsVisible function only in the same .cpp file. Or make it inline by moving the function implementation to .h file.
[Marking as NEWS - this is not a question but this is an appropriate forum IMO]
If you develop in C++/CLI with Visual Studio 2017, beware that update 15.9.6 introduced a very bad codegen bug. C++/CLI apps will crash if you use /std:c++17 or /std:c++latest. The workaround is to drop back to C++14 language support.
I am working on some examples of my own and now looking to include a new class for my Banking transactions.
Seems like I am doing something in the wrong place etc.
I typed in the new code ahead of the standard code created by Visual Studio (17) (I didn't add an item). The information I wanted to create appears in the right hand window CLASS VIEW but I get the errors.
shows the class and items above
1>------ Build started: Project: Santander01, Configuration: Debug Any CPU ------
1>C:\Users\HOME\Documents\Visual Studio 2017\Projects\Santander01\Santander01\Form1.cs(19,8,19,23): error CS0116: A namespace cannot directly contain members such as fields or methods
1>C:\Users\HOME\Documents\Visual Studio 2017\Projects\Santander01\Santander01\For
I am trying to build some simple examples as part of my learning process.
I have created a form which includes the dateTimePicker and tried several combinations which have failed. The output initially displays time as HH:MM:00 and only dis[plays correct time when I include
I'd like to format - say
and failed to complie with the following error - is this what you meant.
When I follow your link it refers to C# whereas I am working with C##.
Severity Code Description Project File Line Suppression State
Error C2228 left of '.ToString' must have class/struct/union Project1 c:\users\home\documents\visual studio 2017\projects\project1\project1\myfirstform.h 335
Error (active) E0153 expression must have class type Project1 C:\Users\HOME\Documents\Visual Studio 2017\Projects\Project1\Project1\MyFirstForm.h 336
Very mixed background
Wrote first programs in 60's (machine code, user code, Fortran, Algol & many more)
Moved into IT sales / management
Have developed Forex applications in MT4 which is sort of C based
Started with this C++ / CLi on Saturday - so sort of making progress
I've fought shy of 'understanding' the ins / outs of C
Now retired and need to keep brain cells stimulated !
Thanks for support & comments and will read around
Since you have only just started with C++/CLI, my advice would be to stop now and switch to C#. It is so much better for this sort of application, and the learning curve is not as bad as it may at first appear. There is a great free starter document at .NET Book Zero[^] which you can work through fairly quickly. Like you, I am retired and followed this route myself, so I am far from being a C# expert, but I can code simple applications without too much trouble.
Last Visit: 31-Dec-99 19:00 Last Update: 26-Nov-22 9:58