473,408 Members | 2,450 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,408 software developers and data experts.

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 2356
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

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

Similar topics

30
by: seesaw | last post by:
Is it right thing to always avoid using "new" to create objects? What if after starting the application, then decide which and how many objects to create? (Seems like under such situation is there...
24
by: Rv5 | last post by:
Rookie c++ question, but Ive spent the last 5 years doing Java, where everytime I created an object I used new. In c++ I can create my objects without and its confusing me just a little. I have...
12
by: Ola Johansson | last post by:
Can anyone explain to me a meningfull use of the "new" keyword (Shadows in VB). I think i understand how it works fully but i cant figure out why you would use it. Why would you want to declare...
5
by: Sam | last post by:
Hi everyone Could anyone help me understand the usage of the "New" keyword I'm new to VB.Net. 1. Why do we use the "New" keyword on some object type variables such as the myPen of the...
4
by: Ben R. | last post by:
I'm curious about the differeng behavior of the "new" keyword when dealing with value versus object types. If I'm correct, when I do: dim x as integer There's no need for "new" to be called...
24
by: M O J O | last post by:
Hi, Instead of doing this.... Public Class Form1 Public Shared Sub CreateAndShow() Dim f As New Form1 f.Show() End Sub
4
by: Ronald S. Cook | last post by:
So most of the time I need to write the following to instantiate an object: Dim cnn As New SqlConnection() But sometimes Intellisense tells me not to include the "new": Dim dst As DataSet ...
350
by: Lloyd Bonafide | last post by:
I followed a link to James Kanze's web site in another thread and was surprised to read this comment by a link to a GC: "I can't imagine writing C++ without it" How many of you c.l.c++'ers use...
30
by: Medvedev | last post by:
i see serveral source codes , and i found they almost only use "new" and "delete" keywords to make they object. Why should i do that , and as i know the object is going to be destroy by itself at...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.