Author Topic: I definitly need professional help :D - I mean with a 64bit DLL  (Read 65 times)

rexxitall

  • Newbie
  • *
  • Posts: 33
    • View Profile
At the weekend i try to compile  the COM server sample from 2003 by  Ljubisa Knezevic. So i used the last bc version, compile it to cpp with -c . I was in good mood cause no errors comes out of the box.
Then i try my luck with the ms 64bit compiler and the 64bit target. Which was not a big success :/
It comes with 42 more or strange messages. Ok i fired up VS2019 create a DLL project and embed the bc generated code to it. Same result. I was very surprised how clean BCX does its code generation. That has really its own quality. I try for sure to get a idea what is going wrong. But to be honnest. I have absolutely no meaning. I just could see that it looks like something simple which has to be corrected. Mostly 6 or 8 var types. But even so i am out there :/.
Might be most likely the code is outdated. Feels like in childhood, you got some money from grandpa and then the sweet shop closed in front of your nose. So if someones could fix the old sample, it would be a great help. But at least some progress by the brace converter :)

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 959
    • View Profile
Re: I definitly need professional help :D - I mean with a 64bit DLL
« Reply #1 on: July 12, 2021, 07:11:17 PM »
Thomas,

I spent a good amount of time trying to get the client/server apps to work.
I used BCX version 440 ( from Dec 2003 ) to translate the client/server.
That helped a lot but I still needed to do a lot of manual editing of the C files.

I eventually got the server dll and the client exe built and I registered the dll.
But no matter what I tried, the client could not find the virtual Beep function.

One problem with trying to translate the client / server with newer versions of BCX
is that the organization of the resulting C\C++ file has changed over the years.  That
causes big problems with Ljubisa's 2003 code.

Also, I was working with LccWin32 and Pelles C because those are a lot easier to
work with ( for me anyway ) when trying to troubleshoot a really old project like
Ljubisa's.  And I was initially going for 32-bit, not 64-bit.

I eventually gave up and deleted everything, so I have nothing more to share
with you at this time.  It would be a good challenge to update this project to work
with the current version of BCX and current C\C++ compilers but that is going to take
a bit more energy than I can give at this time.

« Last Edit: July 12, 2021, 07:28:31 PM by MrBcx »

rexxitall

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: I definitly need professional help :D - I mean with a 64bit DLL
« Reply #2 on: July 12, 2021, 09:18:45 PM »
Might be a help to see what others does. https://github.com/zamabuvaraeu/TestCOMServer That i got working in FB. Its more complete cause it has also a callback function. It might be a idea to forget the old code. Maybe its more easy to create such a dll stub with visual code and keep it like it is in general using the ! C embedding trick. But i understand that it is more then just fixing 6 tiny errors. At least i know now that it is not that easy and i can forget about working on it. At least until i would have learned c++. And that also will not happens over night :(. But thanks for having a look at it.

jcfuller

  • Sr. Member
  • ****
  • Posts: 313
    • View Profile

rexxitall

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: I definitly need professional help :D - I mean with a 64bit DLL
« Reply #4 on: July 13, 2021, 10:33:26 AM »
Thanks a lot but no sadly not. He finally decide to give up the 64bit feature and code it in Powerbasic 32bit. I need for my projects 64bit dlls as a minimum requirement and preferable COM ones. At this moment i use some kind of half automated exporter to create Freebasic code with all the interfaces needed to build a 64 bit DLL. So it transpile the original VBA code to becomes Freebasic code. That was also the reason why i could more or less fast write something which does the brace replacement.(Most things i have had already). To finally get the desired COM DLL i create VB.NET code as well which will call the Freebasic DLL functions and provide a COM wrapper around that.(That part is pretty easy) .The whole construct is working but everything else then elegant. In fact you (re)code all Var types and whatever three times. I like BCX for its feature to be able to use VS C++ or embed it. And by its clear well designed output it might be possible to learn even c++ as language by example. I guess the transpiler code will be released end of the year on github. If i want to blame me til the bones *laugh* . It is currently mostly  written in VBA and one of the next tasks will give be to transpile that to Freebasic code. Not so much because i am happy with that, more cause its already nearly done. The brace VBA/VB6 to BCX and some other BCX fixes will be part of it. You never knows :) It hopefully will also fix the BCX case sensitive thing as well as the way how BCX returns function results. And for sure it will add the $signs to some build in functions. In simple words you will be able to feed some VBA code into and get some Freebasic or BCX code out. So things like the VBA Version of the ALGLIB should be easy to port afterwards. At least the boring things will be done automatically :)