xsharp.eu • Transferring large VO project to X# - Page 4
Page 4 of 5

Transferring large VO project to X#

Posted: Fri May 07, 2021 8:12 pm
by GlenT
Karl-Heinz,

Thanks for that. The 2nd one was the one I was expecting but didn't know what the declaration had to be. I'll study the 1st one too.

Cheers

Glen
Karl-Heinz wrote:HI Glen,

f you want to stay with the the dynamic calls, there are two options:

1. keep the untyped hfunc ptr and use

Code: Select all

PCallNative <LOGIC> ( hFunc , GetCurrentProcess() , @lIsWow64 ) 
instead of

Code: Select all

PCall(hFunc ,GetCurrentProcess(), @lIsWow64)

Code: Select all

FUNCTION PCE_Is64BitOS() AS LOGIC
LOCAL hModule AS PTR
LOCAL hFunc AS PTR
LOCAL lIsWow64 AS LOGIC

hModule := GetModuleHandle( String2Psz( "kernel32" ) )
hFunc := GetProcAddress( hModule, String2Psz( "IsWow64Process" ) )

IF ! hFunc == NULL_PTR
	PCallNative <LOGIC> ( hFunc , GetCurrentProcess() , @lIsWow64 ) 
ENDIF
RETURN lIsWow64   
2. or change hFunc to a typed function ptr

Code: Select all

FUNCTION PCE_Is64BitOS() AS LOGIC
LOCAL hModule AS PTR
LOCAL hFunc AS __IsWow64Process PTR
LOCAL lIsWow64 AS LOGIC

hModule := GetModuleHandle( String2Psz( "kernel32" ) )
hFunc := GetProcAddress( hModule, String2Psz( "IsWow64Process" ) )

IF ! hFunc == NULL_PTR
	PCALL( hFunc, GetCurrentProcess(), @lIsWow64 ) 
ENDIF
RETURN lIsWow64 

STATIC FUNCTION __IsWow64Process( hProcess AS PTR , Wow64Process AS LOGIC PTR ) AS LOGIC 

    RETURN FALSE	
regards
Karl-Heinz

Transferring large VO project to X#

Posted: Sat May 08, 2021 6:06 am
by stecosta66
Fabrice wrote:Hi Stefano,
I've to rebuild and had some glitches
so, I've Pushed some corrections to the repository: https://github.com/X-Sharp/FabTools

Mainly, I've done some corrections due to 2.8 :) ... Ambiguity between a function or a method call
and a trouble (!?) with the DotnetZip NuGet package: What I've done here was to suppress the package from the four Zip projects, and re-install: It is ok now, so I hope the link has been corrected.

Please, keep me informed if you still have some troubles with it.

Fab.
Hi Fabrice,
after I've downloaded the FabTools source code from GitHub I tried to open the FabTools.xsproj file in VS19 but this gives me the following error:

Image

Ciao
Stefano

Transferring large VO project to X#

Posted: Sat May 08, 2021 4:49 pm
by Fabrice
Hi Dick,
you are totally right... when you "only" want to Zip a single file.
Where DotNetZip (and FabZip) are interested, are the cases where you want to zip multiple files and/or folders, and maybe set a password, ...

Fab

Transferring large VO project to X#

Posted: Sat May 08, 2021 4:51 pm
by Fabrice
Hi Chris,
I personally prefer to use NuGet packages, as they support dependencies walking and resolving (not talking about the different versions switch that is easier)

Anyway, I've just corrected all wrong references that were looking for .NET Framework 2.0, etc
And I have update the ReadMe in order to explain the process to "Restore" the NuGet packages on first load.

Fab.

Transferring large VO project to X#

Posted: Sat May 08, 2021 4:58 pm
by Fabrice
Hi Stefano,
Mmm... this error seems more related to VS itself, but I could be my solution.

Can you please try to download the current version ? (I've made some corrections, including today)
Can you also tell me what version of VS you are using, and what version of XSharp is installed.

Thx,
Fab

Transferring large VO project to X#

Posted: Sat May 08, 2021 5:44 pm
by Chris
Hi Fabrice,

Thanks a lot for looking into it, but unfortunately there still seem to exist problems. I downloaded the new solution, opened it and tried to rebuild all, but got several errors, some of which seem related to a copy command that is not formatted correctly? Or is it something wrong in my installation? I am sure this will be easy to fix though.
FabTools_1.png
FabTools_1.png (139.94 KiB) Viewed 761 times
The other errors I suspect have to do with the missing nuget packages. So I found your instructions, opened the nuget package manager as you instructed, but then I don't see this Yellow band or Restore button, and I do not know what to do from here:
FabTools_2.png
FabTools_2.png (64.15 KiB) Viewed 761 times
I realize that I am not the average VS user, I am completely illiterate in it, so probably the solution is obvious for an experienced user, but all this looks completely Greek to me :). And many of the people moving from VO to X# may have never worked in VS before at all, so they could be even less familiar with it than I am! IMO it would be better if things are as simple as possible.


Edit: Arghh, the images do not display well here, it is very hard to read them. Will send them to you directly.

Transferring large VO project to X#

Posted: Sat May 08, 2021 5:51 pm
by Fabrice
Hi Chris,
yes I'm really interested by the list of errors.

Now, about NuGet Packages, my instructions were wrong :)... I point you to the wrong menu.
You have to Open the Solution
Go to the Menu
Tools
NuGet Package Manager
Package Manager Console <- and then you will have the Yellow band with the Restore Command

Fab.

Transferring large VO project to X#

Posted: Sat May 08, 2021 6:00 pm
by Chris
Hi Fabrice,
Fabrice wrote: yes I'm really interested by the list of errors.
OK, I have sent it to the dev forum!

Fabrice wrote: Now, about NuGet Packages, my instructions were wrong :)... I point you to the wrong menu.
You have to Open the Solution
Go to the Menu
Tools
NuGet Package Manager
Package Manager Console <- and then you will have the Yellow band with the Restore Command
Hmm, this is the one I used also before. But I still do not see the yellow band..Hmm, I feel like a 5 year old who is now learning the world but does not understand much of it :). Maybe you can post a screenshot of VS showing what I should be seeing and clicking?

Transferring large VO project to X#

Posted: Sat May 08, 2021 6:47 pm
by FFF
Chris wrote:Maybe you can post a screenshot of VS showing what I should be seeing and clicking?
FTR, guys, do us and yourself a favour and get screentogif from https://www.screentogif.com/
Free, easy, even i (compared to Chris 5 years i'm probably 3 months ;) ) manage to get a pseudo video, which is easily viewed and shows a complete set of actions needed. No need to install, get you the portable version. - simply starting the exe is enough. It provides a "frame" you may drag around the part of your screen which is of interest, hit record, show what you want to show in your app, hit stop and save.

Transferring large VO project to X#

Posted: Sun May 09, 2021 10:53 pm
by ic2
Hello Fabrice,
Fabrice wrote:you are totally right... when you "only" want to Zip a single file.
Where DotNetZip (and FabZip) are interested, are the cases where you want to zip multiple files and/or folders, and maybe set a password, ...
Why do you think it's only for one file?

I use this class for my backups. I've got a file with directories to include and run the backup program to produce 1 zip file with all these files & directories in it, either a full, incremental or differential backup. I can mail you project in case you are interested (it's in C#).

However, one thing it can not do is password protect the zip file. I have investigated way's to deal with that now and then and only this week I saw that this is apparently possible with SyncFusion. Hence I am going to check out their zip class.

Dick