Hi, I have the following piece of code:
/////////////
BD_ADDR direccion;
direccion.LAP=0x19C4BB; //24bit LAP (Lower Address Part)
direccion.UAP=0x37; //8bit UAP (Upper Address Part)
direccion.NAP=0x0080;

PORTEMUPortParams pp;
memset (&pp, 0, sizeof(pp));
pp.channel = 0;
pp.device = (BD_ADDR) direccion;
pp.uiportflags = RFCOMM_PORT_FLAGS_REMOTE_DCB;
//////////////////////////

where BD_ADDR is a struct type according to MSDN web:
////
#pragma pack(push, 1)
typedef struct __bd_addr {
union {
struct {
unsigned int LAP : 24;
unsigned int UAP : 8;
};
unsigned int SAP;
};
unsigned short NAP;
} BD_ADDR;
#pragma pack(pop)
////////////

The problem is when I compile the project appears the next error that I dont
understand:
- Error in line """pp.device = (BD_ADDR) direccion;"""
"""error C2679: binary '=' : no operator defined which takes a right-hand
operand of type 'struct _BD_ADDR' (or there is no acceptable conversion)""""

Any suggestion??

Thanks.
Regards, Javier.

Re: struct problem by Bruce

Bruce
Mon Nov 08 08:40:34 CST 2004

You will need to assign the members individually, or through memcopy.

--
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net

Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups



Re: struct problem by iLLiDaN

iLLiDaN
Mon Nov 08 09:30:04 CST 2004

Thanks for answer. I don't understand you. Can you explain it with a sample?

Regards,
Javier


"Bruce Eitman (eMVP)" wrote:

> You will need to assign the members individually, or through memcopy.
>
> --
> Bruce Eitman (eMVP)
> Senior Engineer
> beitman AT applieddata DOT net
>
> Applied Data Systems
> www.applieddata.net
> An ISO 9001:2000 Registered Company
> Microsoft WEP Gold-level Member
>
> Do have an opinion on the effectiveness of Microsoft Windows Mobile and
> Embedded newsgroups? Let us know!
> https://www.windowsembeddedeval.com/community/newsgroups
>
>
>

Re: struct problem by Bruce

Bruce
Mon Nov 08 14:16:18 CST 2004

pp.device.LAP=0x19C4BB; //24bit LAP (Lower Address Part)

--
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net

Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups



Re: struct problem by iLLiDaN

iLLiDaN
Tue Nov 09 04:50:03 CST 2004

I foun the problem. In my bt_api.h, where PORTEportParam is defined, the
member "device" is defined as BT_ADDR, not as BD_ADDR. In MSDN is defined as
BD_ADDR!. So I want to know if my bt_api.h is correct.

I have installed embedded Visual C++4 , service pack3 and Microsoft Pocket
PC 2003 SDK.

Is it different bt_api.h if I have Windows CE 5.0??

Thanks.

"Bruce Eitman (eMVP)" wrote:

> pp.device.LAP=0x19C4BB; //24bit LAP (Lower Address Part)
>
> --
> Bruce Eitman (eMVP)
> Senior Engineer
> beitman AT applieddata DOT net
>
> Applied Data Systems
> www.applieddata.net
> An ISO 9001:2000 Registered Company
> Microsoft WEP Gold-level Member
>
> Do have an opinion on the effectiveness of Microsoft Windows Mobile and
> Embedded newsgroups? Let us know!
> https://www.windowsembeddedeval.com/community/newsgroups
>
>
>