[C++-sig] A 'WCHAR *' is expected, 'unicode(SerNo.0001)' is received

Bill Davy Bill at SynectixLtd.com
Thu Jul 21 18:38:25 CEST 2005


I've extracted the following from a larger program:

Class SomethingC
	{
	public:
enum SerialNumberLengthE
		{
		SerialNumberCharacters = 10
		};
typedef enum {mt_EEPROM, mt_RAM} MemoryTypeT;
int WriteIntelHexFileToMemory(
             const TCHAR *IntelHexFileName, 
		const WCHAR SerialNumber[SerialNumberCharacters], 
		const MemoryTypeT MemoryType);
	};

In the wrapper, I have:

typedef char TCHAR;
typedef wchar_t WCHAR;

In Python, I do:

FileName = r'E:\Husky\Cypress\Target\V1\Start1.hex'
SerialNumber = u'SerNo.0001'
MemoryType = SHIP.HuskyUsbC.mt_RAM
esult =
SomethingC.WriteIntelHexFileToMemory(FileName,SerialNumber,MemoryType)

But at runtime I get:

TypeError: argument number 3: a 'WCHAR *' is expected, 'unicode(SerNo.0001)'
is received

I'm using SWIG-1.3.24 and Python 2.4.1

Suggestions, please.

Tia,
	Bill

~*""*~.,,.~*""*~.,,~*""*~.,,.~*""*~.,,~*""*~.,,.~*""*~.,,.~*""*~.,

Privileged/Confidential information may be contained in this message. If you
are not the addressee indicated in this message (or responsible for delivery
of the message to such person), you may not copy or deliver this message to
anyone. In such case, you should destroy this message, and please notify us
immediately. Please advise immediately if you or your employer does not
consent to Internet e-mail for messages of this kind.

Opinions, conclusions and other information expressed in this message are
not given or endorsed by my firm or employer unless otherwise indicated by
an authorised representative independent of this message.

Although we utilise the most up to date virus checking procedures you should
carry out your own virus check before opening any attachment. We accept no
liability for any loss or damage which may be caused by software viruses.

~*""*~.,,.~*""*~.,,~*""*~.,,.~*""*~.,,~*""*~.,,.~*""*~.,,.~*""*~.,

Bill Davy, Synectix Limited, 12 King Alfred Way, Cheltenham, GL52 6QP,
England

Telephone: +44 (0)1242 254411, Mobile: +44 (0)7866 451568, Fax: +44 (0)1242
256611

Work: mailto:Bill at SynectixLtd.com

Home: mailto:Bill at XchelSys.co.uk

Web: http://www.synectixltd.com/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 5202 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20050721/d0b80bf6/attachment.bin>


More information about the Cplusplus-sig mailing list