Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-12-2008, 03:11 PM
Junior Member
 
Join Date: Sep 2007
Posts: 9
Default dllimport problem

i use SWFKit Pro 3.1 i want to use dll i made it by C#.Net
sample code :

dllimport "ProcessorInfo.dll" stdcall String GetProcessorID();

var ProcID = GetProcessorID() ;
trace ( "ProcID = " + ProcID ) ;

where i put ProcessorInfo.dll in to import by application

Erorr takes place after preview
FSCommand("FFish_Run", "Initialize")
Warning: using undefined variable "GetProcessorID"
Warning: call a undefined function
Warning: using undefined variable "ProcID"
ProcID = undefined
Reply With Quote
  #2 (permalink)  
Old 03-12-2008, 03:22 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: dllimport problem

It is highly recommended that you add the dll into the "resources", and then
Code:
var mydll = getAdditionalFile("ProcessorInfo.dll");
dllimport mydll stdcall String GetProcessorID();
Reply With Quote
  #3 (permalink)  
Old 03-13-2008, 04:59 PM
Junior Member
 
Join Date: Sep 2007
Posts: 9
Default Re: dllimport problem

Dll doen not work after Modification
what i can do to work?
PLS Help Me
Reply With Quote
  #4 (permalink)  
Old 03-14-2008, 10:45 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: dllimport problem

Can you send us your dll? We'll have a try.
Reply With Quote
  #5 (permalink)  
Old 03-16-2008, 02:53 PM
Junior Member
 
Join Date: Sep 2007
Posts: 9
Default Re: dllimport problem

Thanks for you .... i attach the zip file contains a dll and skp file

wait your response
Reply With Quote
  #6 (permalink)  
Old 03-17-2008, 09:08 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: dllimport problem

The problem is that your dll does not export any function. Maybe you will have to check your source code.
Reply With Quote
  #7 (permalink)  
Old 03-17-2008, 02:22 PM
Junior Member
 
Join Date: Sep 2007
Posts: 9
Default Re: dllimport problem

i made this Dll with C#.Net and is working properly in it.
C#.Net Code :

using System;
using System.Management;

namespace ProcessorInfo
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class Proccessor
{
public string GetProcessorID()
{
string sCpuInfo = String.Empty;
bool bSuccess = false;

//*** Declare Management Class
ManagementClass clsMgtClass = new ManagementClass( "Win32_Processor" );
ManagementObjectCollection colMgtObjCol = clsMgtClass.GetInstances();

//*** Loop Over Objects
foreach( ManagementObject objMgtObj in colMgtObjCol )
{
//*** Only return cpuInfo from first CPU
if( sCpuInfo == String.Empty )
{
sCpuInfo = objMgtObj.Properties["ProcessorId"].Value.ToString();
bSuccess = true;
}
}

return sCpuInfo;
}

}
}

do Swfkit work probably With .net Code Syntax or have another Syntax For Dlls?
Reply With Quote
  #8 (permalink)  
Old 03-17-2008, 05:03 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: dllimport problem

We're not sure, but a dll must export a function explicitly so that it can be called in c/c++, pascal, or ffish script. Fortunately, you needn't write a dll, because the methods used in your .net code can be used in ffish script directly
Code:
var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
var service = locator.ConnectServer(".");
var properties = service.ExecQuery("SELECT * FROM Win32_Processor");
var e = new Enumerator (properties);

for (;!e.atEnd();e.moveNext ())
{
  var p = e.item ();

  trace(p.Caption);
  trace(p.DeviceID);
  trace(p.Name);
  trace(p.CpuStatus);
  trace(p.Availability);
  trace(p.Level);
  trace(p.ProcessorID);
  trace(p.SystemName);
  trace(p.ProcessorType);
}
Reply With Quote
  #9 (permalink)  
Old 03-18-2008, 07:16 AM
Junior Member
 
Join Date: Sep 2007
Posts: 9
Default Re: dllimport problem

thanks alot
Code is working ;
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:04 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.