External Methods & Cross-platform Development

Hello,

I’ve recently discovered Xojo, and am contemplating spending the next year or so porting a massive VB6 application over to it. If it’s looking like it can be done, I’ll buy a licence and join the club.

In my initial playing around, I’m trying to see how hard it would be to make it macOS compatible. I can see how to do conditional compilation with an #if TargetMacOS etc, but what I can’t figure out is how to deal with External Methods that rely on Windows libraries (like for accessing the Registry), and how not to include them in the MacOS build.

I currently have a WindowsRegistry module, and can’t see how to not include it in the build for MacOS, basically.

Any advice would be appreciated.

any calls to items in that module simply need to be wrapped in #if TargetWindows

when you build for OS X since that module wont have any references to it it wont be needed & will be stripped out

I thought I did that, but at a higher level than wrapping around the individual external calls. I’ll try again and report back.

It may be worth listing the Windows libraries you intend to access here in the forum, in case someone knows a better alternative route.

Turns out I was a bit burned out last night and didn’t put my Then keyword at the end of the #If statement. I’m not sure why I thought I could leave off the Then, other than only ever using conditional compilation in C based languages before.

Norman was correct, and I just needed someone to make me double check, as I was only seeing what I wanted to see.

Thanks for the fast replies, got it sorted out now.

David, it’s just a simple Windows Registry module ported over from a VB6 project to read/write values. Seems to all be working OK again now.