PC Review


Reply
Thread Tools Rate Thread

DLL uses combination args???

 
 
=?Utf-8?B?SmV6emVwaQ==?=
Guest
Posts: n/a
 
      2nd Apr 2006
I'm attempting to use the API SetWindowPos. The last argument is Word:
wFlags define as a long. It takes multiple flags separated in C by the or
symbol | .

How can I simulate this in VB?

Any help is appreciated.

J.
 
Reply With Quote
 
 
 
 
Alex Dybenko
Guest
Posts: n/a
 
      2nd Apr 2006
Hi,
you can just add necessary flags, like:

lngFlags= 1+4+32

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


"Jezzepi" <(E-Mail Removed)> wrote in message
news:8ED97335-9395-452B-B972-(E-Mail Removed)...
> I'm attempting to use the API SetWindowPos. The last argument is Word:
> wFlags define as a long. It takes multiple flags separated in C by the or
> symbol | .
>
> How can I simulate this in VB?
>
> Any help is appreciated.
>
> J.


 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      2nd Apr 2006
Or you can use Or, like in C:

lngFlags= 1 Or 4 Or 32


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Alex Dybenko" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
> you can just add necessary flags, like:
>
> lngFlags= 1+4+32
>
> --
> Best regards,
> ___________
> Alex Dybenko (MVP)
> http://alexdyb.blogspot.com
> http://www.PointLtd.com
>
>
> "Jezzepi" <(E-Mail Removed)> wrote in message
> news:8ED97335-9395-452B-B972-(E-Mail Removed)...
>> I'm attempting to use the API SetWindowPos. The last argument is Word:
>> wFlags define as a long. It takes multiple flags separated in C by the
>> or
>> symbol | .
>>
>> How can I simulate this in VB?
>>
>> Any help is appreciated.
>>
>> J.

>



 
Reply With Quote
 
david epsom dot com dot au
Guest
Posts: n/a
 
      3rd Apr 2006
If you use '+', you get null propagation

?2 + Null
Null

If you use 'or', you don't get null propagation
except when you hit the special cases:


?2 or Null
2

?0 or Null
Null

?&HFFFF or Null
Null

(david)


"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:(E-Mail Removed)...
> Or you can use Or, like in C:
>
> lngFlags= 1 Or 4 Or 32
>
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "Alex Dybenko" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hi,
>> you can just add necessary flags, like:
>>
>> lngFlags= 1+4+32
>>
>> --
>> Best regards,
>> ___________
>> Alex Dybenko (MVP)
>> http://alexdyb.blogspot.com
>> http://www.PointLtd.com
>>
>>
>> "Jezzepi" <(E-Mail Removed)> wrote in message
>> news:8ED97335-9395-452B-B972-(E-Mail Removed)...
>>> I'm attempting to use the API SetWindowPos. The last argument is Word:
>>> wFlags define as a long. It takes multiple flags separated in C by the
>>> or
>>> symbol | .
>>>
>>> How can I simulate this in VB?
>>>
>>> Any help is appreciated.
>>>
>>> J.

>>

>
>



 
Reply With Quote
 
Douglas J Steele
Guest
Posts: n/a
 
      3rd Apr 2006
True, but isn't that irrelevant when dealing with flag values?

Msgbox "This is my message", vbOkOnly + vbInformation

vs.


Msgbox "This is my message", vbOkOnly Or vbInformation

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"david epsom dot com dot au" <david@epsomdotcomdotau> wrote in message
news:(E-Mail Removed)...
> If you use '+', you get null propagation
>
> ?2 + Null
> Null
>
> If you use 'or', you don't get null propagation
> except when you hit the special cases:
>
>
> ?2 or Null
> 2
>
> ?0 or Null
> Null
>
> ?&HFFFF or Null
> Null
>
> (david)
>
>
> "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
> news:(E-Mail Removed)...
> > Or you can use Or, like in C:
> >
> > lngFlags= 1 Or 4 Or 32
> >
> >
> > --
> > Doug Steele, Microsoft Access MVP
> > http://I.Am/DougSteele
> > (no private e-mails, please)
> >
> >
> > "Alex Dybenko" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >> Hi,
> >> you can just add necessary flags, like:
> >>
> >> lngFlags= 1+4+32
> >>
> >> --
> >> Best regards,
> >> ___________
> >> Alex Dybenko (MVP)
> >> http://alexdyb.blogspot.com
> >> http://www.PointLtd.com
> >>
> >>
> >> "Jezzepi" <(E-Mail Removed)> wrote in message
> >> news:8ED97335-9395-452B-B972-(E-Mail Removed)...
> >>> I'm attempting to use the API SetWindowPos. The last argument is

Word:
> >>> wFlags define as a long. It takes multiple flags separated in C by

the
> >>> or
> >>> symbol | .
> >>>
> >>> How can I simulate this in VB?
> >>>
> >>> Any help is appreciated.
> >>>
> >>> J.
> >>

> >
> >

>
>



 
Reply With Quote
 
Marshall Barton
Guest
Posts: n/a
 
      3rd Apr 2006
In my mind, it's more important that OR does not carry a one
to another bit position.

?1 + 5 + 4
10

?1 OR 5 OR 4
5

This is critically important when setting a single flag in
an existing set of flags:

x = x OR flag

will always just set the flag (whatever value Flag has), but
you have no idea what the result will be using the
expression:

x = x + flag
--
Marsh
MVP [MS Access]


david epsom dot com dot au wrote:

>If you use '+', you get null propagation
>
> ?2 + Null
> Null
>
>If you use 'or', you don't get null propagation
>except when you hit the special cases:
>
>
> ?2 or Null
> 2
>
> ?0 or Null
> Null
>
> ?&HFFFF or Null
> Null
>
>
>"Douglas J. Steele" wrote
>> Or you can use Or, like in C:
>>
>> lngFlags= 1 Or 4 Or 32
>>
>>
>> --
>> Doug Steele, Microsoft Access MVP
>> http://I.Am/DougSteele
>> (no private e-mails, please)
>>
>>
>> "Alex Dybenko" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Hi,
>>> you can just add necessary flags, like:
>>>
>>> lngFlags= 1+4+32
>>>
>>> --
>>> Best regards,
>>> ___________
>>> Alex Dybenko (MVP)
>>> http://alexdyb.blogspot.com
>>> http://www.PointLtd.com
>>>
>>>
>>> "Jezzepi" <(E-Mail Removed)> wrote in message
>>> news:8ED97335-9395-452B-B972-(E-Mail Removed)...
>>>> I'm attempting to use the API SetWindowPos. The last argument is Word:
>>>> wFlags define as a long. It takes multiple flags separated in C by the
>>>> or
>>>> symbol | .
>>>>
>>>> How can I simulate this in VB?
>>>>
>>>> Any help is appreciated.
>>>>
>>>> J.
>>>

>>
>>

>


 
Reply With Quote
 
Guest
Posts: n/a
 
      3rd Apr 2006
It was just an observation :~)

I got an unexpected coding failure on
iflag = iflag or v

- as you might in the general case if API SetWindowPos was expecting a
'long' flag value and you unexpectedly tried to pass it a null.

The only flags I regularly use in VB are the recordset open flags
dao.dbSeeChanges or dao.dbFailOnError.

When I have done bit operations in vb, I haven't wanted null propagation,
so the null propagation rules are important, and the exception for iflag=0
is an important case.

But I use '+' for bit operations in SQL, so I wouldn't object to somebody
using '+' for consistency

The msgbox flags are a special case :~) since most of the examples over
many years have used '+'

(david)


"Douglas J Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:(E-Mail Removed)...
> True, but isn't that irrelevant when dealing with flag values?
>
> Msgbox "This is my message", vbOkOnly + vbInformation
>
> vs.
>
>
> Msgbox "This is my message", vbOkOnly Or vbInformation
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
> "david epsom dot com dot au" <david@epsomdotcomdotau> wrote in message
> news:(E-Mail Removed)...
> > If you use '+', you get null propagation
> >
> > ?2 + Null
> > Null
> >
> > If you use 'or', you don't get null propagation
> > except when you hit the special cases:
> >
> >
> > ?2 or Null
> > 2
> >
> > ?0 or Null
> > Null
> >
> > ?&HFFFF or Null
> > Null
> >
> > (david)
> >
> >
> > "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
> > news:(E-Mail Removed)...
> > > Or you can use Or, like in C:
> > >
> > > lngFlags= 1 Or 4 Or 32
> > >
> > >
> > > --
> > > Doug Steele, Microsoft Access MVP
> > > http://I.Am/DougSteele
> > > (no private e-mails, please)
> > >
> > >
> > > "Alex Dybenko" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > >> Hi,
> > >> you can just add necessary flags, like:
> > >>
> > >> lngFlags= 1+4+32
> > >>
> > >> --
> > >> Best regards,
> > >> ___________
> > >> Alex Dybenko (MVP)
> > >> http://alexdyb.blogspot.com
> > >> http://www.PointLtd.com
> > >>
> > >>
> > >> "Jezzepi" <(E-Mail Removed)> wrote in message
> > >> news:8ED97335-9395-452B-B972-(E-Mail Removed)...
> > >>> I'm attempting to use the API SetWindowPos. The last argument is

> Word:
> > >>> wFlags define as a long. It takes multiple flags separated in C by

> the
> > >>> or
> > >>> symbol | .
> > >>>
> > >>> How can I simulate this in VB?
> > >>>
> > >>> Any help is appreciated.
> > >>>
> > >>> J.
> > >>
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C# & Args Marco Olimpi Microsoft C# .NET 2 16th May 2009 11:17 AM
Re: C# & Args Alberto Poblacion Microsoft C# .NET 4 15th May 2009 10:22 AM
C# & Args Marco Olimpi Microsoft C# .NET 0 15th May 2009 09:20 AM
Is there a class or method to construct url args or extract url args? Ken Varn Microsoft ASP .NET 2 22nd Jun 2005 01:26 PM
Re: passing multiple args or an array of args to threads William DePalo [MVP VC++ ] Microsoft VC .NET 0 10th Jul 2003 05:20 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:38 PM.