Converting long filenames to short filenames in VB4.0 16-bit 
Author Message
 Converting long filenames to short filenames in VB4.0 16-bit

Hi,

I can convert long filenames to short filenames in VB 32-bit using the GetShortPathName API call, but unfortunately this API call does not work in VB4.0 16-bit.
Does anyone know of an equivalent API call or function that I can use in VB4.0 16-bit ?

Many thanks,
Bryce.

-----------------** -- Posted from CodeGuru -- **-----------------
http://www.*-*-*.com/ ;       The website for VB programmers.



Sun, 30 Sep 2001 03:00:00 GMT  
 Converting long filenames to short filenames in VB4.0 16-bit
Bryce,

Because long filenames are a specific feature of Win32, there is no
equivalent at all. LFN's don't even exist as far as 16-bit processes are
concerned. There may be a way using thunking (just guessing, really), but
you wouldn't want to get into that.

~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please post/reply to the newsgroup(s) so
that everyone can benefit from the discussion.

Regards,

Klaus H. Probst, MCP

       ICQ: 22454937
      The VB Box: http://members.xoom.com/kprobst/
~~~~~~~~~~~~~~~~~~~~~~~~~~~



Quote:

> Hi,

> I can convert long filenames to short filenames in VB 32-bit using the

GetShortPathName API call, but unfortunately this API call does not work
in VB4.0 16-bit.
Quote:
> Does anyone know of an equivalent API call or function that I can use in
VB4.0 16-bit ?

> Many thanks,
> Bryce.

> -----------------** -- Posted from CodeGuru -- **-----------------
> http://www.codeguru.com/vb         The website for VB programmers.



Sun, 30 Sep 2001 03:00:00 GMT  
 Converting long filenames to short filenames in VB4.0 16-bit

?
?Hi,
?
?I can convert long filenames to short filenames in VB 32-bit using
the GetShortPathName API call, but unfortunately this API call does
not work in VB4.0 16-bit.
?Does anyone know of an equivalent API call or function that I can use
in VB4.0 16-bit ?

Create a 32-bit VB out-of-process wrapper (ActiveX EXE) for the
GetShortPathName API function call and reference it from your 16-bit
VB app. No thunking required.

Paul
~~~~



Mon, 01 Oct 2001 03:00:00 GMT  
 Converting long filenames to short filenames in VB4.0 16-bit

Quote:


>?
>?Hi,
>?
>?I can convert long filenames to short filenames in VB 32-bit using
>the GetShortPathName API call, but unfortunately this API call does
>not work in VB4.0 16-bit.
>?Does anyone know of an equivalent API call or function that I can use
>in VB4.0 16-bit ?

>Create a 32-bit VB out-of-process wrapper (ActiveX EXE) for the
>GetShortPathName API function call and reference it from your 16-bit
>VB app. No thunking required.

>Paul
>~~~~


Thanks for your suggestion.
I managed to create an ActiveX exe in VB5 as you suggested,
but I cannot create a reference to the compiled exe in VB4.
However, I was able to create a reference to it in VB5 and
call the wrapper function from a new instance of the class.

Could I be doing something wrong, or is this just not possible ?

Regards,
Bryce.

-----------------** -- Posted from CodeGuru -- **-----------------
http://www.codeguru.com/vb         The website for VB programmers.



Tue, 02 Oct 2001 03:00:00 GMT  
 Converting long filenames to short filenames in VB4.0 16-bit
Bryce, there is an API call in 95/98 and NT called CallProc32W.
This is an extension to the 16-bit subsystem to allow 16-bit
code to call 32-bit API functions. It's documented in MSDN.

VB Programmers Journal had an article on this when VB4 was
fairly new; it should still be in the archives on their web site.

Quote:


>>?I can convert long filenames to short filenames in VB 32-bit using
>>the GetShortPathName API call, but unfortunately this API call does
>>not work in VB4.0 16-bit.
>>?Does anyone know of an equivalent API call or function that I can use
>>in VB4.0 16-bit ?
>Could I be doing something wrong, or is this just not possible ?

>Regards,
>Bryce.
>-----------------** -- Posted from CodeGuru -- **-----------------
>http://www.codeguru.com/vb         The website for VB programmers.



Wed, 03 Oct 2001 03:00:00 GMT  
 Converting long filenames to short filenames in VB4.0 16-bit

?Thanks for your suggestion.
?I managed to create an ActiveX exe in VB5 as you suggested,
?but I cannot create a reference to the compiled exe in VB4.
?However, I was able to create a reference to it in VB5 and
?call the wrapper function from a new instance of the class.
?
?Could I be doing something wrong, or is this just not possible ?

Should be possible. Is the ActiveX EXE you created with VB 5.0
registered and does it appear in the References dialog in 16-bit VB
4.0?

I'm fairly certain you can early bind on a 32-bit component from
16-bit VB 4.0, but I can check on this.

Paul
~~~~



Sat, 06 Oct 2001 03:00:00 GMT  
 Converting long filenames to short filenames in VB4.0 16-bit

Quote:


>?Thanks for your suggestion.
>?I managed to create an ActiveX exe in VB5 as you suggested,
>?but I cannot create a reference to the compiled exe in VB4.
>?However, I was able to create a reference to it in VB5 and
>?call the wrapper function from a new instance of the class.
>?
>?Could I be doing something wrong, or is this just not possible ?

>Should be possible. Is the ActiveX EXE you created with VB 5.0
>registered and does it appear in the References dialog in 16-bit VB
>4.0?

>I'm fairly certain you can early bind on a 32-bit component from
>16-bit VB 4.0, but I can check on this.

>Paul
>~~~~


Hi Paul,

There was no available reference to the VB5.0 ActiveX EXE from within VB4.0

Thanks,
Bryce

-----------------** -- Posted from CodeGuru -- **-----------------
http://www.codeguru.com/vb         The website for VB programmers.



Mon, 08 Oct 2001 03:00:00 GMT  
 Converting long filenames to short filenames in VB4.0 16-bit

?
?Hi Paul,
?
?There was no available reference to the VB5.0 ActiveX EXE from within VB4.0

If the ActiveX EXE is properly registered, then you can use late
binding instead. Just declare your variable reference as "Object" and
use the CreateObject function to create an instance:

Dim objConversion as Object
Dim sLongName as String
Dim sShortName as String

Set objConversion = CreateObject("Conversion.Filenames")  

sLongName = "C:\Program Files\My Long Folder\My Long Filename.lfn"
objConversion.ConvertLongToShort sLongName, sShortName

Just a very basic example but this should work for the object you
created.

Paul
~~~~



Mon, 08 Oct 2001 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Convert Long Filenames to Short Filenames in VB4 16-Bit

2. Convert long filenames to short filenames

3. Converting a Long FIleName to it's short equivalent (Both possible shorts)

4. SHORT filename to LONG filename???

5. Short Filename to Long Filename ???

6. Long Filename -> Short Filename

7. SHORT filename to LONG filename???

8. Get short filename in 16 Bit Application under Win95

9. Short filename to long filename

10. Need to get the short filename from a long filename

11. Getting long filenames in 16-bit VB

12. Getting long filenames in 16-bit VB

 

 
Powered by phpBB® Forum Software