Results 1 to 9 of 9

Thread: Arrrgh I cant do it :( How clever are you??

  1. #1

    Thread Starter
    Fanatic Member rudvs2's Avatar
    Join Date
    Mar 2001
    Location
    NZ
    Posts
    935

    Arrrgh I cant do it :( How clever are you??

    Hi all

    I am running win 2k

    Now i have been helpfully given a reference in c++ to a wonderfull little function in mapi32.dll

    I can use dependancy walker to view the function but to get any details on the function eg aliases it may be under or any other such info i need quikview which does not ship with win 2k and is not supported

    what I need to know if there are any gurus out there is where i can find the info i need to convert this function into a usable API call for vb

    here is the c++ info on the function

    Quick Info
    Header file: MAPIUTIL.H
    Implemented by: MAPI
    Called by: Client applications and service providers


    SCODE ScLocalPathFromUNC(
    LPSTR szUNC,
    LPSTR szLocal,
    UINT cchLocal
    );

    Parameters
    szUNC
    [in] A path in the format \\[server]\[share]\[path] of a file or directory.
    szLocal
    [out] A path in the format [drive:]\[path] of the same file or directory as for the szUNC parameter.
    cchLocal
    [in] Size of the buffer for the output string.
    See Also

    and here is what i have in vb so far

    VB Code:
    1. Declare Function ScLocalPathFromUNC Lib "mapi32" (ByVal szUNC As String _
    2. , ByVal szLocal As String, ByVal cchLocal As Integer) As Integer

    However when i execute the call it says header entry not found

    I know that the call is in mapi32 but it has a @12 after the name so i am assuming it must be able to be called with an alais to it. But blowed if i can work out what that might be

    So please calling all gurus lets see how clever you all are

  2. #2
    hellswraith
    Guest
    Not sure what you are saying, but there is a MAPI Control in VB. Look in the Component dialog box.

  3. #3

    Thread Starter
    Fanatic Member rudvs2's Avatar
    Join Date
    Mar 2001
    Location
    NZ
    Posts
    935
    That is no good to me hellswriath for the following reasons

    Mapi control in vb uses only a limited number of the functions contained in Mapi32.dll

    None of those functions does anything close to what the function does that i am after

    That is why i am having to try to convert the information over to a vb api call

    I know it can be done

    I just need 1 little peice of info and i should be away

  4. #4
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Write a dll in C++ containing that function (I have never done this).
    Baaaaaaaaah

  5. #5

    Thread Starter
    Fanatic Member rudvs2's Avatar
    Join Date
    Mar 2001
    Location
    NZ
    Posts
    935

    Well

    Originally Posted by Abdul

    Write a dll in C++ containing that function (I have never done this).
    Well I would ................. only I dont know the first thing about c++ so that blows that theory out of the water

    Any other ideas gents??

  6. #6

    Thread Starter
    Fanatic Member rudvs2's Avatar
    Join Date
    Mar 2001
    Location
    NZ
    Posts
    935
    anybody ??

  7. #7
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    Since the function uses strings, it probably has both a unicode and ANSI form. Try to alias the function as ScLocalPathFromUNCW (unicode) or ScLocalPathFromUNCA (ANSI). One of those may work.
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

  8. #8

    Thread Starter
    Fanatic Member rudvs2's Avatar
    Join Date
    Mar 2001
    Location
    NZ
    Posts
    935
    thanks for the advice Kaverin I tried both options but no joy

  9. #9

    Thread Starter
    Fanatic Member rudvs2's Avatar
    Join Date
    Mar 2001
    Location
    NZ
    Posts
    935
    okay I have now got it Finding and executing the API Function. I am getting an Integer Value Returned (which i assume is an error code of somesort) So it appears to be working

    here is the functioning API Declaration For any one who is interested

    VB Code:
    1. Declare Function ScLocalPathFromUNC Lib "mapi32" Alias "ScLocalPathFromUNC@12"  (ByVal szUNC As String _
    2. , ByVal szLocal As String, ByVal cchLocal As Integer) As Integer


    Thanks for the inspiration kaverin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width