• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

struggling with VISTA 64-bit

Started by Patrice Terrier, January 05, 2009, 07:59:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

James C. Fuller

Quote from: Patrice Terrier on February 10, 2009, 02:54:43 PM
I just downloaded and installed the C# VS2008 Express Edition, to try it with my PowerBASIC GDImage.dll.

Unfortunatly it doesn't work with it, because i am on VISTA x64 and the VS2008 generates x64 code instead of x32, and so far i didn't find how to configure the Express Edition to generate a 32x target solution.

If you know how to setup the VS2008 Express Edition to target the x32 platform, i would be glad to learn about it.

...


As I mentioned on the Pb Forum: Unless your really need 64bit apps install the 32bit version??

James

Theo Gottwald

Most people switching to Vista, use Vista 64.

Just like me. The reason is that Vista32 does not really make sense compared to XP or even W2k.

Another thing is, that Memory is cheap actually, it can only be used with a 64 bit OS if its more the 4 GB.
But then XP64 is the worse choice then Vista 64 and as such 64 bit is definitely coming.

I also would really prefer to get a PB 64 then to have to switch over to C like languages.
I hope Bob reads this and has an idea how to automatically convert his ASM to ASM 64 :-).

I'd prefer, if he would drop the PB Console Compiler and rather make a 32- and a 64 bit Line.

Patrice Terrier

QuoteI'd prefer, if he would drop the PB Console Compiler and rather make a 32- and a 64 bit Line.

Me too, and i would rather see enhancement to the compiler itself than further DDT API encapsulation.
We are not all rookies, and we need to have the same compiler facilities than our C competitors.

We have asked for years static linking, without success, but we were able to use include files with conditional compiling as a work around. However there is no way for us to solve the x64 issue without a 64-bit compiler.

Bob, if you read this, please listen to us, because we need it right now, thank you!

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Greg Lyon

#33
QuoteIf you know how to setup the VS2008 Express Edition to target the x32 platform, i would be glad to learn about it.

Patrice,

Maybe this is what you are looking for?

http://visualstudiohacks.com/articles/visual-studio-net-platform-target-explained/


[edit] It looks like the Visual C# Express Edition doesn't have the different output options.

[edit] Note: Visual C++ Express Edition does have the different output options.


Patrice Terrier

#34
Greg,

I have uninstalled the VS2008 Express Edition, and reinstalled the VS2005 Standard Edition that allows me to produce either x64 or x32 managed code.

I didn't thought i will encounter so many problems with x64/x32 compability when i bought my new laptop HP HDX 18, but the good thing is that now i can experience by myself those problems ...

Before that, i never heard of Wow64 ;)

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Greg Lyon

I'm just starting to learn about x64 myself. I installed the Windows 7 Beta 64-bit as a dual-boot and it's the first 64-bit OS I have used. The only problem I have run into is Adobe Flash Player doesn't have a version for 64-bit browsers. So I run 32-bit Firefox.

I have been using Pelle's C and GoAsm, which both support x64. It's like starting all over again with the assembler part, new registers, new calling-convention etc.

It's interesting.


Patrice Terrier

#36
Greg,

QuoteIt's like starting all over again with the assembler part, new registers, new calling-convention etc.

64-bit computers and 64-bit OS have been there already for a few years, but 2009 is the first year where most of the new computers are sold pre-installed with both of them.

On another forum you can read:
QuotePowerBASIC is fully compatible with every 32-bit and 64-bit version of Windows.
This is true, but there is no way to mix 32/64-bit EXE/DLL code inside of the same application.

The only solution is to use a 64-bit DLL to work with a 64-bit EXE, and a 32-bit DLL to work with a 32-bit EXE.

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Greg Lyon

Patrice,

Yep, 64-bit Windows is just now becoming mainstream.

QuoteThe only solution is to use a 64-bit DLL to work with a 64-bit EXE, and a 32-bit DLL to work with a 32-bit EXE.
You are right.

I would guess that PowerBASIC is working on a 64-bit output option.


Patrice Terrier

Here is another 64-bit issue i have been faced with, while trying to perform a screen shot of the Desktop.

On 32-bit OS it has been working fine for years, but on 64-bit it does nothing...


SUB ScreenCaptureToBackground()
    LOCAL SysXRes AS LONG, SysYRes AS LONG, gCtrl AS LONG, hDeskTop AS LONG, hDCSrce AS LONG
    SysXRes = GetSystemMetrics(%SM_CXSCREEN)
    SysYRes = GetSystemMetrics(%SM_CYSCREEN)
    gCtrl = GetDlgItem(hMain, %ID_CTRL)
    CALL ZI_CreateImageBackground(gCtrl, SysXRes, SysYRes)
    hDeskTop = GetDesktopWindow(): hDCSrce = GetWindowDC(hDeskTop)
    CALL BitBlt(ZI_GetDC(gCtrl), 0, 0, SysXRes, SysYRes, hDCSrce, 0, 0, %SRCCOPY)
    CALL ReleaseDC(hDeskTop, hDCSrce)
END SUB


The only solution i found so far, is to mimic a hard-copy "print screen" and paste the bitmap from the clipboard, but perhaps you may have another suggestion?


...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Patrice Terrier

#39
Ok, here is the solution, we must add the code shown below in red, to setup the Alpha Channel that is lost during the Wow64 translation between 64/32-bit.

    LOCAL pBits AS BYTE PTR, bm AS BITMAP, P AS LONG
    CALL GetObject(GetCurrentObject(ZI_GetDC(gCtrl), 7), SIZEOF(bm), bm)
    pBits = bm.bmBits
    FOR P = (bm.bmWidth * bm.bmHeight) TO 1 STEP - 1
        @pBits[3] = 255 ' // Setup the opacity level
        pBits = pBits + 4
    NEXT



SUB ScreenCaptureToBackground()
    LOCAL SysXRes AS LONG, SysYRes AS LONG, gCtrl AS LONG, hDeskTop AS LONG, hDCSrce AS LONG
    SysXRes = GetSystemMetrics(%SM_CXSCREEN)
    SysYRes = GetSystemMetrics(%SM_CYSCREEN)
    gCtrl = GetDlgItem(hMain, %ID_CTRL)
    CALL ZI_CreateImageBackground(gCtrl, SysXRes, SysYRes)

    hDeskTop = GetDesktopWindow(): hDCSrce = GetWindowDC(hDeskTop)
    CALL BitBlt(ZI_GetDC(gCtrl), 0, 0, SysXRes, SysYRes, hDCSrce, 0, 0, %SRCCOPY)

    LOCAL pBits AS BYTE PTR, bm AS BITMAP, P AS LONG
    CALL GetObject(GetCurrentObject(ZI_GetDC(gCtrl), 7), SIZEOF(bm), bm)
    pBits = bm.bmBits
    FOR P = (bm.bmWidth * bm.bmHeight) TO 1 STEP - 1
        @pBits[3] = 255 ' // Setup the opacity level
        pBits = pBits + 4
    NEXT
   
    CALL ReleaseDC(hDeskTop, hDCSrce)

END SUB



This is another example showing the reason why we need a true 64-bit compiler!
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Theo Gottwald

QuoteThis is another example showing the reason why we need a true 64-bit compiler!

I agree on this. Do you beleive there is any hope?

Patrice Terrier

Theo,

As long as i am the only one to complain, i think there is not much hope.

It reminds me the same situtation i have been faced with, when i was pioneering VISTA.

Looks like most programmers are very relunctant to learn something new, because of the extra effort, however it is the only way to stay in the race, and the older you are, then the more relunctant of course ;)

A french papy boomer that doesn't want to surrender ;D

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Eros Olmi

#42
Quote from: Patrice Terrier on March 01, 2009, 10:04:16 AM
Looks like most programmers are very relunctant to learn something new, because of the extra effort, however it is the only way to stay in the race, and the older you are, then the more relunctant of course ;)

Well, do not jump to the conclusion on the situations of others.

For example, in my case I mainly use PB for my company programming (and of course my project). And for many other people I know working in different companies: WE SIMPLY JUMPED VISTA completely ! Can you imagine 64 bit and all the problems it can carry about company applications compatibility?
I've bought hundred of computers for my company users and for all of them we downgraded to XP. We just buy professional line HP computers and all of them come to our office already with XP and Vista installed and downgrade is just a snap.
I think this happen all over the world and Vista was mainly sold in bundle with the hardware only due to contracts manufacturers have with MS.

This just to say that for a big part of the world Vista (especially inside commercial companies) and 64 bit OS problem simply does not exists and so for programmers working for that companies.
I'm quite sure PB is working in this issue but with their way and their time schedule.

I already tested Windows 7 and I feel this time things will be different. Windows 7 seems what Vista should have been since the beginning. I'm sure you will have greater chance.

Ciao
Eros
thinBasic Script Interpreter - www.thinbasic.com | www.thinbasic.com/community
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

Patrice Terrier

Eros,

Windows 7, is just a new "mouture" of VISTA as far as we are speaking of the DWM graphic engine and the 64-bit version.

Fortunatly, what i have learned about VISTA would apply the same to Windows 7 at least for what i am concerned with.

The problem on Windows 7 with the 64-bit version are still the same than on VISTA 64-bit, as long as you don't use a 64-bit compiler, at least with the current W7 beta.

...

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Patrice Terrier

Eros,

QuoteWE SIMPLY JUMPED VISTA completely !

Well, that means that we are not targeting the same audience at all.

Myself, as a third party addon provider, i am faced with different platforms, most of them like DotNET and WinDev, running and using the latest technologies.

Myself, as mutimedia programmer, i have to deal with end user who buy their computers either on the Internet or in super-store, and all these computers are being sold with VISTA pre-installed...

Moreover, for people like myself, VISTA is the best graphic platform ever done for PC!

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com