473,386 Members | 1,943 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

I need a 64-bit representation of a double in VB

I need to convert a VB6 double into a 64-bit representation of 1's and 0's. I probably could deconstruct a double into its bits by following IEEE 754, but that seem like a brute force method. Since VB probably stores a double in this format, is there any simple way to read out a memory location in bits (or bytes)? Any other ideas?

In actuality, I really need the representation in 4 Unsigned Integers (which VB does not support), but once I have the bits, this should be easy.
Aug 1 '07 #1
1 2225
I need to convert a VB6 double into a 64-bit representation of 1's and 0's. I probably could deconstruct a double into its bits by following IEEE 754, but that seem like a brute force method. Since VB probably stores a double in this format, is there any simple way to read out a memory location in bits (or bytes)? Any other ideas?

In actuality, I really need the representation in 4 Unsigned Integers (which VB does not support), but once I have the bits, this should be easy.
Okay, I will answer my own post. I was able to use the CopyMemory API . this basically made this just a 4-line project:

Dim DestArray(0 To 7) As Byte
Dim varDbl As Double
varDbl = CDbl(txtNumber.Text)
CopyMemory DestArray(0), varDbl, 8 ' The "8" represents the number of bytes to copy.
Aug 1 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Hugo | last post by:
I have a dual boot machine, runs Win XP pro and Win XP Pro 64, XP boots from C and XP 64 boots from D. They both have VS 2005 Beta 2 installed. I have a webapp developed in Win XP (32) which...
0
by: Hugo | last post by:
I have a dual boot machine, runs Win XP pro and Win XP Pro 64, Win XP boots from C and Win XP 64 boot from D. They both have VS 2005 Beta 2 installed. I have a webapp developed in Win XP (32)...
5
by: Eric BOUXIROT | last post by:
hi all !!! i need to call this API : FTD2XX_API FT_STATUS WINAPI FT_ListDevices(PVOID pArg1,PVOID pArg2,DWORD Flags) i have a sample code in C++ that work fine... > FTD2XX_API FT_STATUS...
10
by: krunalb | last post by:
Hi, I am trying to shift unsigned long long value by 64 bits and this is what i get #include <stdio.h> int main() { unsigned short shiftby= 64;
2
by: orfiyus | last post by:
Hi I am working on a script that that creates charts. So I decided to follow this tutorial using the chart director api. I more or less understand everything going on I just cant seem to find...
10
by: cs1 | last post by:
here is the question 1. read in a first name, last name and telephone number and store these in the list. 2. a search function that reads in a first name and last name and searches the...
1
by: dupe576 | last post by:
Hey, My boss put me in charge of getting this pin pad device to work with our software. We have it plugging into the usb port with a converter cable that converts it to a rs232 port. This...
16
by: Man-wai Chang ToDie (33.6k) | last post by:
Is it possible to build a Visual C++ GUI program without using MFC, using VC++ 2008 Express Edition? Forget about the time and speed issue. -- @~@ Might, Courage, Vision, SINCERITY. / v \ ...
9
by: Verizon News Server | last post by:
Hi, I am a newbie with Javascript. I am trying to build a simple form that calculates the cost of gasoline for a trip. It simply divides the trip distance by the mpg and multiplies that by the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.