Software Archive
Read-only legacy content
17061 Discussions

Win32 API function wsprintf

Intel_C_Intel
Employee
499 Views
How does one get wsprintf to work?

I use READ..WRITE for text conversion...but wsprintf is one of the few APIs that I can't get to work.

Is it the _cdecl C calling convention?
Is it how the arguments are moved on the stack?

Enclose is one example of some code I tried with default project settings.

! Start.
'
'
USE DfWin ! Right?
INTEGER i
CHARACTER*25 lpStrg

i=wsprintf(lpStrg,"%s",'Hello'c)

'
'
! End.

! Produces the following error:
Error: This name does not have a type, and must have an explicit type. [WSPRINTF]

It seems the function can not be located, right?

Thank You!
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
499 Views
I don't see why you need wsprintf -- simple internal WRITE would do it simplier and purer:

WRITE(lpStrg,'(A)') 'Hello'C

I think that's the reason why Compaq didn't even include it in Win32 headers. And yes, it's C calling convention.

Jugoslav
0 Kudos
Intel_C_Intel
Employee
499 Views
Thank You!
0 Kudos
Reply