By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,227 Members | 1,290 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,227 IT Pros & Developers. It's quick & easy.

pointer from C module to printer

P: n/a
If I were to give you a pointer from a C module, can one, in ISO C++, make
a hard copy of whatever is at that address without using MFC? io is a
little austere on the other end of the hallway. furunculus
Jun 17 '06 #1
Share this Question
Share on Google+
9 Replies


P: n/a
"Your Uncle" <in*****@crippled.net> wrote in message
news:44**********************@news.usenetmonster.c om...
If I were to give you a pointer from a C module, can one, in ISO C++,
make a hard copy of whatever is at that address without using MFC? io is
a little austere on the other end of the hallway. furunculus


Umm.. what? Hard copy as in print out? Or some other thing?

If you're asking if you can copy whatever hte pointer is pointing too, most
likely. By different methods depending on what it is. I don't think you
could copy a function though (if it was a function pointer).

What is it you are trying to do?
Jun 17 '06 #2

P: n/a

"Jim Langston"
"Your Uncle" <in*****@crippled.net> wrote in message
news:44**********************@news.usenetmonster.c om...
If I were to give you a pointer from a C module, can one, in ISO C++,
make a hard copy of whatever is at that address without using MFC? io is
a little austere on the other end of the hallway. furunculus
Umm.. what? Hard copy as in print out? Or some other thing?

Print out so as to be able to read at the cafe.

If you're asking if you can copy whatever hte pointer is pointing too,
most likely. By different methods depending on what it is. I don't think
you could copy a function though (if it was a function pointer).

What is it you are trying to do?

I'm trying to figure out what C++ could do for me in the absence of MFC. It
seems something like impossible without headers like windows.h ,
consideration of which is OT where I usually hang out. Is, e.g.
#include <windows.h>
OT here? furunculus
Jun 17 '06 #3

P: n/a
Your Uncle wrote:
"Jim Langston"

What is it you are trying to do?


I'm trying to figure out what C++ could do for me in the absence of MFC. It
seems something like impossible without headers like windows.h ,
consideration of which is OT where I usually hang out. Is, e.g.
#include <windows.h>
OT here? furunculus

Yes, it is windows specific and you will normally get redirected to a
windows group.

On other platforms, C++ can do what ever you want without <windows.h>,
so it probably can on windows as well.

--
Ian Collins.
Jun 17 '06 #4

P: n/a

"Ian Collins"
Your Uncle wrote:
"Jim Langston"

What is it you are trying to do?


I'm trying to figure out what C++ could do for me in the absence of MFC.
It
seems something like impossible without headers like windows.h ,
consideration of which is OT where I usually hang out. Is, e.g.
#include <windows.h>
OT here? furunculus

Yes, it is windows specific and you will normally get redirected to a
windows group.

On other platforms, C++ can do what ever you want without <windows.h>,
so it probably can on windows as well.

You pop open the headers that the windows folks wouldn't dream of doing
without, and they don't really ooze out with Evil, as is often rumored. Let
me rephrase my question. You have a pointer to an int array that contains
the value of the index, something like
q[i] = i;
.. Does C++ have a portable means to get that data to a printer? furunculus
Jun 17 '06 #5

P: n/a
Your Uncle wrote:
"Ian Collins"
On other platforms, C++ can do what ever you want without <windows.h>,
so it probably can on windows as well.


You pop open the headers that the windows folks wouldn't dream of doing
without, and they don't really ooze out with Evil, as is often rumored. Let
me rephrase my question. You have a pointer to an int array that contains
the value of the index, something like
q[i] = i;
.. Does C++ have a portable means to get that data to a printer? furunculus

No.

Well maybe if you include the system() call, you can write the value to
a file and use system() to cast the required runes to print the file.

--
Ian Collins.
Jun 17 '06 #6

P: n/a

"Ian Collins"
Your Uncle wrote:
"Ian Collins"
On other platforms, C++ can do what ever you want without <windows.h>,
so it probably can on windows as well.


You pop open the headers that the windows folks wouldn't dream of doing
without, and they don't really ooze out with Evil, as is often rumored.
Let
me rephrase my question. You have a pointer to an int array that
contains
the value of the index, something like
q[i] = i;
.. Does C++ have a portable means to get that data to a printer?
furunculus

No.

Well maybe if you include the system() call, you can write the value to
a file and use system() to cast the required runes to print the file.

Rats. I can make that same call in the language that's giving me fits right
now. I'll take a check and my OT self out the door.... fu
Jun 18 '06 #7

P: n/a
Ian Collins wrote:
Your Uncle wrote:
"Ian Collins"
On other platforms, C++ can do what ever you want without <windows.h>,
so it probably can on windows as well.

You pop open the headers that the windows folks wouldn't dream of doing
without, and they don't really ooze out with Evil, as is often rumored. Let
me rephrase my question. You have a pointer to an int array that contains
the value of the index, something like
q[i] = i;
.. Does C++ have a portable means to get that data to a printer? furunculus

No.

Well maybe if you include the system() call, you can write the value to
a file and use system() to cast the required runes to print the file.


That said, most system still provides a device file to the printer so
you can use ofstream to print...Don't bash me, I said "most", not "all".

Regards,
Ben
Jun 18 '06 #8

P: n/a
benben wrote:
Ian Collins wrote:
Your Uncle wrote:
"Ian Collins"

On other platforms, C++ can do what ever you want without <windows.h>,
so it probably can on windows as well.

You pop open the headers that the windows folks wouldn't dream of
doing without, and they don't really ooze out with Evil, as is often
rumored. Let me rephrase my question. You have a pointer to an int
array that contains the value of the index, something like
q[i] = i;
.. Does C++ have a portable means to get that data to a printer?
furunculus


No.

Well maybe if you include the system() call, you can write the value to
a file and use system() to cast the required runes to print the file.


That said, most system still provides a device file to the printer so
you can use ofstream to print...Don't bash me, I said "most", not "all".

They do, but the printer device might not be available to a normal user.

--
Ian Collins.
Jun 18 '06 #9

P: n/a
"Ian Collins" <ia******@hotmail.com> wrote in message
news:4f*************@individual.net...
Your Uncle wrote:
"Ian Collins"
On other platforms, C++ can do what ever you want without <windows.h>,
so it probably can on windows as well.


You pop open the headers that the windows folks wouldn't dream of doing
without, and they don't really ooze out with Evil, as is often rumored.
Let
me rephrase my question. You have a pointer to an int array that
contains
the value of the index, something like
q[i] = i;
.. Does C++ have a portable means to get that data to a printer?
furunculus

No.

Well maybe if you include the system() call, you can write the value to
a file and use system() to cast the required runes to print the file.


Well, yes kinda. Just print it to std::cout and in your OS redirect the
output to the printer. Like in windows

MyProgram.exe >> lpt1:
Jun 19 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.