DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2012
    Posts
    1

    using VB6 ActiveX Dll with C# 2010

    hey,
    my company wrote an activeX DLL in VB6 few years back, and now i've been asked to run some tests with it.
    since i dont have VB6 environment anymore, i thought it'll be best to try and make a simple C# program that will call the registered COM Dll.

    to do that i copied the DLL into c:\windows\system32, used regsrv32 to register the DLL, restarted the computer and referenced to it from my project.

    from there i tried working like i use to:

    mydll.cMain obj = new mydll.cMain();
    int res;
    res = obj.SetHttpServer("www.test.com", 80);
    res = obj.PingServer();


    with the first method call (SetHttpServer) Everything worked fine,
    on the second method call (PingServer) i keep on getting Error# 429 " ActiveX component can't create object".
    i looked over the original VB class, and it seems pretty simple, it creates an HttpWebRequest object and requests a string from the webserver defined with the SetHttpServer.

    What am i doing wrong?

    Thank you
    Alon

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,649
    That VB6 DLL is unmanaged code and isn't going to work well in a managed environment.

    Here is a fairly good little snippet that I hope will help you out.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

Similar Threads

  1. Word 2010 Automation Using VB6
    By bkh_vb1 in forum VB Classic
    Replies: 4
    Last Post: 11-23-2011, 06:29 PM
  2. Upgrading from VB6 the VS 2010 Pro
    By bkh_vb1 in forum VB Classic
    Replies: 8
    Last Post: 11-15-2011, 09:27 AM
  3. ActiveX DLL
    By DavidG in forum VB Classic
    Replies: 1
    Last Post: 01-03-2003, 07:16 PM
  4. Installing ActiveX DLL on server for COM+
    By John K. in forum VB Classic
    Replies: 0
    Last Post: 02-19-2002, 04:27 PM
  5. ActiveX DLL called from ASP
    By Vincent in forum Enterprise
    Replies: 1
    Last Post: 07-29-2001, 11:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links