Alternatives For Accurately Representing Decimal Variables In C++

Mar 4, 2010

I am currently working on a program that takes Visual Basic data in the form of a text file, and then stores this data in C++. Some of the data from Visual Basic is of the type Decimal. C++ has no built in type equivalent to decimal. I don't want to use double because there is a possible loss of significant figures if the numbers are large enough.One option is write my own decimal class.

View 2 Replies


ADVERTISEMENT

Calculator Application - Use Datatype - Variables Be Single Double Decimal ?

Mar 11, 2009

I am writing an calculator application and i dont know what datatype to use. i mean should the variables be single, double, decimal...?

View 1 Replies

.net - String.Format Decimal With Sign Fixed Number Of Decimal Places, No Decimal Separator?

Jun 27, 2012

What is the cleanest, most readable way to String.Format a decimal with the following criteria

start with a sign symbol (+ or -)
a fixed number of fraction digits
no decimal separator
right aligned
pre-padded with "0"'s

View 3 Replies

Accurately Print A Complex Form?

Jun 16, 2010

I am currently trying to find a way to accurately print a complex form that I created in VB6.

I stumbled upon a company that has a very impressive package called Winform Reports.

[URL]

Currently it is only supported in .NET.

Does anything like this exist for VB6?

View 2 Replies

How To Measure Time Spans Accurately

Aug 9, 2011

I have a VB.NET application that executes a test when the user clicks a "Start" button. The application communicates back and forth with a USB device and eventually stops when the USB device sends back a specific trigger, or if the user chooses to cancel the test. I would like to measure the time elapsed during each test and display it to the screen.The program is significantly complex and I have several timers that control sampling rate, the frequency of the output, the frequency of signals in a calibration method, etc.I tried two approaches so far, both of which led to invalid time measurements. I say they're invalid because I used several stopwatches I know to be accurate in addition to the system clock (the clock with a second hand that pops up when you double click the time in the bottom right hand corner of Windows XP) to measure the actual time of each test. Consistently, my program will indicate more time has passed than actually has.I tried simply dividing the number of samples I took by the the sampling frequency. I got back a time that was about 1.33 times greater than the actual time. This ratio would change with different frequencies, and even with the same frequency from day to day.

I tried using the DateTimePicker in my main form to measure the time passage. At the start of the test I'd record the start time, startTime = DateAndTimePicker1.value, at the end of the test I'd record the end time, endTime = DateAndTimePicker1.value, and then I'd set the text of a label equal to their difference, TestDurationLabel.text = (endTime - startTime).ToString. I initialized startTime and endTime as Dates. I get back a time that is about 1.2 times greater than the actual time.

View 4 Replies

Calculate Internet Connection Speed Accurately?

Jun 17, 2011

I'm trying to calculate Internet connection i have used this [code]...

View 3 Replies

Mouse Movements To Fast To Fire Events Accurately?

Jul 8, 2011

I'm working on a custom scroll bar. When dragging the slider, things work smoothing with what I have... that is if the users movements are smooth and slow-ish. When moving quickly the mouse move event doesn't seem to fire as accurately as I had hoped.. I attempted using the up and down buttons enter event for re positioning or "resetting" the slider whenragging is activated but still those events don't even fire when the mouse move event is firing. So I believe I hit a barrier of my .Net knowledge and hope someone here knows a way around this little issue.

Public Class Form1
Dim Dragging As Boolean
Dim mPointY As Integer

[code]....

View 5 Replies

Getting The Icon Representing A Process?

Mar 23, 2012

I'm making a taskbar for something (I'll be creating similar to the windows taskbar).

I've managed to get all process objects that would be in the taskbar, how can I get the icon too?

View 1 Replies

Culture Reference Error "instantiation Variables As Xmldocument, Control Or Decimal"

Feb 28, 2010

i have an application that have been working correctly, but sudenly shown an error as this: Error at create form, Exception.InnerException. When i execute debuger show error at the instantiation variables as xmldocument, control or decimal.

View 1 Replies

Converting DayOfWeek Enum To A String Representing The Day

Jan 30, 2010

I was wondering if there was a way to directly convert the integer DayOfWeek returns into a string representing the day like Monday, Tuesday etc.

Sample code:

MessageBox.Show(Date.Today.DayOfWeek)

This will return 6 (as of today). Is there a way to directly convert this into Saturday, for example? I don't really care what it really converts it into, but I want to do away with my Select Case:

Select Case Date.Today.DayOfWeek
Case 1
day = "Monday"

[Code]......

View 5 Replies

MasterMind, Create A String Representing The Colors Of The Comma?

Mar 27, 2012

I have an assignment which is asking me to complete some Mastermind game codeI'm given most of the code and there is one sub that i do not understand what it asking for

it says
Private Function createColourString(ByVal gb As GroupBox) As String
'

[code]....

View 3 Replies

Raw A Simple Line Chart Representing Sql Query Data Results?

Nov 13, 2009

how to draw a simple line chart representing sql query data results?

View 8 Replies

Alternatives To RichTextBox?

Sep 8, 2010

For sometime now whenever I am in need of formatted text I have been using RichTextBox control and save data to RTF format. However lately I started using RTF editor control that allows you to insert images into rtf. And although this works, the file sizes grow immensely.I was wondering if nowadays there are any better alternatives (preferably available for free) that people can use in windows applications for viewing and editing documents.

View 1 Replies

Any Alternatives To Codedom?

Jan 5, 2011

Are there any alternatives to Codedom? THe reason I am asking is because Codedom is not letting me use pointers(unsafe code) which is a must in my project. I have hear of the System.emit namespace though.

View 2 Replies

FileLen And LOF Alternatives?

Nov 19, 2010

give me some alternatives to FileLen & LOF?

View 3 Replies

Write A Program Using 2 Parallel Arrays Representing Grade Point And Grades?

Jan 31, 2010

I have to write a program using 2 parallel arrays representing grade point and grades. The grade points range from 0 to 500, however, we are only to use the minimum points per each letter grade in " points " array. This is shown in the code below. You then enter a number from 1 to 500, representing the grade points, and in turn it spits out your letter grade.My problem is this. When I enter a number, say 200, I get a letter " D " grade instead of an " F " grade. It appears that every number range I enter gives me one letter grade less than what it is supposed to be. Also, any number 450 to 500, representing an " A " grade does not even register in my Grades Label.

[Code]...

View 7 Replies

.net Winform Grid Alternatives?

Dec 7, 2010

I am using vb.net / Winform 2010.I am looking for a free (or very cheap) alternative to the DataGridView, one that looks more like what I see on ads for XTraGrid. Something that will multiple lines per records, and for lines to be rolled up, and expanded by clicking, etc.

View 1 Replies

C# - Cross Platform Alternatives To WPF?

Mar 31, 2011

I'm thinking of porting my application from VB.net to the C# based MONO project, so it can run on both Windows and Mac. However, I am in need of a Mac-friendly alternative to WPF. It has to have very similar functionality. QML (by QT) is not a viable option, as it costs far too much money for us.

View 3 Replies

PaintEventArgs.Graphics Alternatives?

Jan 1, 2010

is PaintEventArgs.Graphics the only way to get the Graphics of a Form?

View 10 Replies

VS 2010 Alternatives For The Old Functions?

Sep 21, 2010

When I try to code in VB2010, I usually unmark the reference to Microsoft.VisualBasic. Because I do not want to use the legacy functions of VB6. I want to complete walk in .Net path. And I have found some alternatives for the old VB6 functions. But the rest not. Where can I find the list of those methods or classes (alternatives for the VB6 functions) ?(For eg: when I tried to find the difference of 2 dates, I couldn't find any other alternatives. So, I came back and used the Microsoft.VisualBasic reference for using DateDiff())?

View 24 Replies

VS 2008 Drag And Drop And Alternatives?

May 20, 2011

I'm working on a small utility program and found that I have a need to copy the contents of listboxes, textboxes and other control from one to another.

I just started playing around with Drag and Drop but it seems lacking a bit...for instance, if I wanted to drag the contents of a listview to a text box, it doesn't look like I can do that easily if at all.

Can you use a drag and drop to copy the contents of different control types easily?I thought about using the drag and drop method for notification of the intent to copy the contents and then I would code the copying.

The idea (although I know it will be slow but that is okay for this utility) to copy the source to a textbox and then from the textbox to the target. The content won't be that large and speed is not a concern at this point.

Here is my issue if I have to do it this way.

1 - How can I use the control names to do this?

2 - How do I get the target control name?

I figured I would create a function that I would pass the source control name and the target control name and based on type, perform the appropriate method of copying the data.

I haven't figured out a way to get the target control name. I can use activecontrol.name for the source.

View 1 Replies

[2005] TabControl: Beautifying It Or Alternatives?

Feb 18, 2009

I have the need to constantly use the TabControl but somehow its current look is boring, is there any tricks out there to make it more interesting? Or what are the alternative controls that I could use to replace it?

View 3 Replies

.net - Alternatives To SelectedIndexChanged That Don't Fire On Form Load?

Dec 24, 2009

I'm developing in VB.NET with Visual Studio 2005.I have a ComboBox (myCombo) on a form that gets populated within the Load method.I also have handled myCombo.SelectedIndexChanged to change a label on the form.

Edit: The way I added the event handler was by double-clicking on the combo box on the designer. Skeleton code then came up in the code view.It looks like what's happening is when the form loads, SelectedIndexChanged gets fired each time an item is added to myCombo.This isn't what I want, but I'm thinking there's another event handler that only gets called when the user changes the selection.

Here's some code for what I have:

Private Sub myDlg_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' this is all I do with myCombo in this sub
list = GetListOfItemsToAdd()

[code].....

Update: The solution I used was to remove the Handles clause after the event generator, and add this before the "End Sub" above:

AddHandler myCombo.SelectedIndexChanged, AddressOf myCombo_SelectedIndexChanged

View 4 Replies

Alternatives To SelectedIndexChanged That Don't Fire On Form Load?

Jan 16, 2011

I'm developing in VB.NET with Visual Studio 2005.I have a ComboBox (myCombo) on a form that gets populated within the Load method.I also have handled myCombo.SelectedIndexChanged to change a label on the form.Edit: The way I added the event handler was by double-clicking on the combo box on the designer. Skeleton code then came up in the code view.

View 2 Replies

.net - Automation Scripting Tool Boston Workstation Alternatives

Dec 14, 2011

I been using Boston workstation for a project but the version i have is about 8 years old and it only works with terminal not GUI apps. what alternatives are out there for automation scripting Gui apps in visual studio.

View 2 Replies

Convert A Decimal ( Decimal Place Holder = Dot) To A Decimal (decimal Place Holder =comma)?

Dec 20, 2010

how do you convert a decimal ( decimal place holder = dot) to a decimal (decimal place holder =comma)?

View 6 Replies

OdbcDataReader In Showing Decimal Fields Decimal Separator Disappear With DB2 Dsn?

Oct 19, 2010

OdbcDataReader in showing decimal fields Decimal separator disappear with DB2 dsn

View 3 Replies

Display A "multi Coloured Indicator" With Each Colour Representing A Certain Condition?

Feb 8, 2011

I require a "Indicator Control" i.e. I need to display a "multi coloured indicator" with each colour representing a certain condition. Basically "I want to build" a multi colored LED on a Form. I have used a Radio Button before but I need more than 2 colors and the Radio Button is a very poor choice.

View 2 Replies

After Converting All Degrees-->decimal, And Decimal-->hours - Use Tan, Cos And Sin Formula

Aug 27, 2009

After converting all degrees-->decimal, and decimal-->hours, how can i use Tan, Cos and Sin formula in vb.net? I want the user must enter an input (which it is a coordinat-->i already convert the degrees-->decimal value as suggested by stanav and paul.

The questions like this (i only calculate on paper but dont know how to implement in code):

Input user need to enter:
-latitude local (e.g. 1.4875)
-longitude local (e.g. 103.3883333)

[CODE]...

View 23 Replies

Change Decimal To A Comma When Hitting Decimal Key On Numpad Only

Jan 17, 2011

My user requests to change the . on the numpad to a when entering text in a multiline textbox.So I was thinking about the KeyDown event.To determine if the numpad . was pressed I can do something like this [code]But now how do I change the returned charachter as a , ? All e.Key... properties are ReadOnly. The KeyPress events let me change this by providing e.KeyChar, but in that event I can't check for the numpad .

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved