Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / September 2005

Tip: Looking for answers? Try searching our database.

COM interop fails with Parameter Incorrect error in ColdFusion

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bosxfan2005 - 28 Aug 2005 16:21 GMT
Hello,

I developed a class in VB.Net that provides encryption/decryption methods.  
It is to be used as a COM object from a ColdFusion program.  I compiled the
class with the "Register for COM Interop" set and registered the DLL on the
ColdFusion server using RegAsm.exe. When the class' encrypt method is called
from CF I get this error:

Error on Invoke for:
COM error 0x80070057. The parameter is incorrect.

I also created a Windows test program that uses CreateObject to instantiate
the COM component and calls the encrypt and decrypt methods.  This works fine
on the CF server and leads me to believe that the DLL is registered correctly
and that the methods are working.

Here is the structure of the VB.Net class. (I am implementing an interface
as suggested by the QuickStart Tutorial, although not using an interface
gives the same error):

Public Class CryptoCOM
   Implements ICryptoCOM

   Public Sub New()
   End Sub

   Public Function Encrypt(ByVal PlainText As String) As String Implements
ICryptoCOM.Encrypt
    (code omitted)
   End Function

   Public Function Decrypt(ByVal CypherText As String) As String Implements
ICryptoCOM.Decrypt
    (code omitted)
   End Function

End Class

Public Interface ICryptoCOM
   Function Encrypt(ByVal PlainText As String) As String
   Function Decrypt(ByVal CypherText As String) As String
End Interface

Here is part the CF code:

<cfobject type="COM" class="<qualified>Security.CryptoCOM" action="Create"
name="CryptoCOM" >
<cfset userencrypted = CryptoCOM.Encrypt("username") >

It seems that everything is set up correctly and this should work without a
problem.  I'm not sure whether this is a COM, ColdFusion or .Net (doubt it)
issue.  But, I'm stumped.  Any help is greatly appreciated.

Thanks.
bosxfan2005 - 15 Sep 2005 15:08 GMT
We fixed this buy installing the COM assembly in the GAC of the server
running Coldfusion.  Copying the DLL into the runtime directory of the client
application allowed the component to be created, however, only after the GAC
install could its methods used.

> Hello,
>
[quoted text clipped - 50 lines]
>
> Thanks.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.