Options

ATL COM interface to Navision

havhav Member Posts: 299
Can anyone please help me to resolve this problem:-
I am providing an ATL COM interface of one application to Navision.
I have defined a COM interface function say GetPicture() through which i want to return an image/picture data obtained from the application to Navision and then display this picture in Picture control of Item Picture card.
I have used Automation server to invoke this interface function.
I want to know the data type to be used both for COM as well as Navision.
For Navision, i am sure that BLOB will be used but for COM fn., i do not know what parameter type i should use.

Thanks,
Regards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)

Comments

  • Options
    janpieterjanpieter Member Posts: 298
    I have spent some time researching this but had no luck finding answers.

    I wouldnt say it cant be done but i doubt it can be done.

    If it can be done you probably would have to do something with streams thats all i could think of.

    You can always create a file and import it in a blob.
    In a world without Borders or Fences, who needs Windows and Gates?
  • Options
    DenSterDenSter Member Posts: 8,304
    There's a table called TempBlob (number 99008535) that I think you can use for this purpose. It has two fields, an integer primary key field and a BLOB type field. If you can stream the picture into this BLOB field (declare it as a record variable and set the BLOB field as the SourceExpr of a picture control) you should be able to put it on a form. I have not done this myself, but I think it should be possible to do this.
  • Options
    havhav Member Posts: 299
    First of all, thanks for your support & guidance.
    Well, i do understand that if the picture is imported in a BLOB field then it can be shown on the picture control of Item card. I am well aware of this. But my question lies with COM.
    Let me explain the scenario.
    There are three entities:-
    1. A S/W Application
    2. ATL COM (server)
    3. Navision (client)
    I have developed an ATL COM server using VC++ in .NET env. I have extracted certain functionalities of the application say add/edit/delete a job, similarly add/edit/delete an item within a job etc. and developed individual functions for each of these using C++. I have added the source file containing these individual functions to the application. The fn's are exported from an existing dll of the application. I have used these dll as an additional dependency to my COM server so that those functions for adding /editing/deleting of jobs as well as items are availabe with COM. Within COM, i create interface methods that act as wrapper to the functions exported from the dll. These methods will provide interface to my client i.e.:- Navision.
    Hence the overall idea is - From Navision when i invoke the interface method say, AddItem(), the COM Server method AddItem() gets executed which in turn invokes a fn. WMAddItem(), which is the function exported in the dll from the application.
    Similarly i have a GetItemPicture() interfae fn. whose task is to obtain the item picture from the application.
    The application writes the picture to a metafile (.emf file). I can read this metafile within COM and can bring the picture in memory.
    I think Navision does not support .emf format.
    Now the main question that arises is that how to return this picture to Navision from the GetItemPicture() fn.?
    Note that the application uses SQL 2000 db. but i do not want to read the item picture from db. in Navision using streams. I want to use the COM interface only.
    Any idea?

    Regards,
    Regards,
    Hemant
    MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
Sign In or Register to comment.