1

I'm trying to develop a DLL in C# on Win7 64-bit, and then use VB6 WinXP 32bit, but when add the library in VB6, I get Error 429, "ActiveX component cant create object" . So I wanted to ask if there is a possibility of incompatibility with WinXP 32bit?

I'm creating the DLL by following the steps of this post: http://www.codeproject.com/Articles/3511/Exposing-NET-Components-to-COM

Can somebody help me?

EDIT:

I tried to do the next leg solve my problem but no one can solve:

  1. Install all versions of the .NET framework on my winXP.
  2. Try to register my dll with regasm and add / codebase.
  3. Try deleting ie8 and back to ie7.
  4. Compile the dll to x86 rather than for any cpu.

Thank you and sorry for my english! :-)

Emily
  • 314
  • 2
  • 17
  • do you have .Net installed on XP? Just because you have a dll doesn't mean what it wishes to access is available. – visc Feb 03 '16 at 22:01
  • do you get the error as soon as you add it or when you compile/run your VB6 code? – visc Feb 03 '16 at 22:02
  • 1
    Lots of problems can cause this, but to answer the CPU architecture aspect: If your assembly is compiled to MSIL (the default) and not for x64 specifically, there should be no problem using in from a 32-bit process (on XP or otherwise) -- the JIT will compile the IL for the current hardware on the fly. – Cameron Feb 03 '16 at 22:03
  • 2
    .NET 4.0.3 is the last version that will install on XP. If you are targeting a later version, or a version not installed on your XP box, then you would get this error too. – Sam Axe Feb 03 '16 at 22:05
  • @Cameron I think it is always compiled as MSIL. The target x64 or x86 affects the EXE header/stub and Registry integration. – i486 Feb 03 '16 at 22:08
  • Hi @JeffreyHaines thank you for your answer and yes, I have installed the .NET Framework 4.0.3 and error I get it when I run the program. So that cant be the problem. – Emily Feb 03 '16 at 23:34
  • @Emily then it sounds like something wrong with your code. As it seems you are compiling a 32 bit program with the correct assemblies. Are you forgetting to initialize some prerequisites to the code you're trying to run? Look into how you setup what you're trying to accomplish and it may show that you forgot something in your code. If it works on your win 7 machine than its possible the compiled dll is not including something or perhaps a permissions issue. – visc Feb 04 '16 at 13:25
  • @JeffreyHaines I'm trying to run the code tutorial that under Article functioning properly. I don't understand that I'm failing. To detect I'm using the "DependencyWalker" and I detected that there are two libraries that do not charge, "ieshims.dll" and "wer.dll". What I can do to fix it? – Emily Feb 05 '16 at 20:50
  • @Emily I'm at work right now. I'll take a closer look when I get home :) – visc Feb 05 '16 at 21:25
  • Ups! I'm sorry @JeffreyHaines and thank you very much for your interest and support! I wait your answer! – Emily Feb 05 '16 at 21:44

1 Answers1

0

Finally I could solve my problem. The steps that I had to follow were:

  • In the command line with NET Tools in WinXP-32bits:

    1. Compile NET Module. csc /target:module test.cs
    2. Generate the key. sn -k myDLL.snk
    3. Attach the key with the module. al /out:myDLL.dll myDLL.netmodule /keyfile:myDLL.snk
    4. Add into the GAC my DLL. gacutil /i myDLL.dll
    5. Register my DLL. regasm /codebase /tlb:myDLL.tlb myDLL.dll
  • In VB6:

    1. Create a new standar exe.
    2. Add reference in Project -> References -> Search -> myDLL.dll
    3. Use a next code:

      Dim tst As myDLL.test Set tst = New myDLL.test tst.sayHello

And that's all my friends! I took a long time but here I share with you! Thank you!

Emily
  • 314
  • 2
  • 17