Click here to Skip to main content
15,896,201 members
Everything / CLI

CLI

CLI

Great Reads

by Greg Utas
Automating help, validating user input, running scripts...
by paladin_t
A guide about how to mix native and managed code in one solution
by matt warren
How the .NET CLI tooling runs your code
by Fedor Dzjuba
Client and a WebAPI to execute MDX query against SSAS and display a resulted cellset in a pivoted grid form with Axis neatly arranged in a hierarchical and grouped manner.

Latest Articles

by optiklab1
Exploring world of NFTs and blockchain while prototyping wallet CLI application with efficient data structures using C# and .NET Core
by Bhargav Technical Lead
Angular migration to version 16
by Greg Utas
Automating help, validating user input, running scripts...
by Fedor Dzjuba
Client and a WebAPI to execute MDX query against SSAS and display a resulted cellset in a pivoted grid form with Axis neatly arranged in a hierarchical and grouped manner.

All Articles

Sort by Title

CLI 

18 Jul 2021 by wifinut
I'm trying to add a speed test to my BASH script. I know you can install speedtest-cli on the host, but this is not an option. I'm looking for options perhaps using the CURL command. What I have tried: I tried using a CURL command to obtain the...
18 Jul 2021 by Daniel Pfeffer
Working backwards from the numbers that you give, we get 1 block = 100Mb / 22355 = 4473 bits. This looks close to a 4 Kb (i.e. 512 byte) block size. Adding various header and framing bits make the correspondence even better. I expect that you...
2 Apr 2021 by wifinut
I'm looking for a method to obtain my provisioned ISP bandwidth via shell script. To be clear, I'm not looking to do a speed test. My goal is the following: 1. Get my provisioned bandwidth (up/down) 2. Run a test to obtain the percentage of...
2 Apr 2021 by Dave Kreskowiak
The only way to get your bandwidth is a speed test. There is no information stored on your machine or any standard method on the internet to get your provisioned bandwidth.
9 Mar 2022 by Greg Utas
Automating help, validating user input, running scripts...
7 Jan 2020 by Fedor Dzjuba
Client and a WebAPI to execute MDX query against SSAS and display a resulted cellset in a pivoted grid form with Axis neatly arranged in a hierarchical and grouped manner.
17 May 2023 by Bhargav Technical Lead
Angular migration to version 16
12 Nov 2022 by PartisanIsaac
I was making a small block drawing package with Node.js, and i was tinkering with it, but at the exact moment i put a ANSI Color code, it started to break. Before: Image[^] After Image[^] The reason that makes it break is that all the...
11 Nov 2022 by OriginalGriff
That's because ANSI escape sequences are just that: sequences. They have a common format: They start with an ESC character, and the following character either completes the sequence are indicates a Control Sequence if is is an open square...
12 Nov 2022 by Dave Kreskowiak
Quote: The reason that makes it break is that all the characters i use to make the ANSI codes work are being treated as just normal characters when i use the string .length property. That's because, in the terms of a string, they ARE normal...
1 Feb 2016 by Member 10657083
How does one implement the background worker in C++, for something like a cpu meter that runs constantly.
1 Feb 2016 by CPallini
Let me search for a tutorial... "C++ Tutorial: Using of BackgroundWorker Component in C++/CLI | Free source code, tutorials and articles"[^].
9 Apr 2014 by gaminn
In Visual Studio Express 2013 I have an executable C++/CLI project. It contains main.cpp, Class.h and Class.cpp file. I'm getting "error C2011: N::Class : class type redefinition". Why and how to fix it?//main.cpp#include "stdafx.h"#include "Class.h"int main(array...
9 Apr 2014 by Sergey Alexandrovich Kryukov
In the code fragments you show here, you are not redefining anything. Moreover, you don't have the definition of the class N::Class, not even a declaration of it is shown. The class Class is a different class, Usb::Class, it does not create any name clashes. That is, instead of showing two...
9 Jan 2022 by WantToLearn1
Made a GUI with Visual Studio. Trying to pass a string to another cpp file but it's difficult. I have tried extern std::string but it's always empty for the measure.cpp file. Extern int is working fine. Then I tried to make function inside to...
9 Jan 2022 by CPallini
In order to call the path() method in your measure.cpp source file, you need to: include form.h in measure.cpp. call it on a instance to the MyForm class (because it is a method, not a standard function). In order to get better help, you...
13 Feb 2015 by Vladimir Svyatski
I'm going to show you some not quite evident things if you're about to write a C++/CLI application.
28 Jun 2022 by code_pop
Hi all. I'm using the C++/CLI dll on the C# WinForm project. To pass from the native code's exception message to C#, I have written the code as below. #include "pch.h" #include "ClassLibrary1.h" using namespace ClassLibrary1; void...
4 Apr 2019 by Member 14150165
I'm new to managed C++, dealing now with a C++/CLI project which involved function calling from native DLL for results to be displayed via WinForm. An expected exception is encountered when calling function from native DLL due to missing equipment for the project. However, instead of...
25 Apr 2020 by OriginalGriff
The first problem is that DisplayHelloFromDLL is an instance method of the test class - which means that just like the C# equivalent: public class test { public void test() { printf("This is default constructor"); ...
25 Apr 2020 by KarstenK
Your import statement is missing some important details. And dont use the full path for the import but locate the dll in the directory of the app. Read my article and code about C# interoperbility Calling All Stations and compare the difference...
25 Apr 2020 by Member 14686752
I have C# as my front end application and I want to call c++ dll from my c# but I am getting error. I am posting my code here please help me out how to resolve this: Program.cs using System; using System.Runtime.InteropServices; using...
24 Apr 2013 by dmitryponv
Good Afternoon,This application is for Windows (7)I have a button in my application which loads settings from a text file. I also want this event to be called during the initialization of the form. What is have is Form1(void) { ...
24 Apr 2013 by Sergey Alexandrovich Kryukov
There is no such concept as "call an event". An event instance can be invoked, which calls all the event handlers currently found in its invocation list.And not, here is the real blocker: you can never invoke an event instance from nowhere at all, except the code of the class declaring the...
24 Apr 2013 by Philippe Mori
For readability, you should avoid calling an event handler to execute common code. If same code is used from many place, then declare a function and call that function from both event handlers.That way, you know that an event is called from a "real" event and the expected one. That is, an...
3 Feb 2012 by domace
In your experience, are there any performance differences when using CLI/C++ across different versions of the .NET runtimes? Recently we have upgraded an application to .NET 4.0 and we believe the performance of this layer has been negatively effected. Are there some patterns of programming this...
3 Feb 2012 by Manfred Rudolf Bihy
I've no (well for practical purposes as near to zero as one can get ;)) experience regarding the language CLI/C++, but I can confirm this happening when we moved from .NET 1.1 to .NET 2.0 six years ago. There were some cached DataTables involved and in .NET 1.1 everything worked like a charm....
3 Feb 2012 by Philippe Mori
First you have to verify what security checks are performed. Generally, the performance of STL or STL/CLI is relatively bad in debug version as a lot of validation is done.That problem also mainly occurs when the application is run under the debugger.In Release version (and the...
3 Feb 2012 by Rajesh Anuhya
See this Discussion alsohttp://journal.stuffwithstuff.com/2009/01/03/debunking-c-vs-c-performance/[^]http://stackoverflow.com/questions/686483/c-sharp-vs-c-big-performance-difference[^]CP articleHead-to-head benchmark: C++ vs .NET[^]Thanks--RA
14 Jan 2013 by user_code
Hello,I have a HWND in my C++ MFC code, and I want to pass this HWND to a C# control and get it as IntPtr.What Is wrong in my code, and how can I do it correctly?(I think it's something with wrong using of the CLI pointers, because I get an error that it cannot convert from...
11 Apr 2016 by devender_t
I am trying to expose a Managed Function to Unmanaged Code using C++/CLI wrapperpublic:array^ CallingBrownianManagedCodeTemp(){ int numPaths = 100; int dimension = 3; double time = 30; int seed = 1; double stepSize = 1.0 / 12.0; int scrambling = 0; ...
20 Oct 2015 by Jammes_Ca
Hello i want to create a c++ dll and call it on a c# project. i saw a lot of video and tutorial but i did'nt find the solution.i want to make a dll of this project Joystick Driver Project[^]and use all thos function on a c# project Please help
20 Oct 2015 by KarstenK
I have written an article about that issue, which you might had found if you had searched a bit. Or here is anothter beginners article.
8 Jan 2017 by Gun Gun Febrianza
Yesterday i was read book .Net IL Assembler, i know how to code IL Assembly and produce managed code(exe or dll) using ilasm. we can create console based application using IL Assembly, My question is how to make Windows Form Application using ilasm? i am curious how to make simple form with...
8 Jan 2017 by OriginalGriff
It's not as simple to do as a console app, but it's possible - a lot of work though.What I'd suggest you start with is by creating a basic WinForms app in C# - one button, one text box: press the button and the text box content goes into a MessageBox. Build it and look at the IL that it...
30 Oct 2015 by Jammes_Ca
Hello i create a program with OpenCv that dispaly video. the program is a consolea application hat lunch a window that show the video.Now i want to display the video on a picturbox.Could you help me please.i work with c++/CLIthe code is here#include #include...
27 Oct 2015 by Jammes_Ca
Hello, i want to create a GUI with c++/cli to display video from an embedded cameraI didn't find any article who speak about that.Could you help me please.http://www.bdspeedytek.com/product/jpeg-color-camera-uart-ttl-interface-ov528-chip/[^]
27 Oct 2015 by KarstenK
You must fetch the image from the camera and display it on a GUI. Here is an outstanding article CXImage which handles a lot of image processing tasks.
27 Oct 2015 by Sergey Alexandrovich Kryukov
I did not see your search, but you either looked in wrong place, and, most likely, used too narrow search criteria. If you are using C++/CLI, the article or answer using any CLI language would suite you; note that most publications are written using C#. Also, you need to understand that...
6 Mar 2016 by FrostedSyntax
How to create batch files that make navigating the filesystem in the command prompt a breeze.
19 Feb 2018 by Vishal Bhatia0112
Hello All, It's an C++/CLR project. I have below structure in my header file: value struct CONFIG { System::String^ Exch_Feeds; System::String^ Exch_Type; System::String^ Feeds_Type; int Feeds_port; int Max_Users; int IML_port; System::String^ Interface_IP; System::String^...
19 Feb 2018 by phil.o
Your problem does not seem to be in the structure declaration, but rather where you try to use it. The code you showed does not hold any cfg identifier. Find this identifier in your code, you most likely forgot to terminate one of your statements with a semicolon.
7 Jun 2022 by gsegria
I am investigating how to find out physical address from start offset to end offset. For example: 1) There is a 70GB storage. (F:\) 2) There are four 17GB files. 17GB-1.bin, 17GB-2.bin, 17GB-3.bin, 17GB-4.bin 3) copy 17GB-1.bin, 17GB-2.bin,...
1 Apr 2012 by Adnan Merter
hi all,i need to find out how i can declare a global object which can be accesible from all functions of the same application.i created a global serialport object :System::IO::Ports::SerialPort^ serialPort = gcnew SerialPort(L"COM4" , 300, Parity::Even , 7, StopBits::One);then,...
1 Apr 2012 by Sergey Alexandrovich Kryukov
.NET does not have a concept of global objects (finally, thanks goodness!). Instead, you can have a static member of some managed "ref" class or structure.Formally, this solves your problem. But even this is not good enough, would be the sign of bad coding style.There are two ways of...
26 Oct 2014 by Mr. xieguigang 谢桂纲
The idea of hybrids the R script and my shellscript is awesome, and hybrid the shellscript with R can extends the function of my script and I also can write two type of the programming language both in one script file. Incredible thing! Right?
7 Aug 2018 by Member 13703287
C++/CLI Function I am generating Hash key using C++/CLI and Sending Data and Hashkey Over network to Other Application which is Java But Java Application HashKey Generated is different. Any Idea where i am going wrong? Thanking in Advance. char* EncodeData(char* ap_key, char* ...
6 Nov 2017 by Member 13147452
how can i send and receive json data between C# and C++. i have a json data in my c# code and i need to send the data to c++ and as a replay i need to send another json data to c#. could some one please explain how can i do this using C++/CLI wrapper. What I have tried: i don't have a clear...
6 Nov 2017 by KarstenK
When it is in the same app than you best use C# interop and make a call by using the jason as string parameter. Read my article and code Calling all stations. If it are different apps it gets a bit difficulter. Writing an temporary file or shared memory is best for on the same machine.
12 Mar 2022 by k5054
You need to give a command for sudo to execute: # sudo with no command given [k5054@localhost ~]$ sudo -S usage: sudo -h | -K | -k | -V usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user] usage: sudo -l [-AknS] [-g group] [-h host]...
16 Jun 2021 by Member 15248812
Hi guys, my aim is to capture the screen of a windows form using c++/cli. Below is the code to capture the window, however, it is in C#. What changes do I have to make to the code for it to work in c++? Graphics myGraphics =...
16 Jun 2021 by OriginalGriff
You are treating the class name as a pointer by using the -> operator to dereference a static member method. Try this: Graphics^ memoryGraphics = Graphics::FromImage(memoryImage); If you had gone to the MS documentation and selected C++ as the...
9 Jun 2023 by Александр Романеев
I run the terminal, But I do not understand which commands work. How to write correctly, so I exit the window or better the "help" command so I the allowed commands. Compiled successfully! You can now view react-app in the browser. Local: ...
9 Jun 2023 by Andre Oosthuizen
As Javascript is client side based, you will probably need node.js for your serverside. That being said, here are some shortcuts for Javascript terminal usage - 1. Installing - Regular: npm install Shortcut: npm i 2. Testing - Regular: npm...
11 Aug 2016 by ricksmitchina
Hi... I'm new in the world of c++, im creating a c++ CLI form with a listview on which is populated at runtime in the "Load" event... now i hav come so far as to make the list able to show a message box when i double click the listview item...but heres my question....How do i get the message...
11 Aug 2016 by Richard MacCutchan
See ListView.SelectedItems Property (System.Windows.Forms)[^].
1 May 2021 by dj4400
I am looking for an example or a walkthrough for creating a c++/cli wrapper for a c# dll to be used (loaded statically/dynamically) in an unmanaged c++. I found examples of a wrapper for the other way around (c++ dll to be loaded in c#) but none...
1 May 2021 by OriginalGriff
See here: Calling C# .NET methods from unmanaged C/C++ code[^]
13 Oct 2015 by Maddie from Dartford
I have three C++ projects under one solution file and each project has multiple C++ files. I need to write C++ CLI wrapper so C# application can access functionalities of C++ classes.I have created managed dll project with one class which is mocking all functionalities of one C++...
13 Oct 2015 by Sergey Alexandrovich Kryukov
First of all, please see my comment to the question.If those C++ projects are yours and you have the source code, the best way to create a CLI wrapper would be migrating your projects from C++ to C++/CLI. This way, you can create mixed-mode modules (managed+unmanaged) of dual purpose: they...
18 Sep 2022 by Death Smoke
#pragma once #include using namespace std; namespace Project1 { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace...
10 Sep 2016 by matt warren
How the .NET CLI tooling runs your code
13 Mar 2018 by ashish121095
I am new to C++/Cli so bare with me. so, I have node class (page3_node.h), page3.h (form page) and page3.cpp which consists implementation of page3_node.h. my problem is I am trying to access methods of page3_node.h into page3.h but I am not able to do it. Any help is greatly appreciated. ...
9 Nov 2015 by Maddie from Dartford
Hello,I have gone through many article but still looking for answer of my question. I have written c++ wrapper class which has one function like this:void ManagedWrapper::ReadFile(String^ licFile){ ReaderClass reader; unsigned char readFile[5000]; reader.readLicFile(readFile);...
10 Nov 2015 by Kornfeld Eliyahu Peter
One of these will do the work for you...https://msdn.microsoft.com/en-us/library/ttyxaek9(v=vs.110).aspx[^]https://msdn.microsoft.com/en-us/library/744y86tc(v=vs.110).aspx[^]
21 Oct 2011 by DLChambers
In C#, one can define an event delegate & handler thusly:class SomeClass{ public delegate void SomeEventHandler(object sender, int n); public event SomeEventHandler SomeEvent; public void RaiseEvent(int n) { if (SomeEvent != null) SomeEvent(this,...
21 Oct 2011 by Simon Bang Terkildsen
CppCliEventHan...
21 Oct 2011 by Sergey Alexandrovich Kryukov
Yes, this is well-known problem — C++/CLI is very different. Solution is also well-known, but it might look very unusual: not only you are not allowed to do the check like if(OnCppCliEvent != nullptr), you also never need it!In other words, just delete this check — the code will...
29 Mar 2016 by Maddie from Dartford
Hello,I have two c++ lib file which I want to link in my Managed c++ application. While liking it gives 56 link error and I am able to figure out how to resolve these errors. Here are few error details:Quote:error LNK2005: "private: static class std::locale::_Locimp * __cdecl...
29 Mar 2016 by Sergey Alexandrovich Kryukov
Please see my comment to the question.C++ is unique language in this respect. You can use regular P/Invoke .NET API, but it's really beneficial to use mixed-mode projects where you can freely mix managed + unmanaged. Please see:Calling Native Functions from Managed Code[^],Using C++...
29 Nov 2012 by Qizhong Yang
Currently I need to load a C lib into my CLR project(managed c++/CLI).All the header file and lib file have been added. But when compile the project, there are some errors and warning like below:Errors:error LNK2001: unresolved external symbol "extern "C" int __stdcall...
19 Jan 2012 by vaibhavbvp
Hi alli am stucked in a problem.i want to pass some variables values from a program to a mfc dialog based exe...the number of arguments that i want to pass is 3.is there any way by which i can pass these three arguments into the mfc based exe..really i am in a urgent need...
19 Jan 2012 by Jochen Arndt
Derive a class from CCommandLineInfo and add your implementation of the virtual member function ParseParam() to process your application specific parameters. The derived class should contain member variables to store your parameters.Process the command line in InitInstance() of your...
24 Jan 2012 by vaibhavbvp
simply us the getcommandline() function this fucntion stakes the argumnets from the comandline,and acc u could use them.
14 Jan 2020 by Piraisudan
I have a win32 project, I am calling my exe using following command in command prompt. "MyApp.exe /Print" If I execute above in command prompt, I want to display "Welcome to MyApp" in the same command prompt window. I am able to get the given command line using CWinApp, but I cannot able to...
14 Jan 2020 by W Balboos, GHB
If cout fails you, take the extreme route. Do a stream write to stderr. I haven't done the above since my DOS days but the typical rule was that both stdin and stdout (and thus, possibly cin and cout, for you) can be redirected but stderr could not.
14 Jan 2020 by _Asif_
It's easy and a good example can be found here Visual C++ Enable Console - Stack Overflow[^] Do a little search and you will find plenty of examples more.
14 Jan 2020 by Richard MacCutchan
I just tried your code and it works fine. You need to provide more details of your exact code and environment.
30 Aug 2022 by n.deny
i have a program to read data from serial port appsto port R L S F 1 CR LF port to apps R L S F 1 CR LF port to apps L D S E 3 CR LF READ data port to apps L D E D 5 CR LF apps to port R L E E 3 CR LF port to apps R L E E 3 CR...
30 Aug 2022 by CPallini
Quote: serialPort1->Write(dateS, 0, dateS->Length); cli::array^ byts = gcnew cli::array(dateS->Length); serialPort1->Read(byts, 0, dateS->Length); Just a wild guess (you post omits significant details): you are...
30 Aug 2022 by Richard MacCutchan
Your code assumes that the remote device will send all its data in a single burst according to your read command. However this is not how serial I/O works. It is an asynchronous process and characters need to be captured as they are received in...
16 Oct 2015 by Jammes_Ca
Hello i'm a beginer on c++/cli, i want to make a program that rotate an image in a picturboxe, i see an exemple in c#, i want to program it on cpp/cli but i had errors in my programe, can you help me please the exemplei n c#...
16 Oct 2015 by Richard MacCutchan
Please post your question in the forum at the end of the article.
16 Oct 2015 by Sergey Alexandrovich Kryukov
It's a bad idea to rotate anything in PictireBox. You need to rotate image, not control, which won't help you at all, will only add hassles and waste some resources giving nothing in return. Instead, render the image directly in your control, which could be a custom control or even something...
17 Oct 2015 by Jammes_Ca
Thanks for your replay, but me i want to program that in C++/CLI not in c# :)could you make me an applicatio, with c++/cli that rotate an image from 180 to -180 Please
14 Mar 2012 by RedDk
/*Simple 256 x 3 array with data of type string containing reps of numericalTrying to write to console converted value but filter only one of the inner loop's cycles. Why can't the use of "if(rs = 0)" do the filtering?*/using namespace System;using namespace System::IO;using...
25 Dec 2011 by vaibhavbvp
Hi AllI am facing a problem.let suppose i have two classes.class A and class B.in class A i defines the object of class B,and in class B i defines the object for class A.When i try to run the code it show the error that to place a semicolon before the classA .the code is something like...
25 Dec 2011 by #realJSOP
That's a circular reference, and you can't do that. Refactor your code.
25 Dec 2011 by BrainlessLabs.com
#include"B_wnd...
25 Dec 2011 by arielb
Use this://A_wnd.h#ifndef A_H#define A_H#include "B_wnd.h"class B_wnd;class A_wnd{ public: B_wnd* m_b;};#endif//B_wnd.h#ifndef B_H#define B_H#include "A_wnd.h"class A_wnd;class B_wnd{ public: A_wnd* f;};#endif2 important...
31 Aug 2017 by Member 13387945
I was hoping someone could introduce me to a Java Graphic User Interface Command Line library. Something like nano,vi or a typical (windowsXP/RedHat no GUI install) sort of frame work. Colors and everything. I can use arrows keys to change values etc. I don't want to System.out.println() and...
31 Aug 2017 by CPallini
Some info here: Interactive Console Applications in Java[^].
31 Aug 2017 by Member 13387945
GitHub - mabe02/lanterna: Java library for creating text-based GUIs[^]
21 Mar 2012 by m0rTu
Anyone knows why methods from a ref class written in CLI actually get "remodeled" when you import the dll in c# ?ManagedFoo FOONET::ManagedFoo::divide(ManagedFoo % ac_OtherFoo)gets changed in :void divide(ref FOONET.ManagedFoo value, FOONET.ManagedFoo ac_OtherFoo)the first is in my...
21 Mar 2012 by S@53K^S
I guess that is due to the language interoperability.I believe that the first one is written in C++ style,so when it comes to C# style of passing parameters it changes accordingly
31 Dec 2013 by Member 2036792
Hello!I have a parent process that starts a child process, who then writes to its inherited stdout handle.Perhaps think of the parent process as a cygwin shell and the child process as nano or something. I want to monitor the input / output of nano. Cygwin doesn't necessarily see the...
17 Jan 2014 by bling
Solution 1 works as long as the child process doesn't manipulate the console API directly.