#include "StdAfx.h" #include "CResFile.h" #include "T2AdvertisePlugin.h" #include "T2BitImage.h" #include "T2ImageObj.h" T2AdvertisePlugin::T2AdvertisePlugin(DWORD type, T2PluginSpecifier& specifier) : T2SubPlugin(type, specifier) { mPath = ""; mCC = 0; mD0 = 0; mDay = 0; mMoney = 0; mSubType = 0; mTieup = NULL; } /*virtual*/ T2AdvertisePlugin::~T2AdvertisePlugin() { } /*virtual*/ void T2AdvertisePlugin::LoadRsrcFromStream(CResFile& resFile) { T2SubPlugin::LoadRsrcFromStream(resFile); resFile >> mSubType; resFile >> mCC; resFile >> mD0; resFile >> mDay; resFile >> mMoney; resFile >> mPath; } void T2AdvertisePlugin::UnfoldPluginSelf() { if (mCC != 0) { mImage = new T2BitImage(mSpecifier.mPath, mCC, 1); mImageObj = new T2ImageObj; mImageObj->AddObject("BILL", -1, *mImage, NULL, 0, 0); } } unsigned int T2AdvertisePlugin::GetSubType() { return mSubType; } unsigned int T2AdvertisePlugin::GetDay() { return mDay; } int T2AdvertisePlugin::GetMoney() { return mMoney; } void T2AdvertisePlugin::GetPath(CString& outStr) { outStr = mPath; } /*virtual*/ unsigned long T2AdvertisePlugin::LoadSelf() { unsigned long result = 0; CResFile resFile; if (resFile.OpenResource(mSpecifier.mPath, 128, 'ADDF')) LoadRsrcFromStream(resFile); else result = 0xFFFFFFFF; return result; }