
Changing printer settings, DEVMODE And C#
Nick,
The IntPtr return is a generic integer which you can use to get access to a
platform-dependent handle or structure. Use the ToPointer() method to cast
it to a void *, then cast it to the DEVMODE structure pointer. If you use
Managed Extensions for C++, the structure is already defined for you in the
Platform SDK; in C#, you may have to create your own structure definition.
Since the returned structure is a feature of the Windows API, you'll need
to call Windows APIs using the pointer. You may find the article Q167345
useful as a reference to the platform-specific steps needed to manipulate
DEVMODE.
However, I am curious as to the features you are trying to manipulate that
aren't responding. That is not specifically a function of C#; if you have
some code you'd like to show us to demonstrate the problem, we'd like to
see it. You should direct any inquiries on .NET Frameworks objects to the
public.dotnet.* newsgroups. Thanks!
Derrick Glass
Microsoft Developer Support - Visual Studio
This posting is provided AS IS with no warranties, and confers no rights.
--------------------
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Subject: Changing printer settings, DEVMODE And C#
| Lines: 10
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
| Date: Wed, 02 Jan 2002 17:43:25 GMT
| NNTP-Posting-Host: 64.133.115.34
| X-Trace: newsread1.prod.itd.earthlink.net 1009993405 64.133.115.34 (Wed,
02 Jan 2002 09:43:25 PST)
| NNTP-Posting-Date: Wed, 02 Jan 2002 09:43:25 PST
| Organization: EarthLink Inc. -- http://www.EarthLink.net
| X-Received-Date: Wed, 02 Jan 2002 09:43:27 PST
(newsmaster1.prod.itd.earthlink.net)
| Path:
cpmsftngxa07!tkmsftngp01!newsfeed00.sul.t-online.de!t-online.de!news-lei1.df
n.de!news-was.dfn.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfee
d.direct.ca!look.ca!newsfeed1.earthlink.net!newsfeed.earthlink.net!newsmaste
r1.prod.itd.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-ma
il
| Xref: cpmsftngxa07 microsoft.public.dotnet.languages.csharp:32146
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| I need to be able to change printer settings programatically on the fly. I
| have tried changing printer options using PrinterSettings object but the
| changes never seem to take affect. I have seen the calls to get and
| setHdevmode(). the get function returns an IntPtr. how can you manipulate
| something using this IntPtr. DEVMODE was a structure under C++ but there
| does not seem to be an equivelant under C#.
|
| Please help, my project is dependent on this working.
|
|
|