Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I want to add a function to my class in ATL project..while doing so the function has a parameter of struct..this struct needs to be implement in idl.....I am stuck..in VC++ can anyone help as I am a beginner in ATL ...

1)Hav added the following in the .idl file
C++
[ uuid("FD27CE79-9C08-4afa-AEB0-BB5B3E2F6DEA")]
struct xGetPinOutNaw {
 char sDate_Time[MESSAGE_DATE_TIME_LENGTH+1];
 char sRefTransaction_Number[MESSAGE_TXN_SERIAL_LENGTH+1];
 char spincode[MESSAGE_PIN_CODE_LENGTH+1];
 char sSerial_PinNo[MESSAGE_PIN_SERIAL_LENGTH+1];
 char sExpiry_date[MESSAGE_PIN_EXPIRY_LENGTH+1];
 char sPromotion_msg[MESSAGE_FILLER_LENGTH+1];
};

2)hav made a separate idl file with the above info and hav include that in the main .cpp file and the headers aswell...

Not getting a proper approach to go ahead

error:
error MIDL2035 : constant expression expected

Thanks
Posted
Updated 15-Jul-13 5:59am
v2
Comments
Richard MacCutchan 15-Jul-13 12:25pm    
Which line does the error occur on?
Matthew Faithfull 15-Jul-13 12:57pm    
Make sure all your array size constants e.g. MESSAGE_DATE_TIME_LENGTH are defined within the IDL file or by a header it includes.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900