Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / January 2008

Tip: Looking for answers? Try searching our database.

absolute address

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DosFreak - 04 Jan 2008 01:33 GMT
in delphi you can use Ptr to an absolute address, can i do this in vc++.
in dos, i can use a dos font. i assume that if i save the dos font to
disk, then edit it, i have a new font. any copyright issues. or michael
mediford 20 years wrote editfont which did exactly that for dos. i was
trying to do the same for win32. but anyways, i was trying to get
biosinfo from the computer using vc++; seems like every computer is
different, it would be easier to use a pointer to point to it.

Marc...
Carl Daniel [VC++ MVP] - 04 Jan 2008 16:10 GMT
> in delphi you can use Ptr to an absolute address, can i do this in
> vc++. in dos, i can use a dos font. i assume that if i save the dos
[quoted text clipped - 4 lines]
> computer is different, it would be easier to use a pointer to point
> to it.

There is no access to physical memory under Windows unless you write a
kernel device driver (and please, don't).

-cd
Steve in Albury - 04 Jan 2008 19:50 GMT
Are you trying to access memory in bios to get the font, or are you trying
to store a vriable at a particular memory location?

Steve
Tamas Demjen - 07 Jan 2008 22:09 GMT
> in delphi you can use Ptr to an absolute address, can i do this in vc++.

The Delphi Ptr function converts an integer to a pointer. In C/C++, all
you need is a cast:

void* p = reinterpret_cast<void*>(0xFFFF5);

As others have said, this only works in DOS. You'll get an access
violation if you try to execute this in Win32.

Also, you should never use an integer to store a pointer, because that's
not going to work on x64, where int is 32-bit and void* is 64-bit. A lot
of Delphi code uses integers for HDC and HANDLE variables. There will be
major portability issues with those programs.

And finally, if you plan to distribute your product, you shouldn't steal
the font from the BIOS. There are plenty of monospace fonts out there,
and some of them were designed to look like a DOS terminal.

Tom
Steve McKewen - 08 Jan 2008 02:20 GMT
I have used copies of monospaced fonts read out of bioses in portable
equipment, but I have always ended up modifying the font at least a little
bit.
Nowadays I just write a font edit program and draw the font I want.
It ends up just being an array definition that contains all of the bytes
from the font.

If you want a font that is exactly the same as a bios font, but don't want
to actually use the bios font, then you will have to write your own font
draw functions anyway.  I do that, but only in embedded stuff where I don't
have access to font systems that meet my needs.

Steve

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.