• C

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
k061198Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
KangaRooCommented:
That's an option...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C

From novice to tech pro — start learning today.