|
|||
|
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 |
|
|||
|
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? |
|
|||
|
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);
}
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|