473,324 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

declare a SendMessage with ByVal parameters or ByRef

I declare the following and use it if the msg returns values.

I also declare an SendMessage using ByVal for other calls.

Isn't there a way I can used the SendMessage and in the call tell it to use
ByRef?

Public Declare Auto Function SendMessageRef Lib "user32.dll" Alias
"SendMessage" (ByVal hWnd As IntPtr, ByVal msg As Integer, ByRef wParam As
Integer, ByRef lParam As Integer) As Integer

Thanks

PS

I once read a great internet site that explained in detail ByVal and ByRef
as applied to Value types and Reference types - but I've lost the URL.

Anyone know the address?
Nov 21 '05 #1
3 1678
> Isn't there a way I can used the SendMessage and in the call tell it to
use
ByRef?


i guess.. what message are you planning to send ?
IIRC, if the message returns you a Structure via a parameter, than you can
pass the struct variable "ByRef As MyStruct" and it should get fill
automaticaly or you can pass it "ByVal As IntPtr" and then use the
Marshal.PtrToStructure() function as well.

--
Best Regards
Yanick
Nov 21 '05 #2

"Zoury" <yanick_lefebvre at hotmail dot com> wrote in message
news:OQ**************@TK2MSFTNGP15.phx.gbl...
Isn't there a way I can used the SendMessage and in the call tell it to

use
ByRef?


i guess.. what message are you planning to send ?

In this instance, just Integers that are to be returned
Thanks
Nov 21 '05 #3
than declare the parameter ByRef.

--
Best Regards
Yanick

" Just Me" <gr****@a-znet.com> a écrit dans le message de
news:uY**************@tk2msftngp13.phx.gbl...

"Zoury" <yanick_lefebvre at hotmail dot com> wrote in message
news:OQ**************@TK2MSFTNGP15.phx.gbl...
Isn't there a way I can used the SendMessage and in the call tell it to

use
ByRef?


i guess.. what message are you planning to send ?

In this instance, just Integers that are to be returned
Thanks

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Sandy | last post by:
Hello! Help!!!! I have ten zillion books that attempt to describe the difference between ByVal and ByRef and none of them are clear to me. I have gathered that ByVal makes a copy and ByRef...
7
by: Hei | last post by:
Hi, i know the difference of ByRef and ByVal, in case if use byref or byval don't affect the result which one should prefer? (less memory use, better performance ....issue) thx
19
by: Rob Panosh | last post by:
Hello, Ok here is the senerio: ..... Dim myArrayList as New ArrayList(0) me.Test_A( myArrayList )
4
by: Carlos Gomez | last post by:
In VB6 the default for passing variables was ByRef. It was faster and used less memory. Why did MS changed that? Are there any advantages using ByVal over ByRef? (other than ByVal impeding you from...
2
by: Lance Geeck | last post by:
I have many items that I lifted off from Microsoft's website several years ago. These samples were in VB6. I now want to convert an application to VB.NET. I am getting an error that says "As Any...
16
by: Richard | last post by:
Hi, I am passing a structure to a subroutine where the passed parameter has been declared as ByVal. However, changes made to the passed variable inside the subroutine flow through to the...
14
by: Niklas | last post by:
Hi What I have learned is that a variable is just a reference when dealing with Objects. Are you supposed to use ByVal or ByRef in functions? They produce the same result or have I missed...
6
by: **Developer** | last post by:
Notice below I sometimes used the "A" version. I found by cut-and-try that only the "A" version would work correctly. Anyone have a suggestion of why the "W" version would not work correctly? ...
0
by: Ken | last post by:
Newbie, having a problem upgrading from VB6 to dotNet. I am trying to call some subs from a NIST dll and I don't know how to call them in Net. I have used the Upgrade VB6 wizzard on my old...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.