6

Is it possible to call a vb6 class file like (example.cls) in java by any means? if its possible can you suggest how it can be implemented like where should i start looking.

Arun Michael
  • 190
  • 2
  • 12
  • No. You can't call stuff from a source (cls) file. If you have the compiled version of the vb6 code in a dll, [this](https://stackoverflow.com/a/30622185/5623232) may help. – NPras Nov 27 '18 at 05:32
  • That linked answer is a bit iffy, you cannot by default export functions from a VB DLL. – Alex K. Nov 27 '18 at 11:31
  • 1
    Compile the class in an ActiveX DLL (COM Server) project & register the resulting DLL, then from Java you can use com4j to create an instance of it & access its interfaces. – Alex K. Nov 27 '18 at 11:31
  • Rather than use COM, it's probably easier to rewrite the whole thing in Java, considering the availability of the source :) – NPras Nov 27 '18 at 21:22
  • Actually vb class is calling **advpi32.dll** for encryption so – Arun Michael Nov 28 '18 at 04:36
  • You may be able to use advpi32.dll directly from Java. – StayOnTarget Dec 05 '18 at 11:27

1 Answers1

3

No you can't call a vb class directly from java. you need to do the following

  • Compile the VB6 class into dll file in VB6
  • Then register the dll file in your system
  • Call the dll file using java native
Minato
  • 56
  • 8