Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-06-2005, 01:20 AM
Junior Member
 
Join Date: Dec 2005
Posts: 12
Default Need Help with Dll.registerFunction for user32.dll

Hi,

I am trying to register the user32 method GetCursorPos.

According to MSDN GetCursorPos returns a 0 if it fails, and I can't get it to return anything other than a 0.

Here is my code:

function Point()
{
this.x = new Number;
this.y = new Number;
}

var MyStructType = new DllParam(8, 1);


var j = Dll.registerFunction("user32.dll", "GetCursorPos", "GetCursorPos", "bool", MyStructType);


test = new Point();



var jj = GetCursorPos(test)


Dialogs.msgBox(jj);


------

jj is 0 unless i pass the DllParam by value. This however, still does not set the x/y values. Also, MSDN doc says that the struct needs to be passed by ref so that is not even an option.

PLEASE HELP!
Reply With Quote
  #2 (permalink)  
Old 12-06-2005, 02:11 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Need Help with Dll.registerFunction for user32.dll

Code:
var MyStructType = new DllParam(8, 1);


var j = Dll.registerFunction("user32.dll", "GetCursorPos", "GetCursorPos", 
"stdcall", "bool", MyStructType);

// the parameter of GetCursorPos must be a StringStream 
// that contains 8 bytes
function myParam()
{
this.value = new StringStream;
for (var i = 0; i < 8; i++) this.value.put(0);

function x() 
{
this.value.getPos = 0;
return this.value.getLong();
}

function y()
{
this.value.getPos = 4;
return this.value.getLong();
}
}

var test = new myParam;
var jj = GetCursorPos(test);
trace("x: ", test.x());
trace("y: ", test.y());
Reply With Quote
  #3 (permalink)  
Old 12-06-2005, 03:56 AM
Junior Member
 
Join Date: Dec 2005
Posts: 12
Default Re:Need Help with Dll.registerFunction for user32.dll

Thank you very much. SWFKIT is an awsome tool, and well worth the 299 price of admition.

And this should show all how great the support is for it. Same day response!

Thanks again, and I'll be sure to spread the word!

One more question. Is the next version of swfkit going to include standard OOP grammer? I really feel that once that is implemented the limits will be endless for this sweet little app!
Reply With Quote
  #4 (permalink)  
Old 12-08-2005, 12:13 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Need Help with Dll.registerFunction for user32.dll

Thank you too

The next version doesn't support OOP, but you can call ffish objects in flash 8 directly.
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:05 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.