473,387 Members | 1,481 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,387 software developers and data experts.

VB-WEB: Problem with COM after transforming it from VB6 to .NET

3
Hi all,

My application uses ASP and several COM objects. The communication between ASP and the COMs works perfectly, and I have no errors when I call "Server.CreateObject" from ASP.

The problem lies in specifically one of my COMs. What I am trying to do is transform my COMs from VB6 to .NET. So far it has been going well. I managed to do most of them. One of my .NET COMs, COMTasks, has a function that calls another function in a COM called COMFiles. I successfully transformed COMTasks to .NET.

When COMFiles was still in VB6, the communication was working perfectly between the 2, even after I transformed COMTasks to .NET. However, now I am trying to transform COMFiles to .NET, and for some reason I am not able to make it work.

Here is the code in COMTasks (.NET):

Expand|Select|Wrap|Line Numbers
  1. Function CreateFolder(ByVal Root As String, ByVal Path As String) As Integer
  2.     Dim fsoFiles As COMFiles.Files
  3.     fsoFiles = New COMFiles.Files
  4.  
  5.     If Not fsoFiles.FolderExists(Root & Path) Then
  6.         ....
  7.     End If
  8.  
  9.     fsoFiles.Dispose()
  10.     fsoFiles = Nothing
  11. End Function
The function called in COMFiles uses Scripting.FileSystemObject and is as follows:

Expand|Select|Wrap|Line Numbers
  1. Public Function FolderExists(ByVal MyDir As String) As Boolean
  2.     Dim fso As Scripting.FileSystemObject
  3.     fso = New Scripting.FileSystemObject
  4.     FolderExists = fso.FolderExists(MyDir)
  5.     fso = Nothing
  6. End Function
The error that occurs when I call fsoFiles.FolderExists() in COMTasks is:

Cannot load type 'COMFiles.Files, COMFiles, Version=1.0.2880.28712, Culture=neutral, PublicKeyToken=1b21fcebb0ef5fec'

Both COMs are created as "Server Application" in component services, and have the proper security configuration.

I tried pasting the function FolderExists inside COMTasks and call it, and it worked fine. So I am sure the error is not from the FileSystemObject, it is really a communication problem between the 2 COMs.

How come this same code worked perfectly when COMFiles was in VB6, and I am having this error now?

I have spent several days on this issue and I would really appreciate any help.

Thank you
Bob
Nov 27 '07 #1
0 902

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

Similar topics

132
by: Kevin | last post by:
I don't know if I should even start this topic but here goes. I'm an ex vb6 developer, now developing in C#. The reason why I started developing in C# is because the company that I worked for at...
9
by: Stanley | last post by:
I have a class "clsABC" which is created by VB.NET. I am trying use it in the C# program. Although I can add it in the project reference, I can't browse the methods and properties in the coding....
6
by: VB Programmer | last post by:
I have a line of code in my project: mobjText.Append(ChrW(Bytes(iIndex))) I took out the reference to Microsoft.VisualBasic in my imports so that I am forced to use all VB.NET stuff. What is...
8
by: Andy | last post by:
Are there any information about the big differences between VB 2003 and VB 2005 available? /A.
9
by: Kimelia Schiles | last post by:
Hi, I am new to C#, and I am a VB programmer. I would like to know whether there is any function in C# that can is similar to IsNumeric in VB?
8
by: marcwentink | last post by:
To my surprise Visual Studio 8 - VB evaluates C_B in if C_A And C_B Then And Hence if C_B is an expression that can only be validated if C_A is true my code crashes. For example If p_EdType...
3
by: Dhananjay | last post by:
Hi All, I am facing problem when i am converting C#.net code(Delegate concept) into vb.net. I am unable to do that . Can someone help me to solve the problem. I am providing my C#.net code. ...
25
by: Andy B | last post by:
How hard/easy is it to use/learn VB compared to c#?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.