Automation Error Calling .net Dll From Vb6
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About
Run Time Error 80131040 Automation Error
Us Learn more about Stack Overflow the company Business Learn more about hiring automation error 2146232576 developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the
Calling C# Dll From Vb6
Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up VB6 Automation Error on Calls vb net dll vb6 to .NET 3.5 Assemblies After the First Calls up vote 0 down vote favorite Some of the sources I've checked already: http://www.experts-exchange.com/Programming/Languages/.NET/Visual%5FBasic.NET/Q%5F23359339.html http://mygreenpaste.blogspot.com/2006/03/net-framework-20-configuration-tool.html http://support.microsoft.com/kb/186063 I'm busy developing .NET modules that will hook into our existing VB6 code. I've created a test VB6 project from which to launch the new code which comprises of a form with a button, and on the button's click event is Dim launcher As New VB6InteropLaunchPad.launcher launcher.FormTypeEnum = FormTypeEnum_MySpecificForm launcher.launchAppropriateForm It is successful the first time I click the button. However, if I click the button again, I get the following error: Run-time error '-2146233079 (80131509)': Automation Error Subsequent calls to the .NET code fail with the same error message unless I close and restart the IDE. If I compile the VB6 project to an EXE the same thing happens. I have to close the EXE and run it again to be able to access the .NET code. I've tried the suggestion on http://support.microsoft.com/kb/186063 and did the following: Option Explicit ' http://support.microsoft.com/kb/186063 Const FORMAT_MESSAGE_FROM_SYSTEM = &H1000 Private Declare Function FormatMessage Lib "kernel32" Alias _ "FormatMessageA" (ByVal dwFlags As Long, lpSource As Long, _ ByVal dwMessageId As Long, ByVal dwLanguageId As Long, _ ByVal lpBuffer As String, ByVal nSize As Long, Arguments As Any) _ As Long Private Function MessageText(lCode As Long) As String Dim sRtrnCode As String Dim lRet As Long sRtrnCode = Space$(256) lRet = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0&, lCode, 0&, _ sRtrnCode, 256&, 0&) If lRet > 0 Then MessageText = Left(sRtrnCode, lRet) Else MessageText = "Error not found." End If End Function On Error GoTo errHandler Di
since installing .NET 2.0 Framework .NET Framework > Common Language Runtime Internals and Architecture Question 0 Sign in to vote I noticed that a VB 6 app is no longer able to properly call a .NET component exposedwith aCOM interfacethat was compilevia Visual Studio 2005, it raises an Automation error. Setting the application configuration file to point to the .NET framework v2.0.50727 does not help the situation.However, when the .NET http://stackoverflow.com/questions/1487406/vb6-automation-error-on-calls-to-net-3-5-assemblies-after-the-first-calls component is compiled viaVisual Studio 2003 it works provided I have the infamous application configuration for the VB6 app set to:
Ask a Question Need help? Post your question and get tips & solutions from a community of 418,436 https://bytes.com/topic/visual-basic-net/answers/598457-vb6-automation-error-trying-use-com-exposed-c-dll IT Pros & Developers. It's quick & easy. VB6 automation error http://www.vbforums.com/showthread.php?457714-NET-DLL-in-VB6 trying to use a COM-exposed C# DLL P: n/a Tremendo Hi, I have two PCs: PC1: Visual Studio 2005 (including .NET framework 2.0. PC2: Visual Studio 6 (using Visual Basic 6) + .NET framework 2.0 installed separately. On PC1 I wrote and built a C# DLL automation error (see code below), and created one .tlb and one .reg file to expose its methods to COM. On PC2 I copied the .dll, .tlb and .reg into WINDOWS\system32, and executed the .reg to insert new entries to the registry. In Visual Basic 6, I created a new project, and added a reference to the ..tlb. So far, everything dll from vb6 seems to be ok. I can see the class in the object inspector, and browse its methods and enumerations. Also, the tool that shows as I type the valid methods and parameters works ok. Compilation to exe works fine. Problems start at run time. Just trying to instantiate one instance of the COM exposed class gives me a "Run-time error '-2147024894 (80070002) Automation error'". See VB6 code below, too. Both listings have dummy code. Any hint about what can this be due to? Thank you, Tremendo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%% using System; using System.Text; using System.Runtime.InteropServices; namespace N_Proc_CC1100_Test { public enum RadiobandTypes { RadiobandR =0, RadiobandRC, RadiobandRCS, RadiobandT } // ================================================== ======================= [GuidAttribute("AEB5062F-6695-4484-B07A-53C37A99E92B")] [InterfaceTypeAttribute(ComInterfaceType.InterfaceI sIDispatch)] public interface _C_Proc_CC1100_Test { [DispIdAttribute(1)] bool EnterTestMode(int RadiobandType); [DispIdAttribute(2)] bool LeaveTestMode(); [DispIdAttribute(3)] bool GetSoftwareVersion(out int version); [DispIdAttribute(4)] bool TestRF(out double PeakFrequency_MHz,out double PeakPower_dBm); [DispIdAttribute(5)] bool SetOutputs(int outputs); [DispIdAttribute(6)] bool GetInputs(out int inputs); } // ================================================== ======================= [GuidAttribute("A9BA5B44-A432-44ab-9AFA-6C8058B20AA8")] [ClassInterfaceAttribute(ClassInterfaceType.None)] [ProgIdAttribute("N_Test.C_Test")] public class C_Proc_CC1100_Test : _C_Proc_CC1100_Test { public RadiobandTypes RadiobandType; public bool InTestMode; // .................................................. ................... public C_Proc_CC1100_Test() { RadiobandType =RadiobandTyp
your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 23 of 23 Thread: .NET DLL in VB6 Tweet Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Mar 14th, 2007,11:35 AM #1 cha0s4u View Profile View Forum Posts Thread Starter Addicted Member Join Date Apr 2005 Location new Delhi - 1ND1A Posts 209 .NET DLL in VB6 Hi I was not sure where this issue goes, so forgive me if this is not the right place... I have tried all possible solutions (as per google) but the problem remains intact. here i go... I created a .NET DLL (class library in VB.NET -- VS2005), have selected the "Register for Com interop" and also signed the DLL. Then created a VB6 EXE, that references and uses that DLL (nothing fancy just creates an object out of the calss in taht dll and calls one simeple method) -- This app runs perfect on the development box. Then on a different machine registered the DLL (using regasm