Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. reagarding doubt with our project!!

reagarding doubt with our project!!

Scheduled Pinned Locked Moved C / C++ / MFC
javatutorial
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rowdy_vc
    wrote on last edited by
    #1

    Hi to ALL have one doubt regarding with my project . our project goal is to create one user dll(this dll create for VC 2005) and in this dll load another one java platform (via jni compiler.. it is possible) first up all .i was create DLL when i attached this dll in JNI compiler its perfectly running in windows XP (it gives return value '0')but in vista it is also running but it gives the return value '255' for example i give one method to our source : STDMETHODIMP CFileIO::fileExist(BSTR filePath, BYTE drive, SAFEARRAY* credential, BYTE* result) { *result = (BYTE)-1; // Prepare in case we fail at some point std::string completePath; // Drive and path combinaison try { validateCredential(credential); setPath(filePath, drive, completePath); // Assemble drive and path into complete path. } catch (std::exception& e) { log("fileExist", e.what(), EVENTLOG_ERROR_TYPE); return S_OK; } size_t zz = completePath.rfind("\\"); if (zz < completePath.length()) { std::string dirOnly = completePath.substr(0,zz); DWORD nBufferLength = 1024; // Anything longer would be doubtful TCHAR buffer[1024]; LPTSTR* lpFilePart = NULL; DWORD searchResult = SearchPath( dirOnly.c_str(), completePath.substr(zz+1, completePath.length()).c_str(), NULL, nBufferLength, buffer, lpFilePart ); if (searchResult > 0) { *result = (BYTE)1; } else { *result = (BYTE)0; } } return S_OK; } #define S_OK ((HRESULT)0x00000000L) #define S_FALSE ((HRESULT)0x00000001L) //in winerror.h This perfectly running in windows XP it gives the return value '0' but in vista it gives the reurn value '255' i need your answer..

    *****THANKS N ADVANCE**** Mathen.K (I WILL TRY MY LEVEL BEST )

    R D 2 Replies Last reply
    0
    • R rowdy_vc

      Hi to ALL have one doubt regarding with my project . our project goal is to create one user dll(this dll create for VC 2005) and in this dll load another one java platform (via jni compiler.. it is possible) first up all .i was create DLL when i attached this dll in JNI compiler its perfectly running in windows XP (it gives return value '0')but in vista it is also running but it gives the return value '255' for example i give one method to our source : STDMETHODIMP CFileIO::fileExist(BSTR filePath, BYTE drive, SAFEARRAY* credential, BYTE* result) { *result = (BYTE)-1; // Prepare in case we fail at some point std::string completePath; // Drive and path combinaison try { validateCredential(credential); setPath(filePath, drive, completePath); // Assemble drive and path into complete path. } catch (std::exception& e) { log("fileExist", e.what(), EVENTLOG_ERROR_TYPE); return S_OK; } size_t zz = completePath.rfind("\\"); if (zz < completePath.length()) { std::string dirOnly = completePath.substr(0,zz); DWORD nBufferLength = 1024; // Anything longer would be doubtful TCHAR buffer[1024]; LPTSTR* lpFilePart = NULL; DWORD searchResult = SearchPath( dirOnly.c_str(), completePath.substr(zz+1, completePath.length()).c_str(), NULL, nBufferLength, buffer, lpFilePart ); if (searchResult > 0) { *result = (BYTE)1; } else { *result = (BYTE)0; } } return S_OK; } #define S_OK ((HRESULT)0x00000000L) #define S_FALSE ((HRESULT)0x00000001L) //in winerror.h This perfectly running in windows XP it gives the return value '0' but in vista it gives the reurn value '255' i need your answer..

      *****THANKS N ADVANCE**** Mathen.K (I WILL TRY MY LEVEL BEST )

      R Offline
      R Offline
      Rajesh R Subramanian
      wrote on last edited by
      #2

      See here[^].

      Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

      N 1 Reply Last reply
      0
      • R Rajesh R Subramanian

        See here[^].

        Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

        N Offline
        N Offline
        Naveen
        wrote on last edited by
        #3

        I think he mean the value in *result

        nave [OpenedFileFinder]

        R 1 Reply Last reply
        0
        • N Naveen

          I think he mean the value in *result

          nave [OpenedFileFinder]

          R Offline
          R Offline
          Rajesh R Subramanian
          wrote on last edited by
          #4

          Naveen wrote:

          I think he mean the value in *result

          I don't get a thing of what he says. Please feel free to help him, if you understand his query. :)

          Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

          N 1 Reply Last reply
          0
          • R Rajesh R Subramanian

            Naveen wrote:

            I think he mean the value in *result

            I don't get a thing of what he says. Please feel free to help him, if you understand his query. :)

            Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

            N Offline
            N Offline
            Naveen
            wrote on last edited by
            #5

            I already did. See here[^]. He post the question under an article of mine :sigh:

            nave [OpenedFileFinder]

            1 Reply Last reply
            0
            • R rowdy_vc

              Hi to ALL have one doubt regarding with my project . our project goal is to create one user dll(this dll create for VC 2005) and in this dll load another one java platform (via jni compiler.. it is possible) first up all .i was create DLL when i attached this dll in JNI compiler its perfectly running in windows XP (it gives return value '0')but in vista it is also running but it gives the return value '255' for example i give one method to our source : STDMETHODIMP CFileIO::fileExist(BSTR filePath, BYTE drive, SAFEARRAY* credential, BYTE* result) { *result = (BYTE)-1; // Prepare in case we fail at some point std::string completePath; // Drive and path combinaison try { validateCredential(credential); setPath(filePath, drive, completePath); // Assemble drive and path into complete path. } catch (std::exception& e) { log("fileExist", e.what(), EVENTLOG_ERROR_TYPE); return S_OK; } size_t zz = completePath.rfind("\\"); if (zz < completePath.length()) { std::string dirOnly = completePath.substr(0,zz); DWORD nBufferLength = 1024; // Anything longer would be doubtful TCHAR buffer[1024]; LPTSTR* lpFilePart = NULL; DWORD searchResult = SearchPath( dirOnly.c_str(), completePath.substr(zz+1, completePath.length()).c_str(), NULL, nBufferLength, buffer, lpFilePart ); if (searchResult > 0) { *result = (BYTE)1; } else { *result = (BYTE)0; } } return S_OK; } #define S_OK ((HRESULT)0x00000000L) #define S_FALSE ((HRESULT)0x00000001L) //in winerror.h This perfectly running in windows XP it gives the return value '0' but in vista it gives the reurn value '255' i need your answer..

              *****THANKS N ADVANCE**** Mathen.K (I WILL TRY MY LEVEL BEST )

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              rowdy_vc++ wrote:

              i need your answer..

              What answer are you looking for? :confused: You are assigning -1 (which is 255 for unsigned types) to result. :rolleyes: Until it is assigned some other value, it will remain as such.

              "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

              "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups