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. Visual Basic
  4. How to test for Path Too Long?

How to test for Path Too Long?

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
2 Posts 2 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.
  • J Offline
    J Offline
    JWhizzz
    wrote on last edited by
    #1

    I'd like to ensure a string I'm manipulating has not become too long to be a valid path. Can anyone shed some light on this for me? Thanks, Jeff

    G 1 Reply Last reply
    0
    • J JWhizzz

      I'd like to ensure a string I'm manipulating has not become too long to be a valid path. Can anyone shed some light on this for me? Thanks, Jeff

      G Offline
      G Offline
      Garth J Lancaster
      wrote on last edited by
      #2

      Most win32 c++ compilers have a _MAX_PATH constant defined - I'd search the Web/MSDN and see what this is defined as ... I would have thought VB had a function sitting over a win32 api that returns a path, the MSDN specs for that API should eventually yield that max it returns ... ps .. I took this >> from the MSDN CreateDirectory API page (The GetCurrentDirectory function doesnt show what you're looking for, unfortunately) .. "There is a default string size limit for paths of 248 characters. This limit is related to how the CreateDirectory function parses paths. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\\?\" to the path. For more information, see Naming a File." so depending on what you define _MAX_PATH to be, you can just check the string length against it .. Sorry, that probably doesnt help much

      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