Problems with Cfront.ocx

Alexander_BerneggerAlexander_Bernegger Member Posts: 4
edited 2001-07-08 in Navision Financials
Hi folks,

need help from someone who is firm with the usage of the cfront .ocx


What’s our problem ?

We have to do a report which is processing user defined text stored in tables.
Something similar as in the debtors reminder standard module.

But....

We have to replace text variables with data fields stored in different tables in the database.
So the user can configure text samples and the report has to fill it up with data referenced to user configured fields. Due to the fact the user will use proportional fonts, Navision is also unable to find out what the length of a line will be after replacing the text samples.

There was no way to do this in Financials. So we decided to make a OCX (our.ocx) which itself has a reference to the cfront.ocx. He report passes the text samples and the data fields (table.field) to the ocx. The ocx opens a connection to the server and retrieves the data fields the user has defined. Further the program is replacing the text variables, calculates the line length by a given Font and Fontsize and passes line after line back to the calling report.


Everything run fine, until the user will terminate the Financials Application.
Then the following error occurs:

Dr. Watson:
Application error
fin.exe
ZUGRIFFSVERLETZUNG: 0xc000005
Adress:0x77f7cde6


We close every open table, do a Close Company,
do a Close Database.
Clear the report Object after runmodal.

What could this be?

Thanks for helping


Alex

Comments

  • PBVSPBVS Member Posts: 6
    I'm having the same problem with the navision cfront.ocx. After connect and disconnecting to the database via cfront and closing navision in crashes !!

    It seems we're encountering the same type of problem.

    My configuration:
    Navision Financials 2.60A Server with navision 2.60 client and CFront version 2.60A (31)

    I've not been able to find the cause of the error. Anybody else got an idea ?


    Regards,
    PBVS


    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Alexander Bernegger:
    Hi folks,

    need help from someone who is firm with the usage of the cfront .ocx


    What’s our problem ?

    We have to do a report which is processing user defined text stored in tables.
    Something similar as in the debtors reminder standard module.

    But....

    We have to replace text variables with data fields stored in different tables in the database.
    So the user can configure text samples and the report has to fill it up with data referenced to user configured fields. Due to the fact the user will use proportional fonts, Navision is also unable to find out what the length of a line will be after replacing the text samples.

    There was no way to do this in Financials. So we decided to make a OCX (our.ocx) which itself has a reference to the cfront.ocx. He report passes the text samples and the data fields (table.field) to the ocx. The ocx opens a connection to the server and retrieves the data fields the user has defined. Further the program is replacing the text variables, calculates the line length by a given Font and Fontsize and passes line after line back to the calling report.


    Everything run fine, until the user will terminate the Financials Application.
    Then the following error occurs:

    Dr. Watson:
    Application error
    fin.exe
    ZUGRIFFSVERLETZUNG: 0xc000005
    Adress:0x77f7cde6


    We close every open table, do a Close Company,
    do a Close Database.
    Clear the report Object after runmodal.

    What could this be?

    Thanks for helping


    Alex

    <HR></BLOCKQUOTE>
  • dbdb Member Posts: 82
    Do use SetNavisionPath in cf.ocx ? Maybe this error is coused by releasing dbm.dll. I have worked with cfrond.dll couple years ago, and had problems like yours.
    Try check how many dbm.dll's are loaded.
    CF don't like more than one instance of him self. Only one solution that I found was to rename one of dll's to cfront2.dll and load it dynamicaly. In this way CF load two instances of dbm.dll and runs without error's.
  • PBVSPBVS Member Posts: 6
    Thanks for your solution however could you give some more detailed explanation?

    I do use the SetNavisionPath function from the ocx.

    How would i go about loading the "cfront2.dll". I use the OCX version of cfront, is this still necessary?

    The file dbm.dll exits in my client,server and cfront directory. I think i have to rename the dbm.dll in my cfront dir ?

    I use the cfront ocx from navision and from VB. Do I have to move the code from navision that uses the cfront to VB ?

    Suggestions are welcome!!

    Thanks

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by db:
    Do use SetNavisionPath in cf.ocx ? Maybe this error is coused by releasing dbm.dll. I have worked with cfrond.dll couple years ago, and had problems like yours.
    Try check how many dbm.dll's are loaded.
    CF don't like more than one instance of him self. Only one solution that I found was to rename one of dll's to cfront2.dll and load it dynamicaly. In this way CF load two instances of dbm.dll and runs without error's.
    <HR></BLOCKQUOTE>
  • dbdb Member Posts: 82
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by PBVS:
    Thanks for your solution however could you give some more detailed explanation?

    I do use the SetNavisionPath function from the ocx.

    <HR></BLOCKQUOTE>

    CFront.ocx is the "low level" client, think like it is fin.exe without GUI. But there are problems then you running couple instances of CFront. Let's assume that problem is in buffers allocation:
    1. You run fin.exe, it creates buffers for records handling.
    2. You call Cfront.ocx and it makes own connection, but uses the same buffers.
    3. You closing CFront and it releases buffers.
    4. Then closing fin.exe it tries release the same buffers and crashes

    DBM.dll handles buffers. So you should force CFront to load another instance of dbm.dll. You can try use SetNavisionPath(). In this way you must have two installations of navision. One for fin.exe, another for Cfront. In ocx you should first change installation path, then connect.
    I hope It help, I havn't tested it.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>
    How would i go about loading the "cfront2.dll". I use the OCX version of cfront, is this still necessary?
    <HR></BLOCKQUOTE>
    No you can't do this trick. You can do it only loading directly dll. Check example libload.c in Cfront dir of navision CD.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>
    The file dbm.dll exits in my client,server and cfront directory. I think i have to rename the dbm.dll in my cfront dir ?
    <HR></BLOCKQUOTE>
    NO. dbm.dll is linked from CFront.dll, so can't help you.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>
    I use the cfront ocx from navision and from VB. Do I have to move the code from navision that uses the cfront to VB ?
    <HR></BLOCKQUOTE>

    There maybe is your problem. Try move all code to VB. Use following sequence:
    1. Send all necessary data to your ocx.
    2. Call execution funcion in your ocx.
    3. Connect to Cfront.ocx, do all calls to db
    4. Release Cfront.ocx
    5. Return data to fin.exe



    [This message has been edited by db (edited 08-07-2001).]
Sign In or Register to comment.