PRB: Windows VBA IEEE MBF 변환

기술 자료 번역 기술 자료 번역
기술 자료: 140520 - 이 문서가 적용되는 제품 보기.
이 문서가 보관되었습니다. "그대로" 제공되었으며, 업데이트가 되지 않을 것입니다.
모두 확대 | 모두 축소

이 페이지에서


이전 버전의 Microsoft Basic 제품을 만든 데이터 파일 (기본 빠른 GW-기본 및 Basica (IBM 및 Compaq 기본 사용이 허가되어 설치되어)) VBA 위해 Windows에서 읽을 수 없습니다.


전에 IEEE 부동 가리키도록 표준 중인 널리, Microsoft 같이 Microsoft 이진 형식 (MBF) 알려진 내부 부동 소수점 형식으로 사용할 수 있습니다. IEEE 표준 나중에 도입된 및 업계 되었습니다 표준.

Early versions of Microsoft QuickBASIC and GW-Basic supported only MBF format. In Microsoft Basic Professional Development System (PDS) and Visual Basic for MS-DOS, functions are available to convert between MBF and IEEE formats. As Microsoft moved toward complete acceptance of the IEEE standard, however, support for the MBF format was removed.

Visual Basic for Windows uses the IEEE standard. The MBF format, however, is incompatible with the IEEE standard and data saved in this manner will not be readable.

해결 방법

The PDS and Visual Basic for MS-DOS products contained functions that convert between MBF format and IEEE format. These functions are not available in Visual Basic for Windows. Here are two possible workarounds to this dilemma:
  1. A program can be written in PDS or Visual Basic for MS-DOS that re-creates the file containing the MBF data. After reading the file information into PDS or Visual Basic for MS-DOS, you can use the MKxMBF$ functions (see the manuals for PDS or Visual Basic for MS-DOS or their Help menus) to convert the data to IEEE format. This method is preferred for two reasons:
    • It converts your data to IEEE so that other programs can access your files.
    • If you use method 2, your program will need an extra DLL that you must distribute with your application.
  2. Previously, there was no way to convert the data from Visual Basic for Windows. But now there is a DLL available to do this. This DLL (MBF2IEEE.DLL) contains functions that simulate the MKS, MKD, CVS, and CVD functions that were present in some of the MS-DOS-based Basic products. These functions (MKS, MKD, CVS, and CVD) do not exist in Visual Basic for Windows, thus the need for this DLL. The MORE INFORMATION section below gives details about the DLL and explains how to download it from the Microsoft Download Center.

현재 상태

이 동작은 의도적으로입니다.

추가 정보

Details About Method Two: Using Mbf2ieee.dll

NOTE: These functions all do conversions between Microsoft Binary Format (MBF) and IEEE floating point values. Some of the newer MS-DOS-based Basic products had versions of these functions that worked differently. For example, they let you look at an IEEE number as a string without converting it to MBF. The routines described here are only provided as a way of retrieving old MBF data.

These functions provide conversions between IEEE floating point values and Microsoft Binary Format (MBF) floating point values. Below is a set of declare statements which must be included in a Visual Basic program which calls these functions:
   Public Declare Function Cvs Lib "MBF2IEEE.DLL" (X As String) As Single
   Public Declare Function Cvd Lib "MBF2IEEE.DLL" (X As String) As Double
   Public Declare Function Mks Lib "MBF2IEEE.DLL" (X As Single) As String
   Public Declare Function Mkd Lib "MBF2IEEE.DLL" (X As Double) As String

Below is a description of each of these functions along with an example.

CVS and CVD Functions

These functions accept a 4-byte (CVS) or 8-byte (CVD) string as an argument. They expect the bit pattern of this string to represent a single or double precision MBF value, respectively. The function returns an IEEE result.
   Dim MBF As String, IEEE As Single
   ' load the string from a file, etc.

MKS and MKD Functions

These functions accept an IEEE single (MKS), or double (MKD) precision value as an argument. It then converts this value into a 4-byte or 8-byte MBF value and returns it in a string.
   Dim MBF AS String, IEEE As Single
   ' Now write the MBF value out to disk

Potential Problems

There are differences between the IEEE format and MBF. For this reason precision may be lost during the translations. It is also possible that a number cannot be converted between the two formats. If this is the case, a Visual Basic Overflow (Error #6) is generated. This is a trappable error, so handle the error accordingly.

How to Get Mbf2ieee.dll

The following file is available for download from the Microsoft Download Center:
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file. After downloading Mbf2ieee.exe, run it to obtain Mbf2ieee.dll along with the source files and a Mbf2ieee.txt file, which is a readme that contains the text of this article.

Source Code Included in Mbf2ieee.exe

In addition to the .dll itself, the source code is also provided, so you can make modifications and recompile if you have Microsoft C. To recompile and build a new .DLL file, you must use Microsoft C because the routines are specific to Microsoft C and rely on the way Microsoft C returns floating point Values. This source code does not compile with Borland C.

To recompile with Microsoft C, use the following command line statements to build the DLL:
    cl -ALw -Ow -W2 -Zp -Tp mbf2ieee.c
    link /nod c:\vb\cdk\vbapi.lib mbf2ieee, mbf2ieee.dll, NUL, sdllcew
       oldnames libw, mbf2ieee
    rc -t mbf2ieee.dll
    implib mbf2ieee.lib mbf2ieee.def


기술 자료: 140520 - 마지막 검토: 2014년 2월 13일 목요일 - 수정: 2.2
본 문서의 정보는 다음의 제품에 적용됩니다.
  • Microsoft Visual Basic 4.0 Professional Edition
  • Microsoft Visual Basic 4.0 16-bit Enterprise Edition
kbnosurvey kbarchive kbmt kbdownload kb16bitonly kbfile kbprb kbsample KB140520 KbMtko
기계 번역된 문서
중요: 본 문서는 전문 번역가가 번역한 것이 아니라 Microsoft 기계 번역 소프트웨어로 번역한 것입니다. Microsoft는 번역가가 번역한 문서 및 기계 번역된 문서를 모두 제공하므로 Microsoft 기술 자료에 있는 모든 문서를 한글로 접할 수 있습니다. 그러나 기계 번역 문서가 항상 완벽한 것은 아닙니다. 따라서 기계 번역 문서에는 마치 외국인이 한국어로 말할 때 실수를 하는 것처럼 어휘, 구문 또는 문법에 오류가 있을 수 있습니다. Microsoft는 내용상의 오역 또는 Microsoft 고객이 이러한 오역을 사용함으로써 발생하는 부 정확성, 오류 또는 손해에 대해 책임을 지지 않습니다. Microsoft는 이러한 문제를 해결하기 위해 기계 번역 소프트웨어를 자주 업데이트하고 있습니다.

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from