Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » OleCalc example can't compile
OleCalc example can't compile [message #56014] Thu, 14 January 2021 11:26 Go to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
The package named OleCalc don't compile under windows using MSVS19 or Clang both in 64 bits

Contraty to MSVS, clang have 41 compilations error when MSVS have only 1.
Can someone can confirm me OLE/ activeX control can't be compiled using clang but only with MSVS ?

Also, about MSVS : when I try to compile it the first error which is raise is this one :
template <>
inline unsigned GetHashValue(const Guid& guid) { return GetHashValue(~guid); }

Error C912: the explicit specialization 'unsigned int Upp :: GetHashValue (const Upp :: Guid &)' is not a specialization of a function template

If I try to remove the 'template <>' then the next compilation error is :
error C2259: 'Upp :: OcxObjectWrapper <Calculator>': unable to instantiate abstract class

The IViewObject Draw(...) method is abstract

[Updated on: Thu, 14 January 2021 11:30]

Report message to a moderator

Re: OleCalc example can't compile [message #56017 is a reply to message #56014] Thu, 14 January 2021 14:01 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14255
Registered: November 2005
Ultimate Member
Xemuth wrote on Thu, 14 January 2021 11:26
The package named OleCalc don't compile under windows using MSVS19 or Clang both in 64 bits

Contraty to MSVS, clang have 41 compilations error when MSVS have only 1.
Can someone can confirm me OLE/ activeX control can't be compiled using clang but only with MSVS ?

Also, about MSVS : when I try to compile it the first error which is raise is this one :
template <>
inline unsigned GetHashValue(const Guid& guid) { return GetHashValue(~guid); }

Error C912: the explicit specialization 'unsigned int Upp :: GetHashValue (const Upp :: Guid &)' is not a specialization of a function template

If I try to remove the 'template <>' then the next compilation error is :
error C2259: 'Upp :: OcxObjectWrapper <Calculator>': unable to instantiate abstract class

The IViewObject Draw(...) method is abstract


I have fixed it a bit, be seriously thing rather about removing the whole OCX stuff. I do not remember using this in practice... and OCX seems to be sort of out of fashion anyway.
Re: OleCalc example can't compile [message #56018 is a reply to message #56017] Thu, 14 January 2021 14:03 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14255
Registered: November 2005
Ultimate Member
Moved Ole to archive. If there is anybody willing to fix it and maintain it, I would be glad to move it back. Or it can be in UppHub...
Re: OleCalc example can't compile [message #56021 is a reply to message #56014] Thu, 14 January 2021 17:53 Go to previous messageGo to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
Thanks Mirek !

Quote:
OCX seems to be sort of out of fashion anyway.
Well, a customer asked to implement a ActiveX component Razz
Re: OleCalc example can't compile [message #56023 is a reply to message #56014] Thu, 14 January 2021 18:20 Go to previous messageGo to next message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
However, I have no knowledge about ActiveX. This exemple compile but linker tell me "linking has failed" but just under this it tell me
"creation of library ... OleCalc.lib and object OleCalc.exp"

I'm a bit confused. It generate dll and lib. but I thought this exemple was supposed to be a launchable TopWindow Apllicaton which I could drive using OLE ?

[Updated on: Fri, 15 January 2021 13:21]

Report message to a moderator

Re: OleCalc example can't compile [message #57424 is a reply to message #56017] Fri, 06 August 2021 10:35 Go to previous messageGo to next message
JeyCi is currently offline  JeyCi
Messages: 67
Registered: July 2020
Member
Xemuth wrote on Thu, 14 January 2021 11:26
Can someone can confirm me OLE/ activeX control can't be compiled using clang but only with MSVS ?

MIDL-compiler needed - for microsoft interface definition language (IDL) files... and it exists only in MSVC, as I understand... nothing changed...
I remember in Borland was easy way to build COMdll - also with ATL - but it was too long since now... and Borland also had its own compiler...
ATL as for smaller projects than MFC, but still resembles MFC, -- are both of rather complicated structure... and it is more difficult to create COM without ATL (rus here example & limitations)...
though really I still don't understand ? Why
mirek wrote on Thu, 14 January 2021 14:01
OCX seems to be sort of out of fashion anyway.

- because, AFAIK, all libs in Windows are still interacting with each other like COM-objects... Cool perhaps the reason is just the fashion for NET and thus its "COM Interop" possibilities for managed-and-unmanaged code interaction...
but still only Microsoft gives Active Template Library (ATL) & MIDL-compiler Sad


Best regards.

[Updated on: Wed, 12 March 2025 13:25]

Report message to a moderator

Re: OleCalc example can't compile [message #57425 is a reply to message #56023] Fri, 06 August 2021 10:58 Go to previous messageGo to next message
JeyCi is currently offline  JeyCi
Messages: 67
Registered: July 2020
Member
Xemuth wrote on Thu, 14 January 2021 18:20
However, I have no knowledge about ActiveX. ... I thought this exemple was supposed to be a launchable TopWindow Apllicaton which I could drive using OLE ?

not exactly Window_app, ActiveX implement Controls that you can reuse (embed) in different apps or parts of one code as Components (C from COM-abbreviation)


Best regards.

[Updated on: Wed, 12 March 2025 21:07]

Report message to a moderator

Re: OleCalc example can't compile [message #61540 is a reply to message #57424] Wed, 12 March 2025 13:20 Go to previous message
JeyCi is currently offline  JeyCi
Messages: 67
Registered: July 2020
Member
Actually, it is compiled with MS_Build_Tools_2019 (for target Win32x), as described in docs in 2 steps, 5th point is important - "use .tlb" in calc.rc. Nevertheless, resulting OCX-file after regsvr32 ... .ocx and upload with Tools/Reference in Excel 2016 - is being instantiated just with early binding
Sub test()
Dim o As Object

Set o = New Calculator
o.Input = 5
End Sub

and is not instantiating Calculator_Window with Set o = Worksheets(1).OLEObjects.Add(ClassType:="Calculator").
Attempting to use compiled ActiveX as a Control at UserForm (added with View->Toolbox->Additional_Controls->Calculator Control 1.0) - is still being not drawn on UserForm.
Finally, with Developer->Insert ActiveX Control started to work.

Build-steps really helps.

I think, correct implementation of COM-dll gives very convenient advantage to use codes written in different languages together.
P.S. once will try Python as COM-Server or COM-Client coupled with UPP ...
  • Attachment: calc.zip
    (Size: 1.92MB, Downloaded 28 times)


Best regards.

[Updated on: Wed, 12 March 2025 20:38]

Report message to a moderator

Previous Topic: Server Sent Events Example
Goto Forum:
  


Current Time: Fri Apr 25 07:57:32 CEST 2025

Total time taken to generate the page: 0.00931 seconds