Author Topic: question 1  (Read 11797 times)

ncnnnn

  • Junior Member
  • **
  • Posts: 31
    • View Profile
question 1
« on: June 25, 2024, 15:23:30 »
1. how to use ILogger
can write log to mc'log?

2. create id  (mc how to set id)
"
// nID is the ID of the extensions that it should create. This is
extern "C" /*__declspec(dllexport)*/ PVOID APIENTRY Create( int nID )
{
  if( nID == 0 )
  {
    MCNS::MCAppExtensionSample* pExtension = new MCNS::MCAppExtensionSample();
    MCNS::IPluginInterface* pInterface = static_cast<MCNS::MCAppExtensionSample*>(pExtension);
    return pInterface;
  }

  if( nID == 1 )
  {
    MCNS::MCFilePropSample* pExtension = new MCNS::MCFilePropSample();
    MCNS::IFileProperties* pInterface = static_cast<MCNS::MCFilePropSample*>(pExtension);
    return pInterface;
  }

  return NULL;
}
"

thank your answer

I want  "File CheckSum" add   sm3.. and out  Base64Str.
or can input/paste String ,output sha256 512 sm3..(hex,base64)
« Last Edit: June 25, 2024, 15:28:21 by ncnnnn »

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4449
    • View Profile
    • Multi Commander
Re: question 1
« Reply #1 on: June 25, 2024, 15:41:16 »
1)
Depends on what type of extension..

From the IMultiAppInterface interface.

 // Create new log
 virtual ILogger*  CreateLogger() = 0;

 // Log to existing log
 virtual void LogFmt( UINT nLogID , LogLevel nLevel ,  const char*  strText , ... ) = 0;
 virtual void LogFmt( UINT nLogID , LogLevel nLevel ,  const WCHAR* strText , ... ) = 0;
 virtual void Log( UINT nLogID , LogLevel nLevel ,  const char*  strText ) = 0;
 virtual void Log( UINT nLogID , LogLevel nLevel ,  const WCHAR* strText ) = 0;

Code: [Select]
long MCAppExtensionSample::PreStartInit( IMultiAppInterface* pAppInterface )
{

  pAppInterface->LogFmt(0, LogLevel::_DEBUG_, L"Loading... %s", L"Parameter");
}

2) Id is just start from 0 to n , It is so you can have multiple extension in the same dll.
If you only have 1 extension. let it be 0.

« Last Edit: June 25, 2024, 15:43:34 by Mathias (Author) »

ncnnnn

  • Junior Member
  • **
  • Posts: 31
    • View Profile
Re: question 1
« Reply #2 on: June 26, 2024, 16:03:53 »
ok thank you!