Somehow get an array of UDTs into an activex dll ?
Ok.
I have an activexdll.
I also have a main application.
I want to pass an array of udts from the main app into the activex dll.
The activexdll has the udt declared inside it too.
I know i could save the info to a file, and pass the filename and let the activexdll load it from there.
I don't want to do that.
I don't seem to be allowed to pass the data as I could just inside my own main .exe
Another idea I've been toying with is passing a pointer and data length to the activexdll, and then perhaps it could use CopyMemory to copy a chunk of memory and somehow populate its udts with the info.
I'm pulling my hair out at this stage
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
Here is a buffer class, you need this class in your client EXE and your DLL...
Woka
PS. Just going for a tab, and will be abck in 2 mins and post code on how to use it
PPS. If you have a UDT in a module say:
VB Code:
Public Type WoofProps
PK_ID As Long
Bark As String * 20
End Type
Then you will also need a UDT for the buffer which is the length of the buffer...this can be found by:
VB Code:
Dim udtBlah As WoofProps
MsgBox LenB(udtBlah)/2
So your buffer UDT would be:
VB Code:
Public Type WoofData
Buffer * 22 'the 22 is worked out by LenB(udtBlah)/2 (I worked 22 out in my head, it MAY be wrong, check it)
End Type
each data type has a different length, so it's advisable to ALWAYS work this length out by using the above formula and not just adding them up in your head
Bugger
Just realise you wanted to pass the data TO a class, not retrieve it
Shouldn't be hard to reverse it, instead of assigniong objBuffer.GetStae to a function, just pass it to a sub in the DLL instead...