Saturday, June 26, 2010

Mutisoft Extreme Software Development company in Sri Lanka

Multisoft Extreme is a Software Development company in Sri Lanka. We develop customized software for all your business requirements. We provide quality software and service for our clients.

Web : www.multisoftextreme.com
E-mail : info@multisoftextreme.com
Tel : +94 (0) 772201066

Sunday, March 14, 2010

Ms Word Automation using C#, Filling a shape with a specific RGB values.

In the development process of Abey Limousines Management System for Monaco France we were asked to export their Invoices to Ms Word where they can have it totally editable. We were asked to insert a shape to the word document to show their Facture No (Invoice No), We had to fill that shape with RGB(51,102,153) values, but we found it extremely hard to fill the shape with the above specific RGB value.

The RGB(51,102,153) is close to a blue color, but the colors we got close to blue are WdColor.wdColorLightBlue which has RGB(51,102,255) and WdColor.wdColorBlue which has RGB(0,0,255). Above those colors were presets and we found it hard to set it to the color of RGB(51,102,153).

Finally we found the solution, It was creating the color RGB(51,102,153) from the preset colors WdColor.wdColorLightBlue and WdColor.wdColorBlue. It is like mixing color and creating a new color.
The amazing thing in computers is you can subtract colors, This is how we created RGB(51,102,153).


WdColor.wdColorLightBlue -WdColor.wdColorBlue*2/5 which means


RGB(51,102,255) – RGB(0,0,255)*2/5
= RGB(51, 102,255 – 255*2/5)
=RGB(51,102,153)

So finally we were able to get the color we wanted by subtracting two colors

Friday, February 12, 2010

"Input string was not in a correct format" - Exception when Parsing strings to float, double

When developing the Abey Limousines Management System for Monaco France we encountered a strange error from both from parsing a string to double or a float, The application worked fine in our environment and it didn’t parse accurately in the client environment.

The problem was in Sri Lanka we use dot(.) as the decimal symbol and in Monaco France they use comma(,) as the decimal symbol, we had a text box to show their tax rate as 5.5, When parsing this 5.5 string to float or double both float.Parse() and float.TryParse() methods throws a exception saying “Input string was not in a correct format”

We Multisoft Extreme was able to successfully solve that problem by changing the decimal symbol from dot(.) to comma(,) in every occurrence of the application and changing 5.5 to 5,5. Also most importantly changing our current format to French (Monaco) from the Regional and Language Options form the control panel.

Saturday, February 6, 2010

MySQL Service Not starting - "Could not connect to the Service Control Manager.Error:0"

While implementing a Software System for Abey Limousines of Monaco France we Multisoft Exreme encounted a problem in starting the MySQL server in our client machine. The installation was done remotely where we gave the instructions to the client using Skype. We sent the screen shots of the steps of the MySQL Server installation.

At the end of the installation the MySQL service did not start. The Error was "Could not connect to the Service Control Manager.Error:0"

The Client was using the machine of Windos 7 and unaware of whether they are using an Administrative account or not. They said they can install other softwares with out a problem.

Finally we were able to find the solution, The solution was running the installation setup as a administrator by right clicking on the setup and and selecting Run as Administrator. Also we asked our client to uninstall the current installation and delete the MySQL folder in the C:\Program Files

Then the service was started sucessfuly and the installation was a sucess.

Thursday, August 13, 2009

Windows media player end of stream problem

When we were developing a web player for one of our customers, we used the windows media player component. While developing it we found out that the end of stream event is not firing at the end of the play. Finally we came up with this solution.
In here we used the “PlayStateChange” event of the media player in order to detect the end of stream.

bool isMediaEnded = false;
private void mPlayer_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e)
{

if (mPlayer.playState == WMPLib.WMPPlayState.wmppsMediaEnded)
{
isMediaEnded = true;
}
else if (mPlayer.playState == WMPLib.WMPPlayState.wmppsTransitioning)
{
if (isMediaEnded)
{
isMediaEnded = false;
// End of stream occurs here. Do what ever you want.

}
}
}

Monday, April 27, 2009

How to use the “ErrorProvider” control in a C# application

This is an example on how to use the “ErrorProvider” control in order to check whether there is something written in the textbox and validate a textbox .

Add a label with the name ‘label1’, a textbox with the name ‘txtText’ and a button with the name ‘btnValidate’ as given in the above form. Also add error provider control to the form with the name ‘errorProvider’. Rename the Form as ‘FormTextBoxValidator’.

Then add this method to the FormTextBoxValidator.cs to validate the textbox.

private bool textBoxValidate()
{

errorProvider.Clear();
if (txtText.Text.Trim() == "")
{
errorProvider.SetError(txtText, "Text should be non empty");
return false;
}
return true;
}

Then to the click event of the ‘ btnValidate’ add the following code.

private void btnValidate_Click(object sender, EventArgs e)
{
if (textBoxValidate())
{
MessageBox.Show("Content validated!");
}
}

When you run the application, and click the validate button without entering a text to the textbox, it will provide an error as follows.


If you enter some text to the textbox, it will validate the textbox.


Multisoft Extreme

Multisoft Extreme is a software developing company. We develop software for all business requirements. We are specialized in stock management systems, payroll systems and billing systems. For more information: multisoftextreme@gmail.com