comp.lang.ada
 help / color / mirror / Atom feed
* Bug reports for Win32Ada Binding
@ 1996-08-27  0:00 Paul Whittington
  1996-08-28  0:00 ` Robert Dewar
  1996-08-28  0:00 ` John C. Gordon
  0 siblings, 2 replies; 6+ messages in thread
From: Paul Whittington @ 1996-08-27  0:00 UTC (permalink / raw)



Is there an organization somewhere that's maintaining the Win32Ada binding
specification?

Where does one report bugs/potential bugs?

Here's my problem:

     In the Win32.WinError package there's a definition for HRESULT => type
HRESULT is new LONG;
     In the Win32.ObjBase package there's a definition for HRESULT => type
HRESULT is new Win32.LONG;

GREPing the C headers I get:

     grep "typedef *LONG *HRESULT" * 

     WTYPES.H:typedef LONG HRESULT;  
     WTYPES.IDL:typedef LONG HRESULT;

So it seems that in C there's only one definition for what an HRESULT is,
but in Win32Ada there's two.  This makes using HRESULTs a little clumsy in
that one must use Unchecked_Conversion.

TTFN Paul




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug reports for Win32Ada Binding
  1996-08-27  0:00 Bug reports for Win32Ada Binding Paul Whittington
  1996-08-28  0:00 ` Robert Dewar
@ 1996-08-28  0:00 ` John C. Gordon
  1 sibling, 0 replies; 6+ messages in thread
From: John C. Gordon @ 1996-08-28  0:00 UTC (permalink / raw)



In article <01bb9466$01037740$24af1486@pc-phw.inel.gov>, "Paul Whittington" <paul@sage.inel.gov> says:
>
>Is there an organization somewhere that's maintaining the Win32Ada binding
>specification?
>
>Where does one report bugs/potential bugs?
>

When trying to get Orbix-OLE working, I found that I needed to change a
number of the "pragma import(stdcall"s to "pragma convention(c," in
oleauto spec v1.20, ole2 spec v1.18, and objbase spec v1.19 to stop
the linker from complaining about missing externals:

oleauto: RemVariant_v0_1_c_ifspec through IID_ISupportErrorInfo
ole2:    IID_IOleAdviseHolder     through IID_IEnumOLEVerb
objbase: IWinTypes_v0_1_c_ifspec  through IID_IPSFactoryBuffer

[note that these just happen to be grouped together between the 
convention(c and import(stdcall sections]

does this seem plausible or could i be doing something gravely wrong ?




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug reports for Win32Ada Binding
  1996-08-27  0:00 Bug reports for Win32Ada Binding Paul Whittington
@ 1996-08-28  0:00 ` Robert Dewar
  1996-08-30  0:00   ` Paul Whittington
  1996-08-28  0:00 ` John C. Gordon
  1 sibling, 1 reply; 6+ messages in thread
From: Robert Dewar @ 1996-08-28  0:00 UTC (permalink / raw)



Paul says

"So it seems that in C there's only one definition for what an HRESULT is,
but in Win32Ada there's two.  This makes using HRESULTs a little clumsy in
that one must use Unchecked_Conversion."

Why unchecked???





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug reports for Win32Ada Binding
  1996-08-30  0:00   ` Paul Whittington
@ 1996-08-30  0:00     ` Robert Dewar
  1996-08-31  0:00     ` Robert A Duff
  1 sibling, 0 replies; 6+ messages in thread
From: Robert Dewar @ 1996-08-30  0:00 UTC (permalink / raw)



I asked Paul Whittington why he used unchecked conversion, and he replied

I used

  function WinError_HRESULT_To_ObjBase_HRESULT is new
    Ada.Unchecked_Conversion (Win32.WinError.HRESULT,Win32.ObjBase.HRESULT);


yes, but why?  why not a normal checked conversion here, why on earth
are you messing with unchecked conversions betweejn integer types, makes
no sense at all to me!





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug reports for Win32Ada Binding
  1996-08-28  0:00 ` Robert Dewar
@ 1996-08-30  0:00   ` Paul Whittington
  1996-08-30  0:00     ` Robert Dewar
  1996-08-31  0:00     ` Robert A Duff
  0 siblings, 2 replies; 6+ messages in thread
From: Paul Whittington @ 1996-08-30  0:00 UTC (permalink / raw)



Robert Dewar <dewar@cs.nyu.edu> wrote in article
<dewar.841212450@schonberg>...
> ... Why unchecked???

Given 
  
   package Win32.ObjBase is
   ...
   type HRESULT is new Win32.LONG;
   ...
   function CoCreateInstance(
                rclsid      : REFCLSID;
                pUnkOuter   : LPUNKNOWN;
                dwClsContext: DWORD;
                riid        : REFIID;
                ppv         : access Win32.PVOID)
               return HRESULT;    
   ...
   end Win32.ObjBase;

and 

  package Win32.WinError is
  ...
  type HRESULT is new LONG;
  ...
  function FAILED(Status: HRESULT) return Standard.Boolean;
  ...
  end Win32.WinError;

I used 

  function WinError_HRESULT_To_ObjBase_HRESULT is new
    Ada.Unchecked_Conversion (Win32.WinError.HRESULT,Win32.ObjBase.HRESULT);




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug reports for Win32Ada Binding
  1996-08-30  0:00   ` Paul Whittington
  1996-08-30  0:00     ` Robert Dewar
@ 1996-08-31  0:00     ` Robert A Duff
  1 sibling, 0 replies; 6+ messages in thread
From: Robert A Duff @ 1996-08-31  0:00 UTC (permalink / raw)



In article <01bb96cb$340fd180$24af1486@pc-phw.inel.gov>,
Paul Whittington <paul@sage.inel.gov> wrote:
>  function WinError_HRESULT_To_ObjBase_HRESULT is new
>    Ada.Unchecked_Conversion (Win32.WinError.HRESULT,Win32.ObjBase.HRESULT);

But both HRESULTs are integer types, and all integer types are
inter-convertible using a normal type_conversion.  (In fact, they're
both derived from the same thing, so they're inter-convertible for that
reason, too.)  So you can say:

    X: constant Win32.ObjBase.HRESULT := CoCreateInstance(...);
    if FAILED(Win32.WinError.HRESULT(X)) then ...

or:

    if FAILED(Win32.WinError.HRESULT(CoCreateInstance(...))) then ...

No need for UNCHECKED conversion.  (I assumed use_clauses above.)

It seems strange to me that these two HRESULTs are two different types,
though, rather than subtypes of the same type.  Subtypes would be more
convenient because no conversion is requied.  But I haven't seen the
whole thing, so I don't know why they designed it that way.

- Bob




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1996-08-31  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-08-27  0:00 Bug reports for Win32Ada Binding Paul Whittington
1996-08-28  0:00 ` Robert Dewar
1996-08-30  0:00   ` Paul Whittington
1996-08-30  0:00     ` Robert Dewar
1996-08-31  0:00     ` Robert A Duff
1996-08-28  0:00 ` John C. Gordon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox