CloseClipboard Parameter

Posted By: krial057

CloseClipboard Parameter - 10/16/12 21:14

I wonder what I have to pass as parameter to CloseClipboard. The declaration in windows.h is:
long WINAPI CloseClipboard(long);

msdn says, that CloseClipboard sholdn't get any parameters:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms649035%28v=vs.85%29.aspx

If I pass NULL, the engine crashes. I replaced the line with
long WINAPI CloseClipboard();
in windows.h and now everything appears to work fine.
Is it a bug in 3dgs or am I doing something wrong? :S

regards Alain

Example code:
Click to reveal..
Code:
#include <acknex.h>
#include <windows.h>
function main()
{
	if(OpenClipboard(hWnd))
	{
		HANDLE hClipboardData = GetClipboardData(CF_TEXT);
		char *pchData = (char*)GlobalLock(hClipboardData);
		printf(pchData);		
		GlobalUnlock(hClipboardData);
		if(CloseClipboard(NULL)) //What to pass as parameter? oO
			printf("should be alright :S");
	}
}



EDIT: I think its not only CloseClipboard but also some others(like EmptyClipboard)
Posted By: krial057

Re: CloseClipboard Parameter - 06/10/13 18:06

*Bump*
It is still not working(tried A7 and A8). Can anyone confirm this? Should I make a Bug-report?
Posted By: Nems

Re: CloseClipboard Parameter - 06/10/13 19:27

Try your question in Higher Languages or Ask the Developers etc...

Cheers...
Posted By: WretchedSid

Re: CloseClipboard Parameter - 06/10/13 19:38

Crashing makes it look like it really should be void. Afair all WinAPI calls are stdcall, so you end up with a broken stack and jump to some undefined return address (if you make it to the ret of the function that is).

Post to the bugs forum (or ask a mod (this is your cue, Nems :p) to move it).
Posted By: jcl

Re: CloseClipboard Parameter - 06/12/13 09:17

Thanks! Yes, that's indeed wrong, and some other clipboard function prototypes also have a wrong argument. This will be fixed.
© 2023 lite-C Forums