OCX, Navision and Borland C++ Builder

Hello, I had my 1st experiences in OCX using the Borland C++ Builder 6.0. I created an easy ActiveX library with one class which has only one method which shows a messagebox with ‘Hello’. No own code, justed used the wizards, except the MessageBox() function. Under Borland no compilation and/or linker error. Registration under windows also no problem. Under Navision, in a form, I created an automation variable, and choosed my ActiveX as subtype from the list, and it shows me the correct class I created under C++. In a button I added folowing C/AL code: CREATE(OCX); // OCX is the automation variable OCX.Method1; // Should just show the messagebox CLEAR(OCX); The form compiles fine under Navision, but if I run the form and press the button I get following error message: Internal error 33 in module 35. Contact your dealer if you need assistance. Does anybody know what it means? My NSC has no idea because they are not familiar with OCX. They only say that module 35 is the OCX modul. Any help is appreciated! Has anybody developed already an OCX under Borland Builder? Thanks a lot!

If your Variable called OCX? This might be a reserved word! As a Guide do not name a field with a table name, data type or function. IE: If you had a user defined field called Employee and a record Variable called Employee the in code wrote Employee := Employee.“No.” it would not be good look at the way Navision name things “Employee No.”, likewise if you created a table called Action this will compile but will not run as Action is a reserved word used in table lookups.

Thanks for reply but sorry, this is not the reason, because I also used other names already and got same error. I think best would be if I get the meaning of error code 33, to go on further. Does anybody have an Delphi and or C++ source example of an OCX used in Navision? Thanks again!

Your OCX cannot have any GUI. Have you checked that? It is because Navision is not a true OLE Control Container. Why don’t you write an Automation DLL instead? Also, there may be a problem with your OCX missing some dependent files. Run Depends.exe from MS.

quote:


Originally posted by dr.burns
Thanks for reply but sorry, this is not the reason, because I also used other names already and got same error. I think best would be if I get the meaning of error code 33, to go on further. Does anybody have an Delphi and or C++ source example of an OCX used in Navision? Thanks again!


It’s not true Navision cannot use a OCX with a GUI. Navision can use any OCX as long as it’s GUI is modal, just nonmodal GUI’s will not work. @M Have you tried to use the OCX from some other application, may be with a Word macro? May be the wizard you used created some error in that OCX.

OCX don’t have IDispatch init, so don’t use CLEATE, it’s for Automation objects. Just call OCX.Method1();