Announcement

Collapse
No announcement yet.

help getting this API call to work

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • help getting this API call to work

    Im trying to call the WpPost() function in webpost.dll, which should be on most peoples systems.
    Its just my Microsoft-documentation-to-Powerbasic translation thats stopping it from working, but I can't see why...
    Here's what I've got, which is basically finished, it just doesnt work:
    Code:
    #COMPILE EXE "webpost.exe"
    #INCLUDE "win32api.inc"
    DECLARE FUNCTION WpPost LIB "webpost.dll" ALIAS "WpPostA" (hWnd AS LONG, _
                            dwNumLocalPaths AS LONG, _
                            pszLocalPaths AS LONG, _
                            pdwSiteNameBufLen AS LONG, _
                            szSiteName AS ASCIIZ * %MAX_PATH, _
                            pdwDestURLBufLen AS LONG, _
                            szDestURL AS ASCIIZ * %MAX_PATH, _
                            dwFlags AS LONG) AS LONG
     
    FUNCTION PBMAIN() AS LONG
    DIM hResult AS LONG
    hResult = WpPost(%NULL, 0, 0, %NULL, "", %NULL, "", %NULL)
    STDOUT "Result = " & STR$(hResult)
    END FUNCTION
    Searching MSDN found several good links including http://msdn.microsoft.com/library/de...api/wppost.asp
    Here are her declarations thats I translated from:
    Code:
    DWORD WpPost(
        HWND hWnd,
        DWORD dwNumLocalPaths,
        LPTSTR *pszLocalPaths,
        LPDWORD pdwSiteNameBufLen,
        LPTSTR szSiteName,
        LPDWORD pdwDestURLBufLen,
        LPTSTR szDestURL,
        DWORD dwFlags
    );
    Example usage:
    Code:
        HRESULT hResult = NOERROR;
        LPTSTR szLocalPaths = {"c:\\MyDir"};
        hResult = WpPost(NULL, 1, &szLocalPaths, 0, NULL, 0, NULL, 0);
    Apparently if you just call NULLs instead of giving it a site/url it will pop up a wizard to ask the user for site/url etc


    ------------------
    -

  • #2
    http://www.topqualityfreeware.com/wdll.shtml


    That's a good place to get it if not, going to play with this a bit...

    ------------------
    Scott
    Scott Turchin
    MCSE, MCP+I
    http://www.tngbbs.com
    ----------------------
    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

    Comment


    • #3
      You can try this.
      Code:
      #Compile Exe "webpost.exe"
      #Include "c:\pbdll60\winapi\win32api.inc"
      Declare Function WpPost LIB "webpost.dll" Alias "WpPostA" (ByVal hWnd As Long, _
      ByVal dwNumLocalPaths As Dword, _
      pszLocalPaths As Asciiz, _
      pdwSiteNameBufLen As Dword, _
      szSiteName As Asciiz, _
      pdwDestURLBufLen As Dword, _
      szDestURL As Asciiz, _
      ByVal dwFlags As Dword) As Dword
       
      Function PbMain() As Long
      Dim hResult As Long
      hResult = WpPost(%Null, 0, "", %Null, "", %Null, "", %Null)
      STDOUT "Result = " & Str$(hResult)
      End Function


      ------------------

      Comment


      • #4
        Mark, thankyou very much that's superb, invoking the wizard perfectly over here
        Ive got no idea how to use it to post a file though, other than "pszLocalPaths" there doesnt seem anywhere to specify a file to post, maybe WpPostEx is needed for that


        ------------------
        -

        Comment


        • #5
          This is weird, Win2k with Office 2k, except Office 97 chunk of Access (O2k access is not compatable with us yet)..

          I get that it cant' find a procedure point in PIPARSE.DLL, which I had to download....
          I also had to download the WEBPOST.DLL

          Seems like it is front page chunks?

          ------------------
          Scott
          Scott Turchin
          MCSE, MCP+I
          http://www.tngbbs.com
          ----------------------
          True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

          Comment


          • #6
            Code:
            pszLocalPaths AS DWORD, _
            ...because this is a pointer to an ASCIIZ, not an ASCIIZ proper.

            ------------------
            Tom Hanlin
            PowerBASIC Staff

            Comment

            Working...
            X