Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bin2Text: Forms with ole controls conversion error #95

Closed
KestasL opened this issue Jul 30, 2023 · 11 comments
Closed

Bin2Text: Forms with ole controls conversion error #95

KestasL opened this issue Jul 30, 2023 · 11 comments

Comments

@KestasL
Copy link

KestasL commented Jul 30, 2023

ℹ Computer information

  • VFP version: 9
  • FoxBin2PRG version: v1.19.78
  • Last FoxBin2PRG version w/o bug (if available):

Convert form to sc2 has bug.
If file collation different then 1252 ( in main case 1257) the ole value data is converted with errors and we
can't convert back to scx, sct format.
I solve the issue with modification to ole fields in data tables does not converted:

`

LINE 17365
With This As c_conversor_scx_a_prg Of 'FOXBIN2PRG.PRG'
Use (.c_InputFile) Shared Again Noupdate Alias _TABLAORIG
* [Kestutis Laurinavicius] prevent change ole codepage
SET NOCPTRANS TO ole
Select _TABLAORIG.*,Recno() regnum From _TABLAORIG Into Cursor TABLABIN Readwrite
Use In (Select("_TABLAORIG"))
`

`

LINE 17477
Scan Rest While Upper( TABLABIN.PLATFORM ) = "WINDOWS" And Lower( Alltrim( Getwordnum( TABLABIN.Parent, 1, '.' ) ) ) == Lower(lcObjName)
lnObjCount = lnObjCount + 1
loRegObj = Null
SET NOCPTRANS TO ole
Scatter Memo Name loRegObj
`

I'm not Visual FoxPro expert, so you can come up with more elegant solution.

@lscheffler
Copy link
Collaborator

@KestasL Hi, thanks for pointing this out. I will have to look into this - I never used something else then 1252, so all the code page commands are a odd to me.

@lscheffler
Copy link
Collaborator

lscheffler commented Aug 4, 2023

@KestasL Some questions

please check foxbin2prg, line 1 and 2:

#DEFINE	DN_FB2PRG_VERSION		1.19
#DEFINE	DC_FB2PRG_VERSION_REAL	'1.19.78'

, the file should have a total of 33386 lines

LINE 17365

Is this a typo? My guess is you mean 17356.

LINE 17477

I see the SCAN .. at line 17459

See https://github.com/fdbozzo/foxbin2prg/blob/master/foxbin2prg.prg

But this just a version problem, the issue will be the same.


I guess the problem will raise for a vcx as well. I need you testing the problem. I have problems doing this, since it is bound to some ActiveX - and to your codepage.
Please create a vcx like your scx and check if you can create the error. A simple container with your AcitveX and the properties of the ActiveX set like the scx will do.
Run FoxBin2Prg against the VCX.

Please report if the problem exists in the vc2 file.

@lscheffler lscheffler changed the title Forms with ole controls conversion error Bin2Text: Forms with ole controls conversion error Aug 4, 2023
@KestasL
Copy link
Author

KestasL commented Aug 4, 2023

Hello,

same problem with vcx files too. I made the OLE field to be in binary format, and now on mine system everything fine.
P.S. don't pay attention to the line numbers (exact ones), I just wrote where you should look. And the lines may be shifted, as I made changes (the line number are with inserted code).
In the code you should find where I put the command (by near code pattern) "SET NOCPTRANS TO ole".
To ole data field be stored in binary format. I think this helps you :). Thanks for project.

@lscheffler
Copy link
Collaborator

@KestasL Ah, ok for the line numbers and the VCX's.

The solution is as you wrote, I just need to learn something about NOCPTRANS to place it optimal. (This is, I have no idea if it must be like

Use (.c_InputFile) Shared Again Noupdate Alias _TABLAORIG
*SF 20230804
*issue #95, set NOCPTRANS for the cursor
SET NOCPTRANS TO ole
Select _TABLAORIG.*,Recno() regnum From _TABLAORIG Into Cursor TABLABIN Readwrite
SET NOCPTRANS TO ole
Use In (Select("_TABLAORIG"))

, or if

Use (.c_InputFile) Shared Again Noupdate Alias _TABLAORIG
Select _TABLAORIG.*,Recno() regnum From _TABLAORIG Into Cursor TABLABIN Readwrite
*SF 20230804
*issue #95, set NOCPTRANS for the cursor
SET NOCPTRANS TO ole
Use In (Select("_TABLAORIG"))

will be enough (without the code near LINE 17477, because it is just calling it over and over for the same field))

So, would you mind to try it like the code in the second snippet, and without the other NOCPTRANS? Only SCX.

lscheffler added a commit to lscheffler/foxbin2prg that referenced this issue Aug 5, 2023
@lscheffler
Copy link
Collaborator

lscheffler commented Aug 5, 2023

@KestasL could you please test the foxbin2prg.prg from https://github.com/lscheffler/foxbin2prg ?

It should run with vcx and scx. The file is version '1.19.79' on top.

Thank you.

Update:
Or the exe from the same location

@KestasL
Copy link
Author

KestasL commented Aug 7, 2023

I checked, yes, everything seems to be fine now.
Thank you.

@lscheffler
Copy link
Collaborator

Fine!
I need some time to put out the release - I'm changing the way to release and it needs some testing. Until that, you can use the code from the fork. If you use FoxBin2Prg via Thor, I can tell you where to copy the file to. Just let me know.

@KestasL
Copy link
Author

KestasL commented Aug 7, 2023

Hello,
I have a working version (which I fixed myself earlier) and it's good enough for me (for my purposes). I will post a note on the GitHub page for your attention and fix the project so everyone can use the fixed version. So thanks, you can update whenever it's convenient for you and don't worry about me personally :)

@lscheffler
Copy link
Collaborator

Thank you!

@lscheffler
Copy link
Collaborator

Fixed version is available at https://github.com/lscheffler/foxbin2prg, no Thor update provided.

@Jeff9000
Copy link

Lutz, thank you so much for keeping this fixed and up to date. We use it every day to update our code in BitBucket and our whole CI system. It's so amazing that we can use this tool to keep our efforts in FoxPro alive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants