473,324 Members | 2,246 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.

Pass UDT as IntPtr

Bob

This is a VB.net 2003 question

I have a function called HandleES that expects a "ByVal lpES As IntPtr" paramter in My1.DLL

I would like to call the function from My2.DLL. In My2.DLL I've created the UDT

structure E
dim i as intege
dim j as intege
.... ..
end structur

dim MyES as E
ES.Initialize(

dim x as Intege
x = HandleES(... MyES ...

With function HandleES expecting lpES as IntPtr, how do I pass the address of a MyES in My2.DLL to my function in My1.DLL that takes the pointer to the UDT as a IntPtr

Thank you
Jul 21 '05 #1
1 1379
Bob,
With function HandleES expecting lpES as IntPtr, how do I pass the address of a MyES in My2.DLL to my function in My1.DLL that takes the pointer to the UDT as a IntPtr?


The easiest way would be to change the parameter type to ByRef As ES
and then pass in MyES directly.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jul 21 '05 #2

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

Similar topics

7
by: Yoramo | last post by:
hello I'm calling Win32 API methods like "SendMessage" in this method there are the lParam & wParam parameters, sometimes I need to pass a structure address in the lParam or wParam. the only...
8
by: TJ | last post by:
I need to be able to pass a pointer to a (managed code) Stream object to a COM method so it can serialize its data into the stream. I have a C# application that makes uses of Randolf Duke's...
6
by: juky | last post by:
Hi all, I have 2 applications one in VB.net and the other in VC6. I need to pass data between them. How can I do it? what's the best way to implement such communication ? Any comment will be...
5
by: | last post by:
Hi, In our system we get image buffers through a native dll as void*. We want to manage several of this blocks by C# objects an pass them wen needed to a native image processing library. What...
3
by: michelqa | last post by:
Hi, I already post a similar question last week without success. Ok I want to get the current text selection in a RICHEDIT control.. This can be easily done in C++ with EM_EXGETSEL message. I...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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.