1

whats the simplest way to make ocx library working in c#? (I'm using wpf project) I tried to use aximp, but when creating Ax[libname]Lib.Ax[libname] object, calling getocx() returns null.

EDIT: I should add, that this lib is for communicating with some specific driver

chris
  • 664
  • 1
  • 12
  • 23
  • If you use C#/WPF, why don't you use Xbap or silverlight? –  Oct 12 '10 at 19:44
  • 1
    @jdv: Silverlight doesn't make WPF obsolete... – Reed Copsey Oct 12 '10 at 19:48
  • @Reed: of course not. But it would be my #1 choice if I need to run WPF in a browser. ActiveX controls are IE only, and increasingly harder to deploy because of tightened security. –  Oct 12 '10 at 20:14
  • @jdv: ActiveX controls (ocx) are not necessarily for in-browser usage. They were also used quite commonly for desktop applications, and usable in VB6, etc... – Reed Copsey Oct 12 '10 at 20:17

1 Answers1

2

Ok, I found solution :) After creating object, it's necessary to call method .CreateControl()

chris
  • 664
  • 1
  • 12
  • 23
  • If you are calling CreateControl yourself then there's no point in using aximp.exe. That creates a control you can put on a form. In which case calling CreateControl is unnecessary. – Hans Passant Oct 12 '10 at 20:40
  • For now it's only way, I tried to add this to toolbox but it was impossible for me to do – chris Oct 13 '10 at 11:01