• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1740
  • Last Modified:

MK_FP

my borland 5.03 will not complile a source containing
MK_FP, eventhough I have included dos.h.
claiming that it is an undefined function.
has anybody encountered a simular problem.

By the way does anyone know any good, graphics and
game programining for c, sites.

k
0
k061198
Asked:
k061198
1 Solution
 
k061198Author Commented:
its borland c++ 5.02 not 5.03
0
 
scrapdogCommented:
I do not know what MK_FP is, but maybe your source was meant for another specific compiler?? (this is very common)
0
 
yowkeeCommented:
 MK_FP might be the macro to make a FAR POINTER, which is specified to 16 bits programming (DOS). *If* Borland C++ 5.x could only compile 32 bits program, it won't recognize this macro.
  I am not very sure about this (since dos programming is so far away :-) . You should check this in your BC 5 compiler manual.
0
IT Degree with Certifications Included

Aspire to become a network administrator, network security analyst, or computer and information systems manager? Make the most of your experience as an IT professional by earning your B.S. in Network Operations and Security.

 
KangaRooCommented:
Segment / Offset stuff has become meaningless in Win32, where all addresses are near. You should take a look at the code that uses that stuff, particularly how you make these segment and offset pointers. If you consistently use the library function (below) you could add new definitions for them (using segment only or intance).

Syntax

#include <dos.h>
void far * MK_FP(unsigned seg, unsigned ofs);

Description

Makes a far pointer.
MK_FP is a macro that makes a far pointer from its component segment (seg) and offset (ofs) parts.

Return Value

MK_FP returns a far pointer.

Syntax

#include <dos.h>
unsigned FP_OFF(void far *p);
unsigned FP_SEG(void far *p);

Description

Gets a far address offset or segment.
FP_OFF is a macro that gets or sets the offset of the far pointer p.
FP_SEG is a macro that gets or sets the segment value of the far pointer p.

Return Value

FP_OFF returns an unsigned integer value representing an offset value.
FP_SEG returns an unsigned integer representing a segment value.

0
 
KangaRooCommented:
Alternatively you could target the project for 16 bit Dos
0
 
Kyle_JohnsonCommented:
In my Borland C++ compiler, the macro is in dos.h, however, you can merely include the macro in your own code:

#define MK_FP(seg,ofs)      ((void far *) \
                     (((unsigned long)(seg) << 16) | (unsigned)(ofs)))

Or you can construct a long pointer in a different manner such as:

char far * ptr = 0x04030040L; // Example

Hope this helps.  Kyle.
0
 
KangaRooCommented:
That's an option...
0

Featured Post

Easily manage email signatures in Office 365

Managing email signatures in Office 365 can be a challenging task if you don't have the right tool. CodeTwo Email Signatures for Office 365 will help you implement a unified email signature look, no matter what email client is used by users. Test it for free!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now