Re: how to transfer a DWORD from a function?



"monkeydragon" <kerby.martino@xxxxxxxxx> wrote in message
news:1134442380.262533.234770@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
> one last thing,
> with this code
> DWORD* ptDW = new DWORD [192];
>
> with that how can I get the size 192

You can't. You have to keep track of the size of the buffer you
allocated.

> sizeof(ptDW) doesn't seem to return 192?

No it doesn't.

> furthermore it rises problems especially when:
> DWORD* ptDW = new DWORD [SIZE_DEPENDS];

DWORD size = SIZE_DEPENDS;
DWORD* ptDW = new DWORD[size];

Now just keep both ptDW and size around.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.



Relevant Pages

  • Re: Passing an object to function
    ... Igor Tandetnik ... With sufficient thrust, pigs fly just fine. ... land, and it could be dangerous sitting under them as they fly ...
    (microsoft.public.vc.language)
  • Re: Avoiding Overflow
    ... land, and it could be dangerous sitting under them as they fly ... overhead. ... -- RFC 1925 ...
    (microsoft.public.vc.language)
  • Re: fatal error C1083: Cannot open include file
    ... land, and it could be dangerous sitting under them as they fly ... overhead. ... -- RFC 1925 ...
    (microsoft.public.vc.language)
  • Re: Unicode issues with comboboxex
    ... land, and it could be dangerous sitting under them as they fly ... overhead. ... -- RFC 1925 ...
    (microsoft.public.vc.language)
  • Re: IE Sychost.exe.Application Error
    ... land, and it could be dangerous sitting under them as they fly ... overhead. ... -- RFC 1925 ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)