Re: How to copy an address into a pointer
- From: Tom Shelton <tshelton@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 04 Jun 2005 13:58:34 -0700
On 2005-06-04, Just Me <groups@xxxxxxxxxx> wrote:
> I'm trying to set the system wide orientation properties.
>
Well... What can I say. I'm looking at the code. First off, you may
want to spend some time with the interop and marshalling documentation.
At first glance, I think you can dispense with all of the calls to
RtlMoveMemory... You probably can do this using Marshalling attributes
and the methods of the System.Runtime.InteropServices.Marshal class -
though, I will say that this routine would probably be easier to write
in C# using unsafe code (and probably would performe better). I will
try and see if I can get time to convert this function, but right now I
can't promise anything.
Also, you should not EVER call GetLastError from VB.NET (or from VB.CLASSIC
for that matter). The return result is meaningless since the runtime
may call API functions that set that value before you call it. You should
either use Marshal.GetLastWin32Error () or the intrinsic VB.NET Err object's
LastDllError property. Both of thes methods preserve the last user called API
error codes.
> BTW
> what are
> doc.PrinterSettings.DefaultPageSettings
> used for?
>
Setting printer settings... System.Drawing.Printing would be the
relavent namespace to start looking at the docs..
> I've been trying for a while to find out.
>
> Thanks
>
>
>
> "Tom Shelton" <tshelton@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:%23CFJutKaFHA.2212@xxxxxxxxxxxxxxxxxxxxxxx
>> On 2005-06-03, Just Me <groups@xxxxxxxxxx> wrote:
>>>> Anyway, it would be more helpful if we knew exactly what you were
>>>> trying to accomplish. It's pretty obvious that your trying to call a
>>>> Win32 api of some sort - but knowing which one would be helpful.
>>>> Working with API's is, IMHO, significantly different in VB.NET then
>>>> VB.CLASSIC.
>>>>
>>>> --
>>>> Tom Shelton [MVP]
>>>
>>> Thanks
>>>
>>> I'm trying to use an old routine for setting the system default
>>> printer's
>>> Landscape mode.
>>>
>>> Any other suggestion?
>>
>> The System.Drawing.Printing.PageSettings class?
>>
>> Dim doc As New PrintDocument ()
>>
>> doc.DefaultPageSettings.Landscape = True
>>
>> ' Do your printing...
>>
>> --
>> Tom Shelton [MVP]
>
>
--
Tom Shelton [MVP]
.
- Follow-Ups:
- Re: How to copy an address into a pointer
- From: Just Me
- Re: How to copy an address into a pointer
- From: Just Me
- Re: How to copy an address into a pointer
- References:
- How to copy an address into a pointer
- From: Just Me
- Re: How to copy an address into a pointer
- From: Tom Shelton
- Re: How to copy an address into a pointer
- From: Just Me
- Re: How to copy an address into a pointer
- From: Tom Shelton
- Re: How to copy an address into a pointer
- From: Just Me
- How to copy an address into a pointer
- Prev by Date: Re: Advanced MessageBox form
- Next by Date: Re: Question about VB.Net connecting to a webserver
- Previous by thread: Re: How to copy an address into a pointer
- Next by thread: Re: How to copy an address into a pointer
- Index(es):