Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5957309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:22:57+00:00 2026-05-22T18:22:57+00:00

I was troubleshooting a problem where CreateFile couldn’t open an existing named pipe when

  • 0

I was troubleshooting a problem where CreateFile couldn’t open an existing named pipe when I found CreateFile() didn’t work well with the filename parameter. My code is:

Private Declare Function CreateFile Lib "kernel32" Alias "CreateFileW" ( _
ByVal lpFileName As String, _
ByVal dwDesiredAccess As Long, _
ByVal dwShareMode As Long, _
ByVal lpSecurityAttributes As Long, _
ByVal dwCreationDisposition As Long, _
ByVal dwFlagsAndAttributes As Long, _
ByVal hTemplateFile As Long) As Long

pipeHandle = CreateFile("C:\\test.txt", GENERIC_READ Or GENERIC_WRITE, 0&, 0&, CREATE_ALWAYS, 0&, 0&)

It does not create the file in C:\, instead, it creates a file in the current VB working directory, with a garbled filename. It seems CreateFile cannot recognize and parse the given filename string.

Why is this happening? I’m using VB6 on Windows 7 (used some trick to install it). Could that be causing the problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:22:57+00:00Added an answer on May 22, 2026 at 6:22 pm

    It’s been a long time, but I think this is an ansi/unicode thing. Try the CreateFileA function and see what happens. (Also, IIRC, you don’t escape the \ ….although again it’s been about 7 years since I seriously coded with VB6.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm troubleshooting a problem with creating Vista shortcuts. I want to make sure that
We are troubleshooting a SQL Server 2005 connection issue on a closed-source third-party ASP.NET
I haven't used regular expressions at all, so I'm having difficulty troubleshooting. I want
I'm having some problems with deploying my application and while troubleshooting, I came across
Just to begin, I've read Read text file in a folder and other troubleshooting
I'm new to ASP.NET-ville, be gentle. I have been troubleshooting a ASP.NET setup, where
I'm getting this error when I try and install node on my new mac
I get a timeout when using a SOAP client on a production server: System.Net.WebException:
Is there an easier way to debug IIS Url Rewrite configurations than this ?:
Whatever I try to compile in Cygwin I get the following output: checking for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.