Re: Help using a C dll function in VB
- From: "roidy" <roidy.parnell@xxxxxxxxxxxx>
- Date: Tue, 5 May 2009 17:40:43 +0100
Thanks Mike, although most of your post went right over my head, I`m still
pretty new to VB and .net, this is what I`m thinking. I`ll write a wrapper
around the MP4MetadataGetArtwork function in c as follows:-
char* MY_MP4GetArtwork(MP4FileHandle hFile,long *returnedsize)
{
char *art;
MP4GetMetadataArtwork(hfile,&art,&returnedsize,0);
return art;
}
now in VB can I do the following:-
Declare Function MY_MP4GetArtwork "libmp4v2.dll" (ByVal fhandle As UIntPtr,
_
, ByRef
returnedsize As UInteger) As IntPtr
dim size as UInteger
dim array() as byte = MY_MP4GetArtwork(fhandle,size)
Try not to laugh if thats total jibbarish and has no chance in hell of
working but like I say I`m pretty new to this and I`m at a loss at the
moment.
Rob
"Mike" <unknown@xxxxxxxxxx> wrote in message
news:ef$u41YzJHA.480@xxxxxxxxxxxxxxxxxxxxxxx
Mike wrote:
Start by creating a class library with the functions your want that will
map the libmp4v2.dll. They exposed .NET function do not need to be the
same prototype, it can turn the array, like above.
Sorry, I meant:
The exposed .NET functions do not need to be the same prototype, it
can return an array with no parameters or maybe just the file name,
like above.
If you need to keep file open, then the file handle is a private resource
in your MCL.DLL, which mean you have a classic file I/O wrapper:
private hfile as inptr
public shared function openmp4(byval fn as string) as boolean
hFile = open the file
end function
public shared function closemp4() as boolean
close the hfile
end function
public shared function readmp4() as byte()
read the hfile and return array
end function
.
- Follow-Ups:
- Re: Help using a C dll function in VB
- From: roidy
- Re: Help using a C dll function in VB
- References:
- Help using a C dll function in VB
- From: roidy
- Re: Help using a C dll function in VB
- From: Mike
- Re: Help using a C dll function in VB
- From: Mike
- Re: Help using a C dll function in VB
- From: roidy
- Re: Help using a C dll function in VB
- From: Mike
- Re: Help using a C dll function in VB
- From: Mike
- Help using a C dll function in VB
- Prev by Date: Re: Include Statement
- Next by Date: Re: Help using a C dll function in VB
- Previous by thread: Re: Help using a C dll function in VB
- Next by thread: Re: Help using a C dll function in VB
- Index(es):
Relevant Pages
|