FindMimeFromData

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

FindMimeFromData

drtau-3
I'm trying to implement the FindMimeFromData primitive in the
URLMonLibrary class.  I've defined the follwing method:

URLMonLibrary>>findMimeFromData: pBC pwzUrl: pwzUrl pBuffer: pBuffer
cbSize: cbSize pwzMimeProposed: pwzMimeProposed dwMimeFlags:
dwMimeFlags ppwzMimeOut: ppwzMimeOut dwReserved: dwReserved
        "Determines the Multipurpose Internet Mail Extensions (MIME) type
from the data provided.

        HRESULT FindMimeFromData(
                LPBC pBC,
                LPCWSTR pwzUrl,
                LPVOID pBuffer,
                DWORD cbSize,
                LPCWSTR pwzMimeProposed,
                DWORD dwMimeFlags,
                LPWSTR* ppwzMimeOut,
                DWORD dwReserved );"

        <stdcall: hresult FindMimeFromDataA lpvoid UnicodeString* lpvoid
dword UnicodeString* dword lpwstr* dword>
        ^self invalidCall

but when I invoke it with:

mime := String new: 50.
URLMonLibrary default findMimeFromData: nil pwzUrl:
'http://www.yahoo.com' pBuffer: nil cbSize: 0
 pwzMimeProposed: nil dwMimeFlags: 0 ppwzMimeOut: mime dwReserved: 0

I get the error: "The specified procedure could not be found."  Any
ideas what I'm doing wrong?  Any help would be appreciated.


Reply | Threaded
Open this post in threaded view
|

Re: FindMimeFromData

Bill Dargel
drtau wrote:

> I get the error: "The specified procedure could not be found."  Any
> ideas what I'm doing wrong?  Any help would be appreciated.

Looking in urlmon.h, I see that FindMimeFromData, unlike many other
functions, does not have the 'A' and 'W' variations for ascii (byte) and
unicode (word) string arguments. Try using 'FindMimeFromData' (without the
'A') in the stdcall.

regards,
-Bill

-------------------------------------------
Bill Dargel            [hidden email]
Shoshana Technologies
100 West Joy Road, Ann Arbor, MI 48105  USA