473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

How can this MicroSoft Example to get short file names be made to

This is an example that is supposed to work in VB
http://support.microsoft.com/kb/175512/en-us
After spending a couple of hours downloading and installing VB Express 2008
after someone told me it was easy, the thing doesn't work any better.
These two instruction lines are not functional
3. Place a Common Dialog control on the form.
4. From the Insert menu, select Module to add a single code module to the
project.
There is no Common Dialog (or CommonDialog) control in the toolbox to put
on the form. There is no Insert menu, although Add Module appears on the
Project menu item.
I don't need this code to work and for VB to work (I hate the excessive
and inconvenient complexity and bad organization of VB) I just want a small
program that will work directly under windows, browse a file list and give
the exact, correct short (8.3 form) file name for that file.
Sep 29 '08 #1
23 2442
On 2008-09-29, Mike1942 <Mi******@discussions.microsoft.comwrote:
This is an example that is supposed to work in VB
http://support.microsoft.com/kb/175512/en-us
After spending a couple of hours downloading and installing VB Express 2008
after someone told me it was easy, the thing doesn't work any better.
These two instruction lines are not functional
3. Place a Common Dialog control on the form.
4. From the Insert menu, select Module to add a single code module to the
project.
There is no Common Dialog (or CommonDialog) control in the toolbox to put
on the form. There is no Insert menu, although Add Module appears on the
Project menu item.
I don't need this code to work and for VB to work (I hate the excessive
and inconvenient complexity and bad organization of VB) I just want a small
program that will work directly under windows, browse a file list and give
the exact, correct short (8.3 form) file name for that file.
That example was not written for VB.NET. Here is a quick example for VB.NET:

Option Strict On
Option Explicit On

Imports System
Imports System.Windows.Forms
Imports System.Text

Public Class MainForm
Inherits System.Windows.Forms.Form

Private Declare Auto Function GetShortPathName Lib "kernel32" ( _
ByVal lpszLongPath As String, _
ByVal lpszShortPath As StringBuilder, _
ByVal cchBuffer As Integer) As Integer

Public Sub New()
InitializeComponent()
End Sub

'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()_
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()_
Private Sub InitializeComponent()
Me.openFileDialog = New System.Windows.Forms.OpenFileDialog
Me.btnFileSelect = New System.Windows.Forms.Button
Me.btnCopy = New System.Windows.Forms.Button
Me.txtShortName = New System.Windows.Forms.TextBox
Me.SuspendLayout()
'
'btnFileSelect
'
Me.btnFileSelect.Location = New System.Drawing.Point(338, 10)
Me.btnFileSelect.Name = "btnFileSelect"
Me.btnFileSelect.Size = New System.Drawing.Size(26, 23)
Me.btnFileSelect.TabIndex = 2
Me.btnFileSelect.Text = "..."
Me.btnFileSelect.UseVisualStyleBackColor = True
'
'btnCopy
'
Me.btnCopy.Location = New System.Drawing.Point(289, 36)
Me.btnCopy.Name = "btnCopy"
Me.btnCopy.Size = New System.Drawing.Size(75, 23)
Me.btnCopy.TabIndex = 3
Me.btnCopy.Text = "Copy"
Me.btnCopy.UseVisualStyleBackColor = True
'
'txtShortName
'
Me.txtShortName.Location = New System.Drawing.Point(12, 12)
Me.txtShortName.Name = "txtShortName"
Me.txtShortName.Size = New System.Drawing.Size(320, 20)
Me.txtShortName.TabIndex = 4
'
'MainForm
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(376, 71)
Me.Controls.Add(Me.txtShortName)
Me.Controls.Add(Me.btnCopy)
Me.Controls.Add(Me.btnFileSelect)
Me.Name = "MainForm"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScree n
Me.Text = "Select File Name"
Me.ResumeLayout(False)
Me.PerformLayout()

End Sub
Friend WithEvents openFileDialog As System.Windows.Forms.OpenFileDialog
Friend WithEvents btnFileSelect As System.Windows.Forms.Button
Friend WithEvents btnCopy As System.Windows.Forms.Button
Friend WithEvents txtShortName As System.Windows.Forms.TextBox

Private Sub btnFileSelect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFileSelect.Click
If openFileDialog.ShowDialog(Me) = Windows.Forms.DialogResult.OK Then
Dim longPath As String = openFileDialog.FileName
Dim requiredSize As Integer = GetShortPathName(longPath, Nothing, 0)
Dim buffer As New StringBuilder(requiredSize)

Dim result As Integer = GetShortPathName(longPath, buffer, buffer.Capacity)
txtShortName.Text = buffer.ToString()
End If
End Sub

Private Sub btnCopy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCopy.Click
Clipboard.SetData(DataFormats.Text, txtShortName.Text)
End Sub
End Class

HTH

--
Tom Shelton
Sep 29 '08 #2
Apparently, you didn't see the "Applies to" section of that article, which
clearly indicates that the article isn't related to any .NET version of
Visual Studio.

APPLIES TO
. Microsoft Visual Basic 5.0 Control Creation Edition
. Microsoft Visual Basic 5.0 Learning Edition
. Microsoft Visual Basic 5.0 Professional Edition
. Microsoft Visual Basic 5.0 Enterprise Edition
. Microsoft Visual Basic 4.0 Standard Edition
. Microsoft Visual Basic 4.0 Professional Edition
. Microsoft Visual Basic 4.0 32-Bit Enterprise Edition
. Microsoft Visual Basic 6.0 Learning Edition
. Microsoft Visual Basic 6.0 Professional Edition
. Microsoft Visual Basic 6.0 Enterprise Edition


"Mike1942" <Mi******@discussions.microsoft.comwrote in message
news:79**********************************@microsof t.com...
This is an example that is supposed to work in VB
http://support.microsoft.com/kb/175512/en-us
After spending a couple of hours downloading and installing VB Express
2008
after someone told me it was easy, the thing doesn't work any better.
These two instruction lines are not functional
3. Place a Common Dialog control on the form.
4. From the Insert menu, select Module to add a single code module to the
project.
There is no Common Dialog (or CommonDialog) control in the toolbox to put
on the form. There is no Insert menu, although Add Module appears on the
Project menu item.
I don't need this code to work and for VB to work (I hate the excessive
and inconvenient complexity and bad organization of VB) I just want a
small
program that will work directly under windows, browse a file list and give
the exact, correct short (8.3 form) file name for that file.

Sep 30 '08 #3
"Mike1942" <Mi******@discussions.microsoft.comwrote in message
news:79**********************************@microsof t.com...
I don't need this code to work and for VB to work (I hate the excessive
and inconvenient complexity and bad organization of VB)
Actually, you're just a few years late. The code in that article is intended
to run in VB4 thru VB6. That's when the "product" became "something else"
and lost a lot of its RAD capabilities... not to mention losing its ability
to compile Win32 code and over 1/2 of its "VBcentric" debugging
capabilities..

I agree with your "inconvenient complexity and bad organization" statement.
Just more proof that "new" doesn't always mean "better"... just get used to
waiting long periods of time to start the IDE and any apps you create. They
start up faster once the flamework's in ram, but until then, it's a pig.

If you write programs for a hobby or just want to get some work done without
dealing with tons of extra *junk* that's good only for web apps (the .Net in
the products name is a dead give-a-way), try and find a copy of VB6 on the
web somewhere. It'll save you hours of development time and the apps will be
every bit as reliable as anything you create in dotNet... plus, they'll load
and run faster... especially if you don't have a 10ghz PC and 20gb of
ram.... it won't be free, though... MS didn't have to give that away free to
get people to use it, like they do with dotNet.

What ever the cost, it'll pay for itself quickly and save you a lot of
frustration.

If/when you find VB6, head over to the microsoft.public.vb groups for
help... and here's nearly 5,000,000 lines of code that's ready to "plug and
play" (and this is just one site!)

Code: 4,983,574. lines
http://www.planetsourcecode.com/vb/default.asp?lngWId=1

They /do/ have .Net code, with C#, B# and the rest all laid out in a pile,
but only 1/10th the samples they do with VB6... and who knows if any of it
works or not.

Code: 587,016. lines
http://www.planetsourcecode.com/vb/d....asp?lngWId=10
Sep 30 '08 #4
Mike,

It seems that people want to show you that the actual VB versions are
difficult. It is not. I have written the same with slightly changed code
based on VB 2008 from Tom, in the way as 99% does this. It seems that some
like Tom do this completely by hand, however be aware this is basicly the
code from Tom (I don't know as much about API's as him).

To do,

Open a new WindowsForm application
Drag from the toolbox a Button on the form
Drag an OpenFileDialog control on the form (it will show up at the bottom
of the surface).

Click on the button, the code will appear, fill in what is not yet in that
code

\\\
Public Class Form1
Private Declare Auto Function GetShortPathName Lib "kernel32" ( _
ByVal lpszLongPath As String, _
ByVal lpszShortPath As System.Text.StringBuilder, _
ByVal cchBuffer As Integer) As Integer
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim longPath = OpenFileDialog1.FileName
Dim requiredSize = GetShortPathName(longPath, Nothing, 0)
Dim buffer As New System.Text.StringBuilder(requiredSize)
Dim result = GetShortPathName(longPath, buffer, buffer.Capacity)
Clipboard.SetData(DataFormats.Text, buffer.ToString)
End If
End Sub
End Class

///

You are ready, as you can see very much easier than the vintage VB sample
you was looking at before, while here is even checked if the OK button is
clicked in the OpenFileDialog.

Cor


"Mike1942" <Mi******@discussions.microsoft.comschreef in bericht
news:79**********************************@microsof t.com...
This is an example that is supposed to work in VB
http://support.microsoft.com/kb/175512/en-us
After spending a couple of hours downloading and installing VB Express
2008
after someone told me it was easy, the thing doesn't work any better.
These two instruction lines are not functional
3. Place a Common Dialog control on the form.
4. From the Insert menu, select Module to add a single code module to the
project.
There is no Common Dialog (or CommonDialog) control in the toolbox to put
on the form. There is no Insert menu, although Add Module appears on the
Project menu item.
I don't need this code to work and for VB to work (I hate the excessive
and inconvenient complexity and bad organization of VB) I just want a
small
program that will work directly under windows, browse a file list and give
the exact, correct short (8.3 form) file name for that file.
Sep 30 '08 #5
On Sep 30, 7:48*am, "Cor Ligthert[MVP]" <notmyfirstn...@planet.nl>
wrote:
Mike,

It seems that people want to show you that the actual VB versions are
difficult. It is not. I have written the same with slightly changed code
based on VB 2008 from Tom, in the way as 99% does this. It seems that some
like Tom do this completely by hand, however be aware this is basicly the
code from Tom (I don't know as much about API's as him).

To do,

Open a new WindowsForm application
Drag from the toolbox a Button on the form
Drag *an OpenFileDialog control on the form (it will show up at the bottom
of the surface).

Click on the button, the code will appear, fill in what is not yet in that
code

\\\
Public Class Form1
* * Private Declare Auto Function GetShortPathName Lib "kernel32" ( _
* * *ByVal lpszLongPath As String, _
* * *ByVal lpszShortPath As System.Text.StringBuilder, _
* * *ByVal cchBuffer As Integer) As Integer

* * Private Sub Button1_Click(ByVal sender As System.Object, _
* * * * ByVal e As System.EventArgs) Handles Button1.Click
* * * * If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
* * * * * * Dim longPath = OpenFileDialog1.FileName
* * * * * * Dim requiredSize = GetShortPathName(longPath, Nothing, 0)
* * * * * * Dim buffer As New System.Text.StringBuilder(requiredSize)
* * * * * * Dim result = GetShortPathName(longPath, buffer,buffer.Capacity)
* * * * * * Clipboard.SetData(DataFormats.Text, buffer.ToString)
* * * * End If
* * End Sub
End Class

///

You are ready, as you can see very much easier than the vintage VB sample
you was looking at before, while here is even checked if the OK button is
clicked in the OpenFileDialog.

Cor

"Mike1942" <Mike1...@discussions.microsoft.comschreef in berichtnews:79**********************************@m icrosoft.com...
This is an example that is supposed to work in VB
http://support.microsoft.com/kb/175512/en-us
After spending a couple of hours downloading and installing VB Express
2008
after someone told me it was easy, the thing doesn't work any better.
*These two instruction lines are not functional
3. Place a Common Dialog control on the form.
4. From the Insert menu, select Module to add a single code module to the
project.
*There is no Common Dialog (or CommonDialog) control in the toolbox to put
on the form. *There is no Insert menu, although Add Module appears onthe
Project menu item.
*I don't need this code to work and for VB to work (I hate the excessive
and inconvenient complexity and bad organization of VB) * I just wanta
small
program that will work directly under windows, browse a file list and give
the exact, correct short (8.3 form) file name for that file.

It would be better to revise your code by declaring "requiredSize"
variable as Integer, because StringBuilder's contructor expects an
Integer, not to get an "Overload resolution failed because no
accessible 'New' can be called without a narrowing conversion" as
follows:

'-------------------------
Public Class Form1
Private Declare Auto Function GetShortPathName Lib "kernel32" ( _
ByVal lpszLongPath As String, _
ByVal lpszShortPath As System.Text.StringBuilder, _
ByVal cchBuffer As Integer) As Integer

Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click

If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then

Dim longPath = OpenFileDialog1.FileName
Dim requiredSize As Integer = GetShortPathName(longPath, Nothing, 0)
Dim buffer As New System.Text.StringBuilder(requiredSize)
Dim result = GetShortPathName(longPath, buffer, buffer.Capacity)
Clipboard.SetData(DataFormats.Text, buffer.ToString)

End If

End Sub

End Class
'---------------------------

Onur Güzel
Sep 30 '08 #6
Onur,

May I ask you what is your intention to add messages direct to mine, this is
simple code made by Tom, as is wrote in the message, however I tried to show
it in a more for the user applicable way to prevent that he would be afraid
from a message in this message thread.

So as you have comments, please point it to Toms message. As I wrote
already, he knows much more about API's than me.

By the way, I tried this code with VS 2008, as the OP is using, did you do
the same?

Cor

"kimiraikkonen" <ki*************@gmail.comschreef in bericht
news:58**********************************@l42g2000 hsc.googlegroups.com...
On Sep 30, 7:48 am, "Cor Ligthert[MVP]" <notmyfirstn...@planet.nl>
wrote:
Mike,

It seems that people want to show you that the actual VB versions are
difficult. It is not. I have written the same with slightly changed code
based on VB 2008 from Tom, in the way as 99% does this. It seems that some
like Tom do this completely by hand, however be aware this is basicly the
code from Tom (I don't know as much about API's as him).

To do,

Open a new WindowsForm application
Drag from the toolbox a Button on the form
Drag an OpenFileDialog control on the form (it will show up at the bottom
of the surface).

Click on the button, the code will appear, fill in what is not yet in that
code

\\\
Public Class Form1
Private Declare Auto Function GetShortPathName Lib "kernel32" ( _
ByVal lpszLongPath As String, _
ByVal lpszShortPath As System.Text.StringBuilder, _
ByVal cchBuffer As Integer) As Integer

Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim longPath = OpenFileDialog1.FileName
Dim requiredSize = GetShortPathName(longPath, Nothing, 0)
Dim buffer As New System.Text.StringBuilder(requiredSize)
Dim result = GetShortPathName(longPath, buffer, buffer.Capacity)
Clipboard.SetData(DataFormats.Text, buffer.ToString)
End If
End Sub
End Class

///

You are ready, as you can see very much easier than the vintage VB sample
you was looking at before, while here is even checked if the OK button is
clicked in the OpenFileDialog.

Cor

"Mike1942" <Mike1...@discussions.microsoft.comschreef in
berichtnews:79**********************************@m icrosoft.com...
This is an example that is supposed to work in VB
http://support.microsoft.com/kb/175512/en-us
After spending a couple of hours downloading and installing VB Express
2008
after someone told me it was easy, the thing doesn't work any better.
These two instruction lines are not functional
3. Place a Common Dialog control on the form.
4. From the Insert menu, select Module to add a single code module to
the
project.
There is no Common Dialog (or CommonDialog) control in the toolbox to
put
on the form. There is no Insert menu, although Add Module appears on the
Project menu item.
I don't need this code to work and for VB to work (I hate the excessive
and inconvenient complexity and bad organization of VB) I just want a
small
program that will work directly under windows, browse a file list and
give
the exact, correct short (8.3 form) file name for that file.

It would be better to revise your code by declaring "requiredSize"
variable as Integer, because StringBuilder's contructor expects an
Integer, not to get an "Overload resolution failed because no
accessible 'New' can be called without a narrowing conversion" as
follows:

'-------------------------
Public Class Form1
Private Declare Auto Function GetShortPathName Lib "kernel32" ( _
ByVal lpszLongPath As String, _
ByVal lpszShortPath As System.Text.StringBuilder, _
ByVal cchBuffer As Integer) As Integer

Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click

If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then

Dim longPath = OpenFileDialog1.FileName
Dim requiredSize As Integer = GetShortPathName(longPath, Nothing, 0)
Dim buffer As New System.Text.StringBuilder(requiredSize)
Dim result = GetShortPathName(longPath, buffer, buffer.Capacity)
Clipboard.SetData(DataFormats.Text, buffer.ToString)

End If

End Sub

End Class
'---------------------------

Onur Güzel
Sep 30 '08 #7
On Sep 30, 12:18*pm, "Cor Ligthert [MVP]" <notmyfirstn...@planet.nl>
wrote:
Onur,

May I ask you what is your intention to add messages direct to mine, thisis
simple code made by Tom, as is wrote in the message, however I tried to show
it in a more for the user applicable way to prevent that he would be afraid
from a message in this message thread.

So as you have comments, please point it to Toms message. As I wrote
already, he knows much more about API's than me.

By the way, I tried this code with VS 2008, as the OP is using, did you do
the same?

Cor

"kimiraikkonen" <kimiraikkone...@gmail.comschreef in berichtnews:58**********************************@l 42g2000hsc.googlegroups.com...
On Sep 30, 7:48 am, "Cor Ligthert[MVP]" <notmyfirstn...@planet.nl>
wrote:
Mike,
It seems that people want to show you that the actual VB versions are
difficult. It is not. I have written the same with slightly changed code
based on VB 2008 from Tom, in the way as 99% does this. It seems that some
like Tom do this completely by hand, however be aware this is basicly the
code from Tom (I don't know as much about API's as him).
To do,
Open a new WindowsForm application
Drag from the toolbox a Button on the form
Drag an OpenFileDialog control on the form (it will show up at the bottom
of the surface).
Click on the button, the code will appear, fill in what is not yet in that
code
\\\
Public Class Form1
Private Declare Auto Function GetShortPathName Lib "kernel32" ( _
ByVal lpszLongPath As String, _
ByVal lpszShortPath As System.Text.StringBuilder, _
ByVal cchBuffer As Integer) As Integer
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim longPath = OpenFileDialog1.FileName
Dim requiredSize = GetShortPathName(longPath, Nothing, 0)
Dim buffer As New System.Text.StringBuilder(requiredSize)
Dim result = GetShortPathName(longPath, buffer, buffer.Capacity)
Clipboard.SetData(DataFormats.Text, buffer.ToString)
End If
End Sub
End Class
///
You are ready, as you can see very much easier than the vintage VB sample
you was looking at before, while here is even checked if the OK button is
clicked in the OpenFileDialog.
Cor
"Mike1942" <Mike1...@discussions.microsoft.comschreef in
berichtnews:79**********************************@m icrosoft.com...
This is an example that is supposed to work in VB
>http://support.microsoft.com/kb/175512/en-us
After spending a couple of hours downloading and installing VB Express
2008
after someone told me it was easy, the thing doesn't work any better.
These two instruction lines are not functional
3. Place a Common Dialog control on the form.
4. From the Insert menu, select Module to add a single code module to
the
project.
There is no Common Dialog (or CommonDialog) control in the toolbox to
put
on the form. There is no Insert menu, although Add Module appears on the
Project menu item.
I don't need this code to work and for VB to work (I hate the excessive
and inconvenient complexity and bad organization of VB) I just want a
small
program that will work directly under windows, browse a file list and
give
the exact, correct short (8.3 form) file name for that file.

It would be better to revise your code by declaring "requiredSize"
variable as Integer, because StringBuilder's contructor expects an
Integer, not to get an "Overload resolution failed because no
accessible 'New' can be called without a narrowing conversion" as
follows:

'-------------------------
Public Class Form1
Private Declare Auto Function GetShortPathName Lib "kernel32" ( _
ByVal lpszLongPath As String, _
ByVal lpszShortPath As System.Text.StringBuilder, _
ByVal cchBuffer As Integer) As Integer

Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click

If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then

Dim longPath = OpenFileDialog1.FileName
Dim requiredSize As Integer = GetShortPathName(longPath, Nothing, 0)
Dim buffer As New System.Text.StringBuilder(requiredSize)
Dim result *= GetShortPathName(longPath, buffer, buffer.Capacity)
Clipboard.SetData(DataFormats.Text, buffer.ToString)

End If

End Sub

End Class
'---------------------------

Onur Güzel
Cor,
There is no any kind of intention regarding to a person. And the
important thing is that the code above which wasn't working as i tried
on VB 2005 with .NET 2.0, and declaring "requiredSize" variable As
Integer solved the problem. That's why i needed to inform to provide a
little help if anyone else experiences that error:

"Overload resolution failed because no accessible 'New' can be called
without a narrowing conversion:
'Public Sub New(value As String)': Argument matching parameter 'value'
narrows from 'Object' to 'String'.
'Public Sub New(capacity As Integer)': Argument matching parameter
'capacity' narrows from 'Object' to 'Integer'."

You can try the previous version or the one that you posted to
reproduce error which i meant above.

BTW, thanks Tom posting that snippet.

Onur Güzel
Sep 30 '08 #8
The code should give an error in version 2005

Reread my first sententence of the first messages. I did not write that for
fun.

As you want to try that part, it is just copied from Tom's code so you
copied the code from that.

(In fact was the main change to remove the "as" clauses, as far as I
remember me Tom and I have an other opinion about that, I wrote that I
changed his code).

Cor
"kimiraikkonen" <ki*************@gmail.comschreef in bericht
news:44**********************************@x35g2000 hsb.googlegroups.com...
On Sep 30, 12:18 pm, "Cor Ligthert [MVP]" <notmyfirstn...@planet.nl>
wrote:
Onur,

May I ask you what is your intention to add messages direct to mine, this
is
simple code made by Tom, as is wrote in the message, however I tried to
show
it in a more for the user applicable way to prevent that he would be
afraid
from a message in this message thread.

So as you have comments, please point it to Toms message. As I wrote
already, he knows much more about API's than me.

By the way, I tried this code with VS 2008, as the OP is using, did you do
the same?

Cor

"kimiraikkonen" <kimiraikkone...@gmail.comschreef in
berichtnews:58**********************************@l 42g2000hsc.googlegroups.com...
On Sep 30, 7:48 am, "Cor Ligthert[MVP]" <notmyfirstn...@planet.nl>
wrote:
Mike,
It seems that people want to show you that the actual VB versions are
difficult. It is not. I have written the same with slightly changed code
based on VB 2008 from Tom, in the way as 99% does this. It seems that
some
like Tom do this completely by hand, however be aware this is basicly
the
code from Tom (I don't know as much about API's as him).
To do,
Open a new WindowsForm application
Drag from the toolbox a Button on the form
Drag an OpenFileDialog control on the form (it will show up at the
bottom
of the surface).
Click on the button, the code will appear, fill in what is not yet in
that
code
\\\
Public Class Form1
Private Declare Auto Function GetShortPathName Lib "kernel32" ( _
ByVal lpszLongPath As String, _
ByVal lpszShortPath As System.Text.StringBuilder, _
ByVal cchBuffer As Integer) As Integer
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim longPath = OpenFileDialog1.FileName
Dim requiredSize = GetShortPathName(longPath, Nothing, 0)
Dim buffer As New System.Text.StringBuilder(requiredSize)
Dim result = GetShortPathName(longPath, buffer, buffer.Capacity)
Clipboard.SetData(DataFormats.Text, buffer.ToString)
End If
End Sub
End Class
///
You are ready, as you can see very much easier than the vintage VB
sample
you was looking at before, while here is even checked if the OK button
is
clicked in the OpenFileDialog.
Cor
"Mike1942" <Mike1...@discussions.microsoft.comschreef in
berichtnews:79**********************************@m icrosoft.com...
This is an example that is supposed to work in VB
>http://support.microsoft.com/kb/175512/en-us
After spending a couple of hours downloading and installing VB Express
2008
after someone told me it was easy, the thing doesn't work any better.
These two instruction lines are not functional
3. Place a Common Dialog control on the form.
4. From the Insert menu, select Module to add a single code module to
the
project.
There is no Common Dialog (or CommonDialog) control in the toolbox to
put
on the form. There is no Insert menu, although Add Module appears on
the
Project menu item.
I don't need this code to work and for VB to work (I hate the
excessive
and inconvenient complexity and bad organization of VB) I just want a
small
program that will work directly under windows, browse a file list and
give
the exact, correct short (8.3 form) file name for that file.

It would be better to revise your code by declaring "requiredSize"
variable as Integer, because StringBuilder's contructor expects an
Integer, not to get an "Overload resolution failed because no
accessible 'New' can be called without a narrowing conversion" as
follows:

'-------------------------
Public Class Form1
Private Declare Auto Function GetShortPathName Lib "kernel32" ( _
ByVal lpszLongPath As String, _
ByVal lpszShortPath As System.Text.StringBuilder, _
ByVal cchBuffer As Integer) As Integer

Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click

If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then

Dim longPath = OpenFileDialog1.FileName
Dim requiredSize As Integer = GetShortPathName(longPath, Nothing, 0)
Dim buffer As New System.Text.StringBuilder(requiredSize)
Dim result = GetShortPathName(longPath, buffer, buffer.Capacity)
Clipboard.SetData(DataFormats.Text, buffer.ToString)

End If

End Sub

End Class
'---------------------------

Onur Güzel
Cor,
There is no any kind of intention regarding to a person. And the
important thing is that the code above which wasn't working as i tried
on VB 2005 with .NET 2.0, and declaring "requiredSize" variable As
Integer solved the problem. That's why i needed to inform to provide a
little help if anyone else experiences that error:

"Overload resolution failed because no accessible 'New' can be called
without a narrowing conversion:
'Public Sub New(value As String)': Argument matching parameter 'value'
narrows from 'Object' to 'String'.
'Public Sub New(capacity As Integer)': Argument matching parameter
'capacity' narrows from 'Object' to 'Integer'."

You can try the previous version or the one that you posted to
reproduce error which i meant above.

BTW, thanks Tom posting that snippet.

Onur Güzel
Sep 30 '08 #9
Wow! I'm not even going to begin to pick over what's wrong with this
post - - I don't have that kind of time.
"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.comwrote in message
news:eY**************@TK2MSFTNGP02.phx.gbl...
"Mike1942" <Mi******@discussions.microsoft.comwrote in message
news:79**********************************@microsof t.com...
> I don't need this code to work and for VB to work (I hate the excessive
and inconvenient complexity and bad organization of VB)

Actually, you're just a few years late. The code in that article is
intended to run in VB4 thru VB6. That's when the "product" became
"something else" and lost a lot of its RAD capabilities... not to mention
losing its ability to compile Win32 code and over 1/2 of its "VBcentric"
debugging capabilities..

I agree with your "inconvenient complexity and bad organization"
statement. Just more proof that "new" doesn't always mean "better"... just
get used to waiting long periods of time to start the IDE and any apps you
create. They start up faster once the flamework's in ram, but until then,
it's a pig.

If you write programs for a hobby or just want to get some work done
without dealing with tons of extra *junk* that's good only for web apps
(the .Net in the products name is a dead give-a-way), try and find a copy
of VB6 on the web somewhere. It'll save you hours of development time and
the apps will be every bit as reliable as anything you create in dotNet...
plus, they'll load and run faster... especially if you don't have a 10ghz
PC and 20gb of ram.... it won't be free, though... MS didn't have to give
that away free to get people to use it, like they do with dotNet.

What ever the cost, it'll pay for itself quickly and save you a lot of
frustration.

If/when you find VB6, head over to the microsoft.public.vb groups for
help... and here's nearly 5,000,000 lines of code that's ready to "plug
and play" (and this is just one site!)

Code: 4,983,574. lines
http://www.planetsourcecode.com/vb/default.asp?lngWId=1

They /do/ have .Net code, with C#, B# and the rest all laid out in a pile,
but only 1/10th the samples they do with VB6... and who knows if any of it
works or not.

Code: 587,016. lines
http://www.planetsourcecode.com/vb/d....asp?lngWId=10

Sep 30 '08 #10
On 2008-09-30, Cor Ligthert[MVP] <no************@planet.nlwrote:
Mike,

It seems that people want to show you that the actual VB versions are
difficult. It is not. I have written the same with slightly changed code
based on VB 2008 from Tom, in the way as 99% does this. It seems that some
like Tom do this completely by hand, however be aware this is basicly the
code from Tom (I don't know as much about API's as him).
I didn't write all of that by hand - in fact, the code I wrote was what you
basically have below. I simply combined the generated code with my code, so
the OP could copy and paste a complete working example. Sorry, if that added
to the confusion - I should have mentioned that.

--
Tom Shelton
Sep 30 '08 #11
Tom,

I thought so but had to write something. I hope you have no problem that I
tried to make your code more like the code in the sample?

:-)

Cor

"Tom Shelton" <to*********@comcastXXXXXXX.netschreef in bericht
news:9d******************************@comcast.com. ..
On 2008-09-30, Cor Ligthert[MVP] <no************@planet.nlwrote:
>Mike,

It seems that people want to show you that the actual VB versions are
difficult. It is not. I have written the same with slightly changed code
based on VB 2008 from Tom, in the way as 99% does this. It seems that
some
like Tom do this completely by hand, however be aware this is basicly the
code from Tom (I don't know as much about API's as him).

I didn't write all of that by hand - in fact, the code I wrote was what
you
basically have below. I simply combined the generated code with my code,
so
the OP could copy and paste a complete working example. Sorry, if that
added
to the confusion - I should have mentioned that.

--
Tom Shelton
Sep 30 '08 #12
"Scott M." <s-***@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
Wow! I'm not even going to begin to pick over what's wrong with this
post - - I don't have that kind of time.
Yep... I agree... it would take days to find something wrong with that post.

--
Ken Halter
Part time groupie
Sep 30 '08 #13
That's what I'd expect someone with your level of understanding of .NET to
say.
"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
"Scott M." <s-***@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>Wow! I'm not even going to begin to pick over what's wrong with this
post - - I don't have that kind of time.

Yep... I agree... it would take days to find something wrong with that
post.

--
Ken Halter
Part time groupie

Sep 30 '08 #14
On 2008-09-30, Cor Ligthert[MVP] <no************@planet.nlwrote:
Tom,

I thought so but had to write something. I hope you have no problem that I
tried to make your code more like the code in the sample?

:-)

Cor
No, I don't have a problem with it - except for removing the As from my Dim
statements :)

--
Tom Shelton
Sep 30 '08 #15
"Scott M." <s-***@nospam.nospamwrote in message
news:eZ*************@TK2MSFTNGP06.phx.gbl...
That's what I'd expect someone with your level of understanding of .NET to
say.
Well... correct it, then.... you know the saying... put up, or shut up.

--
Ken Halter
Part time groupie
Sep 30 '08 #16
"Scott M." <s-***@nospam.nospamwrote in message
news:eZ*************@TK2MSFTNGP06.phx.gbl...
That's what I'd expect someone with your level of understanding of .NET to
say.
adding to that, how can you *possibly* know what my level of understanding
is? Just pick a topic, *any* topic and try to guess what my level of
understanding is (boy... I have to wonder sometimes, just who some of you
think you are)...and, just what *is* your level of understanding?

I can certainly see the questions asked here are just about the exact same
questions people were asking 10+ years ago. The difference is, it's rare to
find an unanswered question in the VB6 groups... Here, they're everywhere.
Which is no surprise, since your star trolls are hanging around the VB6
groups, leaving their dirty toilet paper where ever they can.

It might be beneficial to new users if MS would A) update their sample code,
B) release sample code for their new "products" as they're released and C)
stop adding bloat before fixing existing problems. (plenty more where those
came from)

But, like you say... I don't have the time.... I've said it before and I'll
say it again... B#'s top competitor is this "ancient toy language" that was
released in 1998. That says *volumes* about this "super duper VB". dotNet's
been available for what... nearly 9 years now? LOL
--
Ken Halter
Part time groupie
Sep 30 '08 #17
On 2008-09-30, Ken Halter <Ken_Halter@Use_Sparingly_Hotmail.comwrote:
"Scott M." <s-***@nospam.nospamwrote in message
news:eZ*************@TK2MSFTNGP06.phx.gbl...
>That's what I'd expect someone with your level of understanding of .NET to
say.

adding to that, how can you *possibly* know what my level of understanding
is? Just pick a topic, *any* topic and try to guess what my level of
understanding is (boy... I have to wonder sometimes, just who some of you
think you are)...and, just what *is* your level of understanding?
Well, I think the assumptions come from some of the statements you make. Some
of them, are grounded in reality - but, are major exagerations. I think that
leads some to believe that maybe you do not know what you're talking about -
especially those of us who have written large applications in a managed
language.
I can certainly see the questions asked here are just about the exact same
questions people were asking 10+ years ago.
Would you expect any different? There are people on different levels of the
skill spectrum in .NET, just as there are in VB6. The reason you may not be
seeing these questions in the classic groups is that most newbies are not
starting with VB6. So, by default you are left with most of the old-timers
who have advanced beyond the newbie type questions.

The difference is, it's rare to
find an unanswered question in the VB6 groups... Here, they're everywhere.
Which is no surprise, since your star trolls are hanging around the VB6
groups, leaving their dirty toilet paper where ever they can.
I know, I've been spending most my time on the MSDN forums as of late (though,
I have been inactive there for the last 3 weeks or so - time constraints!). I
only stop by here for a quick browse now and again.

I think a major contributor to the problem over there is the extreme anti-.net
anything attitude taken by some of the classic contributors. For instance, I
don't see the problem in answering a .net question if the answer is
relatively short and then providing a redirect to the proper forums for future
reference. Where is the harm? Yet, many act as if it is the end of the world
- or even reply to innocent queries with long diatribes on the dishonesty and
immorality of MS (a subject I don't wholy disagree with, btw).
It might be beneficial to new users if MS would A) update their sample code,
I would agree with that - it would be nice if some of those samples had .net
versions.
B) release sample code for their new "products" as they're released and
Again, I can't disagree.
C) stop adding bloat before fixing existing problems. (plenty more where those
came from)
What things are you specifically refering to? What problems? What do YOU
consider bloat?
But, like you say... I don't have the time.... I've said it before and I'll
say it again... B#'s top competitor is this "ancient toy language" that was
released in 1998. That says *volumes* about this "super duper VB". dotNet's
been available for what... nearly 9 years now? LOL
"B#'s" top competitor is now where near VB6. It's top competitor are OSS
languages, such as php, python, ruby, and the mother of them all Java. AFICT,
VB6 isn't even on the radar.

--
Tom Shelton
Sep 30 '08 #18
"Tom Shelton" <to*********@comcastXXXXXXX.netwrote in message
news:kP******************************@comcast.com. ..
>
Well, I think the assumptions come from some of the statements you make.
Some
of them, are grounded in reality - but, are major exagerations. I think
that
leads some to believe that maybe you do not know what you're talking
about -
especially those of us who have written large applications in a managed
language.
LOL... I notice there's no mention of VB.Net in that statement <g>
>I can certainly see the questions asked here are just about the exact
same
questions people were asking 10+ years ago.

Would you expect any different? There are people on different levels of
the
skill spectrum in .NET, just as there are in VB6. The reason you may not
be
seeing these questions in the classic groups is that most newbies are not
starting with VB6. So, by default you are left with most of the
old-timers
who have advanced beyond the newbie type questions.
Just think how many people would benefit from having a version of VB that
didn't break 50 million+ lines of code or make a few hundred thousand
newsgroup posts suddenly "obsolete"... btw, when it comes to VB6 being
obsolete, it's truly up to the development community to make that decision.
Not marketting geeks who are trying to keep their jobs.... but, if dotNet
was "all that", why isn't Office and the rest written in dotNet? or the OS
itself!

Every commercial app we've upgraded here who's authors switched to a dotNet
based environment, blow chunks to the point where we're buying downgrade
licenses. People want to get their work done... not deal with the exact same
bugs they dealt with 10 years ago... and we upgrade our PCs to gain more
speed, not so we can run bloated apps.
I think a major contributor to the problem over there is the extreme
anti-.net
anything attitude taken by some of the classic contributors. For
instance, I
don't see the problem in answering a .net question if the answer is
relatively short and then providing a redirect to the proper forums for
future
reference. Where is the harm? Yet, many act as if it is the end of the
world
The trolls cause the harm. The threads would end after the 2nd/3rd post, if
it weren't for the "Guardians.Net"
- or even reply to innocent queries with long diatribes on the dishonesty
and
immorality of MS (a subject I don't wholy disagree with, btw).
Well, I haven't been adding to those diatribes and I've done a fair share of
"gently prodding" people over here, but when some "legend in his own
mind.Net" keeps putting everyone down in some attempt to make himself feel
superior, I do add comments... When he tells someone they're worthless
because they took time off and persued another career (most likely, out of
curiousity), I take it personally, even if it's not directed at me.

Newsgroups, like it or not, are communities. Like all communities, there are
trouble makers. Since MS seems completely unable to do anything about it,
it's up to the community to make it uncomfortable for that trouble maker.

Bottom line is, he has no business there and knows it. The fact he's an
MS-MVP reflects badly on the entire program and is one (of many) reasons I
"resigned" last May, instead of waiting for the annual October review.

I'm sure he'll chime in here... I won't see it, but I doubt he'll be able to
resist... there *used* to be private groups where MVPs could get to know
each other. His basketball sized mouth (along with others), attached to a
keyboard, forced MS to close those groups down...
>It might be beneficial to new users if MS would A) update their sample
code,

I would agree with that - it would be nice if some of those samples had
.net
versions.
>B) release sample code for their new "products" as they're released and

Again, I can't disagree.
> C) stop adding bloat before fixing existing problems. (plenty more
where those
came from)

What things are you specifically refering to? What problems? What do YOU
consider bloat?
Just start up the IDE and sit there with a stop watch... besides the bloat,
the problems/bugs are throughout. Just take a peek at the questions here!

EWC is one area where dotNet falls short (an understatement)... btw, EWC is
Edit/Wait (and wait and wait) and Continue, vs the true E&C we have in VB6.
>But, like you say... I don't have the time.... I've said it before and
I'll
say it again... B#'s top competitor is this "ancient toy language" that
was
released in 1998. That says *volumes* about this "super duper VB".
dotNet's
been available for what... nearly 9 years now? LOL

"B#'s" top competitor is now where near VB6. It's top competitor are OSS
languages, such as php, python, ruby, and the mother of them all Java.
AFICT,
VB6 isn't even on the radar.
See? Even you agree that dotNet's a "web based" technology.... and, if I
were to write a web app (or an app for windows mobile), dotNet's the first
thing I'd grab. For desktops and for controlling the machines we build, VB6
rules.... surely, people can't still be whining about DLL Hell. Anyone with
experience should know how to prevent that easily enough.

--
Ken Halter
Part time groupie
Sep 30 '08 #19
On 2008-09-30, Ken Halter <Ken_Halter@Use_Sparingly_Hotmail.comwrote:
"Tom Shelton" <to*********@comcastXXXXXXX.netwrote in message
news:kP******************************@comcast.com. ..
>>
Well, I think the assumptions come from some of the statements you make.
Some
of them, are grounded in reality - but, are major exagerations. I think
that
leads some to believe that maybe you do not know what you're talking
about -
especially those of us who have written large applications in a managed
language.

LOL... I notice there's no mention of VB.Net in that statement <g>
Given the context, I didn't think it need be said.
>>I can certainly see the questions asked here are just about the exact
same
questions people were asking 10+ years ago.

Would you expect any different? There are people on different levels of
the
skill spectrum in .NET, just as there are in VB6. The reason you may not
be
seeing these questions in the classic groups is that most newbies are not
starting with VB6. So, by default you are left with most of the
old-timers
who have advanced beyond the newbie type questions.

Just think how many people would benefit from having a version of VB that
didn't break 50 million+ lines of code or make a few hundred thousand
newsgroup posts suddenly "obsolete"... btw, when it comes to VB6 being
obsolete, it's truly up to the development community to make that decision.
Not marketting geeks who are trying to keep their jobs.... but, if dotNet
was "all that", why isn't Office and the rest written in dotNet? or the OS
itself!
Part's of office are - One Note for instance. Parts of the VS are - the WPF
editors for example, and more of it will be in 2010. The already do release a
managed IDE - the whole Expression line is .NET.

As for the OS, well - I wouldn't be suprised if that isn't comming. I know
you've heard of Midori.
Every commercial app we've upgraded here who's authors switched to a dotNet
based environment, blow chunks to the point where we're buying downgrade
licenses. People want to get their work done... not deal with the exact same
bugs they dealt with 10 years ago... and we upgrade our PCs to gain more
speed, not so we can run bloated apps.
Hmmm... I can't comment here, because I don't know what apps you've been
using. It's quite possible that your statements are true - but, based on my
own experience, I would blame that more on carless coding then on .NET.
>I think a major contributor to the problem over there is the extreme
anti-.net
anything attitude taken by some of the classic contributors. For
instance, I
don't see the problem in answering a .net question if the answer is
relatively short and then providing a redirect to the proper forums for
future
reference. Where is the harm? Yet, many act as if it is the end of the
world

The trolls cause the harm. The threads would end after the 2nd/3rd post, if
it weren't for the "Guardians.Net"
I do agree to some extend. I suppose one side or the other, should take the
high road on this. I seriously, have made an effort to keep my own comments
over there to a minimum - though, I do occasionally break that rule :)
>- or even reply to innocent queries with long diatribes on the dishonesty
and
immorality of MS (a subject I don't wholy disagree with, btw).

Well, I haven't been adding to those diatribes and I've done a fair share of
"gently prodding" people over here,
I wasn't talking about you specifically, I'm quite sure you know to whom I
refere.
but when some "legend in his own
mind.Net" keeps putting everyone down in some attempt to make himself feel
superior, I do add comments... When he tells someone they're worthless
because they took time off and persued another career (most likely, out of
curiousity), I take it personally, even if it's not directed at me.
I agree, with you that many of those comments are not appropriate. I
personally, don't mind a little respectful debate - but somewhere the
individuals in question have taken things off track a bit to far. I'm really
not sure who started it, or even how to stop it. Personally, I think the only
real solution is to do as you do, and plonk those individuals you find
offensive.
Newsgroups, like it or not, are communities. Like all communities, there are
trouble makers. Since MS seems completely unable to do anything about it,
it's up to the community to make it uncomfortable for that trouble maker.
I think the best thing for the "community" is simply to ignore those
individuals. No attention, no fight.
Bottom line is, he has no business there and knows it. The fact he's an
MS-MVP reflects badly on the entire program and is one (of many) reasons I
"resigned" last May, instead of waiting for the annual October review.
The individual you refer to, is quite knowledgable about both platforms - and
I have seen him answer technical questions in both forums. I think he has
every right to be there - I do however, agree that maybe he or the other
person on the classic side should stop trying to bait each other. It's become
a bit childish. IMHO, both sides have crossed way over the line.

To be honest, the main reason I still read that group is that there are lots
of people that I had a lot of respect for still frequenting that group. Some
of whom had a large influence on the way I practiced the art while doing VB -
and contributed much to my personal knowledge. While, I feel that .NET has
major technical advantages over VB.CLASSIC - I can't help feeling a bit
saddened over what it has done to the community.

I'm sure he'll chime in here... I won't see it, but I doubt he'll be able to
resist... there *used* to be private groups where MVPs could get to know
each other. His basketball sized mouth (along with others), attached to a
keyboard, forced MS to close those groups down...
That's to bad. I used to enjoy reading those groups, I hadn't realized they
had been closed - I guess I have been out of the loop a bit to long :).
>>It might be beneficial to new users if MS would A) update their sample
code,

I would agree with that - it would be nice if some of those samples had
.net
versions.
>>B) release sample code for their new "products" as they're released and

Again, I can't disagree.
>> C) stop adding bloat before fixing existing problems. (plenty more
where those
came from)

What things are you specifically refering to? What problems? What do YOU
consider bloat?

Just start up the IDE and sit there with a stop watch... besides the bloat,
the problems/bugs are throughout. Just take a peek at the questions here!
I did that the other day. It takes about 4 seconds to start vs2008 on
this machine. AMD Athlon XP 2000+, 1GB of RAM.

As for, problems and bugs... I guess I'm not seeing a over whelming number of
posts that indicate that there is any problem - except for the typical PEBKAC
issues.
EWC is one area where dotNet falls short (an understatement)... btw, EWC is
Edit/Wait (and wait and wait) and Continue, vs the true E&C we have in VB6.
Sorry - I still haven't tried that in .NET, so I can't really comment. E&C is
a feature I have NEVER used to any extent - even in VB.CLASSIC.
>>But, like you say... I don't have the time.... I've said it before and
I'll
say it again... B#'s top competitor is this "ancient toy language" that
was
released in 1998. That says *volumes* about this "super duper VB".
dotNet's
been available for what... nearly 9 years now? LOL

"B#'s" top competitor is now where near VB6. It's top competitor are OSS
languages, such as php, python, ruby, and the mother of them all Java.
AFICT,
VB6 isn't even on the radar.

See? Even you agree that dotNet's a "web based" technology....
I certainly do not? What gave you that impression.... The only language I
mentioned that is "web based" is php - though the others are often used in
that context.
and, if I
were to write a web app (or an app for windows mobile), dotNet's the first
thing I'd grab.
Ok. So you will touch it after all.
For desktops and for controlling the machines we build, VB6
rules.... surely, people can't still be whining about DLL Hell. Anyone with
experience should know how to prevent that easily enough.
Well, like I've said - if VB6 is working for you. Keep using it. I don't
care. But, I think you are mistaken as to it's capabilities - unless your
running on PII and PIII's with 64MB of ram.

--
Tom Shelton
Sep 30 '08 #20
Tom,

>
>It might be beneficial to new users if MS would A) update their sample
code,
IMHO this text schould seen correct for the problem in this message thread.
Short path names are only still used related to things as UNIX, MS-DOS and
more of these OS's from the previous millenium.

It has not my first preference to set this in a .Net sample. It is not even
anymore in the Path class.

In fact this fits perfectly to a VB6 sample as that is as well from the
previus millenium.

Cor

Oct 1 '08 #21
On 2008-10-01, Cor Ligthert[MVP] <no************@planet.nlwrote:
Tom,

>>
>>It might be beneficial to new users if MS would A) update their sample
code,
IMHO this text schould seen correct for the problem in this message thread.
Short path names are only still used related to things as UNIX, MS-DOS and
more of these OS's from the previous millenium.

It has not my first preference to set this in a .Net sample. It is not even
anymore in the Path class.

In fact this fits perfectly to a VB6 sample as that is as well from the
previus millenium.

Cor
This functionality is becomming more and more necessary, as more applications
want to use path's greater then 260 characters (max_path). There are several
windows api calls that can not handle these paths - so, you can use this
technique to try and compress the path into the 260 character length.

--
Tom Shelton
Oct 1 '08 #22
Tom,

Do you think it is wise to ring on the bell on another place for this?

Cor

"Tom Shelton" <to*********@comcastXXXXXXX.netschreef in bericht
news:j9******************************@comcast.com. ..
On 2008-10-01, Cor Ligthert[MVP] <no************@planet.nlwrote:
>Tom,

>>>
It might be beneficial to new users if MS would A) update their sample
code,
IMHO this text schould seen correct for the problem in this message
thread.
Short path names are only still used related to things as UNIX, MS-DOS
and
more of these OS's from the previous millenium.

It has not my first preference to set this in a .Net sample. It is not
even
anymore in the Path class.

In fact this fits perfectly to a VB6 sample as that is as well from the
previus millenium.

Cor

This functionality is becomming more and more necessary, as more
applications
want to use path's greater then 260 characters (max_path). There are
several
windows api calls that can not handle these paths - so, you can use this
technique to try and compress the path into the 260 character length.

--
Tom Shelton

Oct 1 '08 #23
On 2008-10-01, Cor Ligthert [MVP] <no************@planet.nlwrote:
Tom,

Do you think it is wise to ring on the bell on another place for this?

Cor
Not sure what you mean, Cor. Sorry.

--
Tom Shelton
Oct 1 '08 #24

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Fred Pacquier | last post by:
First off, sorry for this message-in-a-bottle-like post... I haven't been able to phrase my questions well enough to get a meaningful answer from Google in my research. OTOH, it is standard...
37
by: Curt | last post by:
If this is the complete program (ie, the address of the const is never taken, only its value used) is it likely the compiler will allocate ram for constantA or constantB? Or simply substitute the...
2
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/authoring-faq Posting-Frequency: twice a week (Mondays and Thursdays) Last-modified: August 28, 2002 Version: 1.15 URL: http://css.nu/faq/ciwas-aFAQ.html...
0
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/authoring-faq Posting-Frequency: twice a week (Mondays and Thursdays) Last-modified: April 10, 2003 Version: 1.16 URL: http://css.nu/faq/ciwas-aFAQ.html Maintainer:...
12
by: Steven T. Hatton | last post by:
This is something I've been looking at because it is central to a currently broken part of the KDevelop new application wizard. I'm not complaining about it being broken, It's a CVS images. ...
1
by: Koen | last post by:
Hi all, I created a little database to manage my e-books. The program will synchronize a table with the contents of a directory. Works great. Because I keep additional info (like keywords) to...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
0
by: palomine1234 | last post by:
PAYPAL MAGIC!!! TURN $5 INTO $15,000 IN ONLY 30 DAYS...HERES HOW! This is a Money Scheme and Not, I repeat... This is Not a Scam!!!
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.