There can be an issue with the intellisense .ncb file. If the no compile browser (.ncb) file located at the root of your project directory is read-only or becomes corrupt in some manner, IntelliSense information will no longer be available. To fix this, do the following: Close the solution. Delete the .ncb file. Reopen the […]
All posts by
Creating New Project From Existing Project
Copy the project to a new project directory Open it and rebuild it to ensure it builds correctly. In solution explorer right click the solution > Rename In solution explorer right click the project > Rename Below here may need updating…. Rename the main project files to the new project name Open project by running […]
Deploying Applications Using The Chart Control
The Microsoft chart control is included in .NET 4 and above. For .NET3.5 your application distribution package needs to include mschart.exe and install it as a prerequisite if it is not already on the users PC. You can’t simply include a .dll – mschart.exe needs to be run. Adding MS Chart Controls as a prerequisite […]
Rounding
Using this int i; float f = 1.53; i = Convert::ToInt32(f); Will cause i = 2, because Convert::ToInt rounds to the nearest value. To force rounding down use: i = Convert::ToInt32((int)f);
Creating Random
Create random number System::Random ^rand = gcnew System::Random(); //Creates seed value from system clock if no seed supplied iTemp = rand->Next(1, (100+1)); //Min possible value, max possible value+1 Fill an array Random ^rand = gcnew Random(); rand->NextBytes(DecodedHexFile); //Fill entire array with random values
Creating a Pause / Delay
Threading::Thread::Sleep(250); //Pause time in mS
Dynamically Altering Charts
this->SuspendLayout(); chart1->ChartAreas[0]->AxisY->Title = L”Kg”; //Set max / min chart1->ChartAreas[0]->AxisY->Minimum = 0; chart1->ChartAreas[0]->AxisY->Maximum = 1000; //Set tool tip text chart1->Series[0]->ToolTip = “#VALX\n#VAL Kg”; //To get possible expressions go to the charts //Series > Map Area > Tool Tip property //Set individual bar colours chart1->Series[0]->Points[0]->Color = Color::Orange; //Point value is point index to set colour of. Set […]
Differences To C#
Good Resources http://www.andymcm.com/csharpfaq.htm Converting Sample Code You often find code samples in VS C# that are not also shown in VS C++. Usually it’s really easy to convert them to C++, using Intellisense to confirm when your right. Bacsically a ‘.’ in C# will usually be ‘->’ or ‘::’ in C++. It’s that simple a […]
Creating New Chart
Use The Sample Ap The fastest way to choose the basic chart setup you want is to use the sample ap, select the chart you want and adjust it as you want. The code sample it generates may be good (but isn’t always, but once you’ve seen how it works and what options you want […]
Multiple lines on a chart
If you want to display multiple channels (i.e. multiple lines on a line chart) then you create a seperate series for each.
