Converting from a LPWSTR to a STRING_32

5 messages Options
Embed this post
Permalink
Chris Saunders-4

Converting from a LPWSTR to a STRING_32

Reply Threaded More More options
Print post
Permalink
I'm attempting to write an Eiffel interface to a Windows
ENCRYPTION_CERTIFICATE_HASH structure.  Here is one of the elements of this
structure: LPWSTR lpDisplayInformation;.  I would like to convert this to a
STRING_32 but have been unable to come up with a way of doing so.  Could
anyone help on this?

Regards
Chris Saunders

Emmanuel Stapf

RE: Converting from a LPWSTR to a STRING_32

Reply Threaded More More options
Print post
Permalink
Using WEL_STRING will enable you to convert from the C LPWSTR string to a
STRING_32.

Regards,
Manu

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Chris Saunders
> Sent: Wednesday, October 07, 2009 6:59 PM
> To: Eiffel Software Mailing List
> Subject: [eiffel_software] Converting from a LPWSTR to a STRING_32
>
> I'm attempting to write an Eiffel interface to a Windows
> ENCRYPTION_CERTIFICATE_HASH structure.  Here is one of the elements of
> this
> structure: LPWSTR lpDisplayInformation;.  I would like to convert this to
> a
> STRING_32 but have been unable to come up with a way of doing so.  Could
> anyone help on this?
>
> Regards
> Chris Saunders
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

------------------------------------------------------------------------  
Eiffel Software
805-685-1006
http://www.eiffel.com       
Customer support: http://support.eiffel.com       
User group: http://groups.eiffel.com/join       
------------------------------------------------------------------------  
Chris Saunders-4

Re: Converting from a LPWSTR to a STRING_32

Reply Threaded More More options
Print post
Permalink
Hey Manu.  I've been looking at class WEL_STRING for a bit now and I don't
see that it has facilities for making this conversion.  Could you give me a
little bit more of a hint?

Regards
Chris Saunders

----- Original Message -----
From: Emmanuel Stapf [ES]
To: [hidden email]
Sent: Wednesday, October 07, 2009 11:00 PM
Subject: RE: [eiffel_software] Converting from a LPWSTR to a STRING_32


  Using WEL_STRING will enable you to convert from the C LPWSTR string to a
STRING_32.

Regards,
Manu

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Chris Saunders
> Sent: Wednesday, October 07, 2009 6:59 PM
> To: Eiffel Software Mailing List
> Subject: [eiffel_software] Converting from a LPWSTR to a STRING_32
>
> I'm attempting to write an Eiffel interface to a Windows
> ENCRYPTION_CERTIFICATE_HASH structure. Here is one of the elements of
> this
> structure: LPWSTR lpDisplayInformation;. I would like to convert this to
> a
> STRING_32 but have been unable to come up with a way of doing so. Could
> anyone help on this?
>
> Regards
> Chris Saunders
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>


 

Chris Saunders-4

Re: Converting from a LPWSTR to a STRING_32

Reply Threaded More More options
Print post
Permalink
I have further questions on this Manu.  By the way, thanks for the
assistance you have given so far.  Having looked at class WEL_STRING a
little more in depth, it seems that all pointers to strings in this class
are interpreted as wchar_t *'s.  Does this mean that `make_by_pointer'
cannot be fed a char * and that class WEL_STRING is not to be used for ANSI
strings?  I'm no longer very familiar with WEL as I've been using Vision 2
for years now.

Regards
Chris Saunders

----- Original Message -----
From: Chris Saunders
To: [hidden email]
Sent: Thursday, October 08, 2009 3:03 AM
Subject: Re: [eiffel_software] Converting from a LPWSTR to a STRING_32


  Hey Manu. I've been looking at class WEL_STRING for a bit now and I don't
see that it has facilities for making this conversion. Could you give me a
little bit more of a hint?

Regards
Chris Saunders

----- Original Message -----
From: Emmanuel Stapf [ES]
To: [hidden email]
Sent: Wednesday, October 07, 2009 11:00 PM
Subject: RE: [eiffel_software] Converting from a LPWSTR to a STRING_32

Using WEL_STRING will enable you to convert from the C LPWSTR string to a
STRING_32.

Regards,
Manu

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Chris Saunders
> Sent: Wednesday, October 07, 2009 6:59 PM
> To: Eiffel Software Mailing List
> Subject: [eiffel_software] Converting from a LPWSTR to a STRING_32
>
> I'm attempting to write an Eiffel interface to a Windows
> ENCRYPTION_CERTIFICATE_HASH structure. Here is one of the elements of
> this
> structure: LPWSTR lpDisplayInformation;. I would like to convert this to
> a
> STRING_32 but have been unable to come up with a way of doing so. Could
> anyone help on this?
>
> Regards
> Chris Saunders
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>


 

Emmanuel Stapf

RE: Converting from a LPWSTR to a STRING_32

Reply Threaded More More options
Print post
Permalink
WEL_STRING is a direct mapping for LPWSTR.
C_STRING is a direct mapping for ANSI C strings.

So you should use `{WEL_STRING}.item' when the C externals requires a LPWSTR as
argument, and if you need to get the content of the LPWSTR, you can use
`{WEL_STRING}.string' or {WEL_STRING}.substring'. There are many users of the
WEL_STRING class in WEL. You can look at the callers of those routines to see how
they are used.

Regards,
Manu

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Chris Saunders
> Sent: Thursday, October 08, 2009 12:07 PM
> To: [hidden email]
> Subject: Re: [eiffel_software] Converting from a LPWSTR to a STRING_32
>
> I have further questions on this Manu.  By the way, thanks for the
> assistance you have given so far.  Having looked at class WEL_STRING a
> little more in depth, it seems that all pointers to strings in this class
> are interpreted as wchar_t *'s.  Does this mean that `make_by_pointer'
> cannot be fed a char * and that class WEL_STRING is not to be used for
> ANSI
> strings?  I'm no longer very familiar with WEL as I've been using Vision
> 2
> for years now.
>
> Regards
> Chris Saunders
>
> ----- Original Message -----
> From: Chris Saunders
> To: [hidden email]
> Sent: Thursday, October 08, 2009 3:03 AM
> Subject: Re: [eiffel_software] Converting from a LPWSTR to a STRING_32
>
>
>   Hey Manu. I've been looking at class WEL_STRING for a bit now and I
> don't
> see that it has facilities for making this conversion. Could you give me
> a
> little bit more of a hint?
>
> Regards
> Chris Saunders
>
> ----- Original Message -----
> From: Emmanuel Stapf [ES]
> To: [hidden email]
> Sent: Wednesday, October 07, 2009 11:00 PM
> Subject: RE: [eiffel_software] Converting from a LPWSTR to a STRING_32
>
> Using WEL_STRING will enable you to convert from the C LPWSTR string to a
> STRING_32.
>
> Regards,
> Manu
>
> > -----Original Message-----
> > From: [hidden email]
> > [mailto:[hidden email]] On Behalf Of Chris Saunders
> > Sent: Wednesday, October 07, 2009 6:59 PM
> > To: Eiffel Software Mailing List
> > Subject: [eiffel_software] Converting from a LPWSTR to a STRING_32
> >
> > I'm attempting to write an Eiffel interface to a Windows
> > ENCRYPTION_CERTIFICATE_HASH structure. Here is one of the elements of
> > this
> > structure: LPWSTR lpDisplayInformation;. I would like to convert this
> to
> > a
> > STRING_32 but have been unable to come up with a way of doing so. Could
> > anyone help on this?
> >
> > Regards
> > Chris Saunders
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
>
>
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

------------------------------------------------------------------------  
Eiffel Software
805-685-1006
http://www.eiffel.com       
Customer support: http://support.eiffel.com       
User group: http://groups.eiffel.com/join       
------------------------------------------------------------------------