Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Problem converting from .cgm to .cal
Started by jigar at 05-06-2008 11:33. Topic has 32 replies.

Print Search « Previous Thread Next Thread »
  05-06-2008, 11:33
jigar is not online. Last active: 10/3/2008 1:08:01 PM jigar



Top 10 Posts
Joined on 08-22-2007
Posts 421
Re: Sv: Re: Sv: Re: Problem converting from .cgm to .cal
Reply Quote
What return code are you getting?

For the filename parmeter you would put in "C:\\WORK\\test.cgm".  If it still gives an error, you should have a TEXT() macro, and you would pass in the filename parameter as TEXT("C:\\WORK\\test.cgm").

LEADTOOLS Technical Support
   Report 
  05-07-2008, 2:18
Kaunda is not online. Last active: 6/10/2008 7:47:39 AM Kaunda

Top 150 Posts
Joined on 04-10-2008
Posts 19
Sv: Re: Sv: Re: Sv: Re: Problem converting from .cgm to .cal
Reply Quote
I get a return code of -400
(Vector support is locked)!!
How do I turn the "Vector support" on? I assume that we have bought a full license including Vector Support!?

Regards,
Kaunda
   Report 
  05-07-2008, 3:05
Kaunda is not online. Last active: 6/10/2008 7:47:39 AM Kaunda

Top 150 Posts
Joined on 04-10-2008
Posts 19
Sv: Re: Sv: Re: Sv: Re: Problem converting from .cgm to .cal
Reply Quote
I have also tried to unlock the vector support by using the following code in my Delphi program but I get the same error code when trying load the .cgm file in a following codeline:

"L_UnlockSupport(L_SUPPORT_VECTOR, PCHAR('XXXX-XXXX-XXXX-XXXX'));"

followed by this code: "iErrorcode := L_VecLoadFile(PCHAR('C:\temp\testcgm.cgm'), p_Vector, nil, nil);"

The iErrorcode contains -400 after the load!!

In the unlock command I have entered our serial # from the installation CD as the unlock key (second parameter) is this the correct product key to use?
Regards,
Kaunda
   Report 
  05-07-2008, 7:30
Kaunda is not online. Last active: 6/10/2008 7:47:39 AM Kaunda

Top 150 Posts
Joined on 04-10-2008
Posts 19
Sv: Re: Sv: Re: Sv: Re: Problem converting from .cgm to .cal
Reply Quote
Sorry to bother you again! but I have now found our "unlock-key" and I don't get the -400 errorcode anymore! but my LVecLoadFile
still doesn't work and I now get a -13 error code which indicates that there is something wrong with the parameters in my Delphiprogram. I have tried at least 15 different ways to load my .cgm file but I get the -13 code every time. Here are some of my previous and current LVecLoadFile versions (none of them works!!):


iErrorcode := L_VecLoadFile(PCHAR('C:\temp\testcgm.cgm'), p_Vector, nil, nil);

iErrorcode := L_VecLoadFile(L_PTCHAR(sKB), p_Vector, LPLOADFILEOPTION(nil), LPFILEINFO(nil));

iErrorcode := L_VecLoadFile(L_PTCHAR(sKB), addr(p_Vector), nil, nil);

iErrorcode := L_VecLoadFile(L_PTCHAR(sKB), p_Vector, nil, nil);
iErrorcode := L_VecLoadFile(pAnsiChar(sKB), p_Vector, nil, nil);

Do you have any suggestions to make it work?
I don't know exactly how to use a "null" parameter from a Delphi program but I think that "Nil" should do the trick!
Regards,
Kaunda
   Report 
  05-08-2008, 5:06
Kaunda is not online. Last active: 6/10/2008 7:47:39 AM Kaunda

Top 150 Posts
Joined on 04-10-2008
Posts 19
Sv: Re: Sv: Re: Sv: Re: Problem converting from .cgm to .cal
Reply Quote
I have now tested yet another set of parameters and managed to get an errorcode that is not in your helpfiles!! Using the code below I get an errorcode of -789!!! Do you have any idea what it means?
I have looked in the provided Delphi examples but none of them issues the L_VecLoadFile method call.
Here is my -789 code:

p_Vector : LPVECTORHANDLE;
p_FileOption : LPLOADFILEOPTION;
p_Fileinfo : LPFILEINFO;
sKB : string;

iErrorcode := L_VecLoadFile(PChar(sKB), p_Vector, p_FileOption, p_Fileinfo);
Regards,
Kaunda
   Report 
  05-08-2008, 9:07
jigar is not online. Last active: 10/3/2008 1:08:01 PM jigar



Top 10 Posts
Joined on 08-22-2007
Posts 421
Re: Sv: Re: Sv: Re: Sv: Re: Problem converting from .cgm to .cal
Reply Quote
Try:    iErrorcode := L_VecLoadFile(L_PTCHAR(sKB), @p_Vector, nil, nil);
LEADTOOLS Technical Support
   Report 
  05-08-2008, 9:26
Kaunda is not online. Last active: 6/10/2008 7:47:39 AM Kaunda

Top 150 Posts
Joined on 04-10-2008
Posts 19
Sv: Re: Sv: Re: Sv: Re: Sv: Re: Problem converting from .cgm to .cal
Reply Quote
Thanks again!
I've now tried it, but unfortunately it doesn't work. I'm now back to errorcode -13!!

I think my parameters were "almost" correct in my previous example when I got the -789 (Invalid structure size) errorcode
Regards,
Kaunda
   Report 
  05-08-2008, 9:30
Kaunda is not online. Last active: 6/10/2008 7:47:39 AM Kaunda

Top 150 Posts
Joined on 04-10-2008
Posts 19
Sv: Re: Sv: Re: Sv: Re: Sv: Re: Problem converting from .cgm to .cal
Reply Quote
I'm not sure if "Nil" in Delphi is the same as "Null" in other languages. "Null" is not allowed in Delphi.

The first parameter I pass is a stringvariable the others are pointers to areas of the type specified in your helpfile.
Regards,
Kaunda
   Report 
  05-08-2008, 10:01
jigar is not online. Last active: 10/3/2008 1:08:01 PM jigar



Top 10 Posts
Joined on 08-22-2007
Posts 421
Re: Sv: Re: Sv: Re: Sv: Re: Sv: Re: Problem converting from .cgm to .cal
Reply Quote
What parameters did you pass when you got the -786 error?  The "@" symbol represents a pointer to the variable.  What variable type is p_Vector?  If it is VECTORHANLDE then you will need to pass @p_Vector.  If it is pVECTORHANDLE then you just pass in p_Vector.

LEADTOOLS Technical Support
   Report 
  05-08-2008, 10:14
Kaunda is not online. Last active: 6/10/2008 7:47:39 AM Kaunda

Top 150 Posts
Joined on 04-10-2008
Posts 19
Sv: Re: Sv: Re: Sv: Re: Sv: Re: Sv: Re: Problem converting from .cgm to .cal
Reply Quote
This code gives the -789 errorcode in my program:

iErrorcode := L_VecLoadFile(L_PTChar(sKB), @v_Vector, @v_FileOption, @v_Fileinfo);

v_Vector is declared as:
v_Vector : VectorHandle;
v_FileOption : LoadFileOption;
v_Fileinfo : Fileinfo;
and @v_Vector should pass the pointer to it and the same for the other parameters.

If I use "Nil" in the third and fourth parameters I get a -13 errorcode indicating that the parameterlist is invalid.

Regards,
Kaunda
   Report 
  05-08-2008, 11:04
jigar is not online. Last active: 10/3/2008 1:08:01 PM jigar



Top 10 Posts
Joined on 08-22-2007
Posts 421
Re: Sv: Re: Sv: Re: Sv: Re: Sv: Re: Sv: Re: Problem converting from .cgm to .cal
Reply Quote
Did you try passing a zero for the 3rd and 4th parameter?

It returns a -789 because you're passing in a structure and you have to populate some members in the structure, size as the nSize member.  I searched the web for "null in Delphi" and found an article where it says NULL is delcared in the Variants unit.  Add the Variants unit and then pass in NULL (uppercase) for the last two parameters and see if that fixes it.

LEADTOOLS Technical Support
   Report 
  05-09-2008, 7:30
Kaunda is not online. Last active: 6/10/2008 7:47:39 AM Kaunda

Top 150 Posts
Joined on 04-10-2008
Posts 19
Sv: Re: Sv: Re: Sv: Re: Sv: Re: Sv: Re: Sv: Re: Problem converting from .cgm to .cal
Reply Quote
When I run the program with 0 in the third and fourth parameter like this:
:iErrorcode := L_VecLoadFile(L_PTChar(sKB), @v_Vector, 0, 0);
I get different results dependent on which .cgm file I use! One of the files gives me errorcode -13 and the other raises an exception!!.
The same thing happens when I have 0 only in the third parameter like this:
:iErrorcode := L_VecLoadFile(L_PTChar(sKB), @v_Vector, 0, @v_Fileinfo);

When I have 0 in the fourth parameter only like this:
:iErrorcode := L_VecLoadFile(L_PTChar(sKB), @v_Vector, @v_FileOption, 0);
I get -789 in the errorcode.

I have also tried to use NULL in the parameterlist but the compiler doesn't allow that (incompatible types)! and a typecast to the corresponding filetype was not allowed either! so that was unfortunately not the solution.

When I use the following code:
:iErrorcode := L_VecLoadFile(L_PTChar(sKB), @v_Vector, @v_FileOption, @v_Fileinfo);
I always get errorcode = -789

I have also tried some of the demo examples (04 Delphi 10 Main Demo, 01 Main Vector Demo for example) provided by LeadTools and get similar results. When I try to open some .cgm files I get a "Floating point division by zero" exception, other .cgm files returns -13 (have we seen this before!!??) whilst other loads the file and display it (not very sharp though!).
So my question for you is this:
Can I trust that your tools really work from a Delphi (2006) environment? especially when it comes to converting from .cgm file format to .cal file format.



Regards,
Kaunda
   Report 
  05-12-2008, 12:26
jigar is not online. Last active: 10/3/2008 1:08:01 PM jigar



Top 10 Posts
Joined on 08-22-2007
Posts 421
Re: Sv: Re: Sv: Re: Sv: Re: Sv: Re: Sv: Re: Sv: Re: Problem converting from .cgm to .cal
Reply Quote
Hello,

Can you create a very simple sample project that tries to load the CGM file and attach it to this post.  I want to test it here.

Thanks.

LEADTOOLS Technical Support
   Report 
  05-15-2008, 2:48
Kaunda is not online. Last active: 6/10/2008 7:47:39 AM Kaunda

Top 150 Posts
Joined on 04-10-2008
Posts 19
Sv: Re: Sv: Re: Sv: Re: Sv: Re: Sv: Re: Sv: Re: Sv: Re: Problem converting from .cgm to .cal

Attachment: Leadtest.zip
Reply Quote
Hello,
I have now created a very small and simple project in Delphi 2006. You have to enter an "Unlock support" key in the file named testkb.pas file, you probably have your own set of keys!
You simply choose a file by pressing the "Select Folder" button and loads a .cgm file.
I have also attached two cgm-files. TestCGM1.cgm which fails to load (Floating point division by zero), TestCGM2.cgm loads but with very POOR quality, I have used other software (Myriad, Vizex and others) and they show this file in much better quality.
I have also tried your Vector Imaging Pro demo examples with similar results (Main Vector Demo is one of them).

When I run your demo examples I get different results for different .cgm files (I have tested at least 30 different cgm-files), some of them loads with very bad quality, some returns a -13 errorcode and others returns a -789 errorcode.

I need a tool that can load all .cgm files in good quality and convert them to other file formats. Is LeadTools the product I should use?
Regards,
Kaunda
   Report 
  05-26-2008, 1:56
Kaunda is not online. Last active: 6/10/2008 7:47:39 AM Kaunda

Top 150 Posts
Joined on 04-10-2008
Posts 19
Sv: Re: Sv: Re: Sv: Re: Sv: Re: Sv: Re: Sv: Re: Sv: Re: Problem converting from .cgm to .cal
Reply Quote
Jigar: Have you been able to run the small program I sent you about ten days ago? and do you have a good explanation why the quality is so bad when viewing .cgm files using your software?
I would appreciate if you could inform me a.s.a.p. since we urgently need a software tool that at least can display this file extension in excellent quality, and we would like to go with your solution if possible.
Regards,
Kaunda
   Report 
Post
 Page 2 of 3 (33 items) « 1 2 3 »
LEAD Support Fo... » Developer » File Formats » Problem converting from .cgm to .cal

Powered by Community Server, by Telligent Systems