468,740 Members | 1,918 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,740 developers. It's quick & easy.

How to create File System Object with using keyword "New"

Hi,

I m actually making a Windows DLL using VB 6.
I have modified the Link.exe, so that, it compiles a Windows DLL.

I m now struck with this.

I add reference "Microsoft Scripting Runtime"
Dim fsr As New FileSystemObject


This keyword "New" creates the problem, when compiled DLL is being accessed from Delphi EXE, the application crashes.


I want to create an object of FileSystemObject without using the keyword "New"
Can anyone help me with syntax?

Please help.

Padhu
Jan 18 '07 #1
3 2033
axtens
32
Hi,

I m actually making a Windows DLL using VB 6.
I have modified the Link.exe, so that, it compiles a Windows DLL.

I m now struck with this.

I add reference "Microsoft Scripting Runtime"
Dim fsr As New FileSystemObject


This keyword "New" creates the problem, when compiled DLL is being accessed from Delphi EXE, the application crashes.


I want to create an object of FileSystemObject without using the keyword "New"
Can anyone help me with syntax?

Please help.

Padhu
Expand|Select|Wrap|Line Numbers
  1. Sub main()
  2.    Dim fso As Object
  3.    Dim d As Object
  4.    Dim s As String
  5.    Dim drvPath As String
  6.    drvPath = "C:\"
  7.    Set fso = CreateObject("Scripting.FileSystemObject")
  8.    Set d = fso.GetDrive(fso.GetDriveName(drvPath))
  9.    s = "Drive " & UCase(drvPath) & " - "
  10.    s = s & d.VolumeName & vbNewLine
  11.    s = s & "Free Space: " & FormatNumber(d.FreeSpace / 1024, 0)
  12.    s = s & " Kbytes"
  13.    MsgBox s
  14.  
  15. End Sub
  16.  
Kind regards,
Bruce.
Jan 18 '07 #2
Hi,
Thank you for the code.

Is it possible to create for ADODB.Connection and ADODB.Recordset?

I tried the following the code

Dim conn As Object
Set conn = CreateObject("ADODB.Recorset")

I get an error saying "ActiveX component can't create object"

I did a search in Google, but not able to find the desired one.

Can you help?
Regards,
Padhu
Jan 18 '07 #3
Sorry, managed to solve the problem.
Thanks!
Regards,
Padhu
Jan 18 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

30 posts views Thread by seesaw | last post: by
24 posts views Thread by Rv5 | last post: by
12 posts views Thread by Ola Johansson | last post: by
5 posts views Thread by Sam | last post: by
24 posts views Thread by M O J O | last post: by
4 posts views Thread by Ronald S. Cook | last post: by
350 posts views Thread by Lloyd Bonafide | last post: by
30 posts views Thread by Medvedev | last post: by
reply views Thread by zhoujie | last post: by
xarzu
2 posts views Thread by xarzu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.