celstark / OpenNebulosity

Astrophotography capture and processing
BSD 3-Clause "New" or "Revised" License
128 stars 9 forks source link

Windows: Cannot open source files Debug/progid:DriverHelper.tlh Debug/progid:QSICamera.tlh #1

Open vrruiz opened 2 years ago

vrruiz commented 2 years ago

Hi:

I'm trying to compile OpenNebulosity in Windows using Microsoft Visual Studio Community 2019 Version 16.11.5. However, I get these errors:

Severity    Code    Description Project File    Line    Suppression State
Error (active)  E1696   cannot open source file "C:/Users/vrrui/source/repos/OpenNebulosity/nebulosity4/Debug/progid:DriverHelper.tlh"  Nebulosity4 C:\Users\vrrui\source\repos\OpenNebulosity\nebulosity4\precomp.h    36  
Error (active)  E1696   cannot open source file "C:/Users/vrrui/source/repos/OpenNebulosity/nebulosity4/Debug/progid:QSICamera.tlh" Nebulosity4 C:\Users\vrrui\source\repos\OpenNebulosity\nebulosity4\precomp.h    43  
Error (active)  E0725   name must be a namespace name   Nebulosity4 C:\Users\vrrui\source\repos\OpenNebulosity\nebulosity4\ASCOMCamera.h    60  
Error   C3500   invalid ProgID 'QSICamera.CCDCamera'    Nebulosity4 C:\Users\vrrui\source\repos\OpenNebulosity\nebulosity4\precomp.h    43  
Error   C1103   fatal error importing progid: 'QSICamera.CCDCamera' Nebulosity4 C:\Users\vrrui\source\repos\OpenNebulosity\nebulosity4\precomp.h    43  

I tried to add both QSICamera libs and ASCOM libraries to the paths, without luck:

celstark commented 2 years ago

It may be that you need to install the ASCOM developer tools and the QSI developer libraries separately.

aws4y commented 2 years ago

So I have had this problem as well and I have solved half of it by modifying Precomp.h, however I have found that the QSI Com dll is not registering with anything not regasm or regsvr32, also I cannot for the life of my pull a tlb file out of the static library or the dynamic one. I think they, QSI, may be distributing a broken com library and do not know it.

aws4y commented 2 years ago

Okay so I was able to solve these issues, for the fix to the com pointers you will have to look at my fork, but for the QSI issue you need to download there development drivers here.

Once you have downloaded and unzipped the SDK you will need to enter the following commands in powershell or cmd (as admin):

cp $(SDKDIR)\QSICamera\lib\x32\QSICamera.dll C:\Windows\System32 cd C:\Windows\System32 regsvr32 QSICamera.dll

This will register the QSICamera DCOM object.

The next part that is tricky is that VS2019 uses C++14 by default so none of the #import "progid: {yourLibrary}.{yourClas}"

Functions will work any more, this was done because Microsoft was abusing the #import command for COM operations.

You can see the modified imports in my fork if you would like an idea of what to change.

I had to change precom.h and ASCOMCamera.cpp to only import files.

Hope this helps.