Re: Struck with CopyMemory API



> There is one of two possible problems here. Is pDevMode a pointer or a UDT?

>From a prior post in the thread:

<quote>
Dim pDevMode as DEVMODE
</quote>

> If it is not a pointer, then the only problem is that the name (the "p"
> prefix) implies it is; however that is only a convention; VB and Windows of
> course do not care. If pDevMode is not a pointer, it is important to ensure
> that it is not used as a pointer anywhere. The "p" prefix can cause
> confusion.

The original MSDN example code was more than likely originally ported from C++ source where the type would have been
declared as "DEVMODE* pDevMode;", Microsoft's example VB code has never been particularly good though and many of the
API oriented examples look like ported code rather than being working up in VB from scratch.
FWIW,

Mike


- Microsoft Visual Basic MVP -
E-Mail: EDais@xxxxxxxx
WWW: Http://EDais.mvps.org/


.



Relevant Pages

  • RE: Updating public devmode with IPrintOemDriverUI::DrvUpdateUISet
    ... Pointer to a DEVMODE structure that defines default printer data such as the ... is not the same as modifying the pdevmode that is passed to the ui plugin? ... am particularly worried about what will happen when the print settings for a ... Steven Velez ...
    (microsoft.public.development.device.drivers)
  • Re: Struck with CopyMemory API
    ... Is pDevMode a pointer or a UDT? ... The "p" prefix can cause ...
    (microsoft.public.vb.winapi)
  • Fixes for tar(5) format handling in pax(1)
    ... bug in paxrelated to handling pathnames of the maximum length ... prefix, linkname) to be unterminated if they fill the entire field ... if so just return a pointer to the name. ... * to find the biggest piece to fit in the name field (or the smallest ...
    (freebsd-arch)
  • Re: Hungarian notation in C++ (is it used or not today, and if so, how?)
    ... > p (pointer) ... > by (unsigned char, or byte) ... that the prefix is correct. ... C++ Faq: http://www.parashift.com/c++-faq-lite ...
    (alt.comp.lang.learn.c-cpp)
  • Re: strange behaviour
    ... carelessly many people use it as a prefix to a pointer _variable_. ... OTOH standard API C-type variables appear to always use "p" as a prefix as part ... of the "hungarian" naming convention (which in general is unnecessary in a ...
    (comp.lang.pascal.delphi.misc)