Options

how to create wrapper for using visual component in Navision

DoomhammerDoomhammer Member Posts: 211
Hi.

I'll need to create some "wrapper" for using visual ActiveX component in Navision. Please, can anybody send me some source codes or some How-To create this wrapper?

thanx a lot :)
Martin Bokůvka, AxiomProvis

Comments

  • Options
    janpieterjanpieter Member Posts: 298
    The only thing can tell that it isn't easy. My advise, if you havent VC++ experience you have a very small chance in success. What kind of control do you want to wrap?

    Regards,
    Jan-Pieter
    In a world without Borders or Fences, who needs Windows and Gates?
  • Options
    DoomhammerDoomhammer Member Posts: 211
    please, take a look here: http://www.mibuso.com/forum/viewtopic.php?t=3941&start=0&postdays=0&postorder=asc&highlight=
    I need to wrap OCX which is needed to printing on specific label printer
    Martin Bokůvka, AxiomProvis
  • Options
    janpieterjanpieter Member Posts: 298
    Ok, thats a different story, i thought you would like to visualize the OCX component in Navision.

    I now understand you only want to expose the OCX properties and functions to navision.


    Well, a quick explination:

    1. Start a new VB6 Activex DLL project.
    2. Create dummy form.
    3. Place OCX on this form.
    4. Try to copy the interface of the OCX by creating functions propeties. Do this in the automation class *
    5. In these properties and functions call frmDummy.OCXinstnacename.FunctionName
    6. compile DLL
    7. use it in navision

    How to create properties and funcition example:
    Option explicit
    
    Public property Get PrinterName as string
      PrinterName = frmDummy.OCXinstanceName.Printername
    End Property
    Public property Let PrinterName(newValue as string)
      frmDummy.OCXinstanceName.PrinterName = newValue
    end property
    
    Public Function PrintDocument(Copies as integer) as long
      PrintDocument = frmDummy.OCXinstanceName.PrintDocument(Copeis)
    End Function
    

    This will get you started i think. Though, can't explain everything. They write books about it buy one of these.

    If you need to visualize the component then you should load the form as well.

    Regards,
    Jan-Pieter
    In a world without Borders or Fences, who needs Windows and Gates?
  • Options
    DoomhammerDoomhammer Member Posts: 211
    thanks. Iľl try it
    Martin Bokůvka, AxiomProvis
  • Options
    dolecdolec Member Posts: 12
    I made something like janpieter described, but I don't know how to make the form visible. If I call the function Form1.Show, Navision shows the following error message:
    Non-modal forms cannot be displayed in the host application from an ActiveX DLL, ActiveX Control, or Property Page.

    Is there any way to set the form 'modal'?
  • Options
    janpieterjanpieter Member Posts: 298
    I think it should be:
    Form1.Show vbModal
    
    In a world without Borders or Fences, who needs Windows and Gates?
Sign In or Register to comment.