Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-23-2008, 10:24 PM
Junior Member
 
Join Date: Apr 2008
Posts: 29
Default how to call a dll function (the function output parameters by reference)

I'm so sorry that my english is very bad! I want to call a dll function,but I can not make it work.
struct{
Boolean bAdminPrivilege
}admstru
struct{
String lstrUserName
}userstru
var myDll=getAdditionalFile("test.dll")
dllimport myDll cdecl Boolean GetUserNameAndType(String,Boolean) as checkuser
//trace(Dll.registerFunction(getAdditionalFile("test .dll"),"GetUserNameAndType",))
var admstruct=new Struct(admstru)
var userstruct=new Struct(userstru)
trace(admstruct)
var obj1=new Object()
var obj2=new Object()
obj1.value=admstruct
obj2.value=userstruct
trace(checkuser(obj2,obj1))//return undefined

Please tell me what am I doing wrong!If you have a better way,please give me a complete section
Reply With Quote
  #2 (permalink)  
Old 04-23-2008, 10:48 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: how to call a dll function (the function output parameters by reference)

Why do you use structures? It seems to be unnecessary.

Code:
var myDll=getAdditionalFile("test.dll");
dllimport myDll cdecl Boolean GetUserNameAndType(String,Boolean) as checkuser;
//trace(Dll.registerFunction(getAdditionalFile("test.dll"),"GetUserNameAndType",))

var obj1=new Object()
var obj2=new Object()
obj1.value=new StringStream;
obj1.value.length = 260;
obj2.value=false;
trace(checkuser(obj1,obj2));
trace(obj1.value);
trace(obj2.value);
Reply With Quote
  #3 (permalink)  
Old 04-24-2008, 09:10 AM
Junior Member
 
Join Date: Apr 2008
Posts: 29
Default very grateful to SWFKIT!!

thank you very much for the timely answer! I wish you good luck!!
but the code is still con not run properly ,when the test ,pop-up show:SWFkit Player Pro for applications has encountered a problem
and needs to close. where is the wrong code?

help me!!
Reply With Quote
  #4 (permalink)  
Old 04-26-2008, 08:10 PM
Junior Member
 
Join Date: Apr 2008
Posts: 29
Default sorry,I made a mistake!allow me to correct.

var myDll=getAdditionalFile("test.dll");
dllimport myDll cdecl Boolean GetUserNameAndType(long*,Boolean*) as checkuser;
var obj1=new Object()
var obj2=new Object()
obj1.value=100;
obj2.value=false;
trace(checkuser(obj1,obj2))
var point1=obj1.value
trace(Dll.getPointerValue(point1, 260))
trace(obj2.value);
//this should be normal operation

Thank you again SWFKIT!!!
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 05:10 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.