예제 #1
0
MessageInfo Gplink::extractMessageInfo( const QString &text )
{

	if ( text.length()<5 || !text.startsWith("/") )
		return MessageInfo();
#if 0	
	const int index = text.find( ".asm", 0, false )+4;
	if ( index == -1+4 )
		return MessageInfo();
	const QString fileName = text.left(index);
	
	// Extra line number
	const QString message = text.right(text.length()-index);
	const int linePos = message.find( QRegExp(":[\\d]+") );
	int line = -1;
	if ( linePos != -1 )
	{
		const int linePosEnd = message.find( ':', linePos+1 );
		if ( linePosEnd != -1 )
		{
			const QString number = message.mid( linePos+1, linePosEnd-linePos-1 ).stripWhiteSpace();
			bool ok;
			line = number.toInt(&ok)-1;
			if (!ok) line = -1;
		}
	}
	return MessageInfo( fileName, line );
#endif
	return MessageInfo();
}
예제 #2
0
파일: gpdasm.cpp 프로젝트: Munrek/ktechlab
MessageInfo Gpdasm::extractMessageInfo( const QString &text )
{
	if ( text.length()<5 || !text.startsWith("/") )
		return MessageInfo();

    const int index = text.indexOf( ".asm", 0, Qt::CaseInsensitive )+4;
	if ( index == -1+4 )
		return MessageInfo();
	const QString fileName = text.left(index);

	// Extra line number
	const QString message = text.right(text.length()-index);
	const int linePos = message.indexOf( QRegExp(":[\\d]+") );
	int line = -1;
	if ( linePos != -1 )
	{
		const int linePosEnd = message.indexOf( ':', linePos+1 );
		if ( linePosEnd != -1 )
		{
			const QString number = message.mid( linePos+1, linePosEnd-linePos-1 )
                .trimmed();
			bool ok;
			line = number.toInt(&ok)-1;
			if (!ok) line = -1;
		}
	}

	return MessageInfo( fileName, line );
}
예제 #3
0
void CMyDialog::OnCommand(WPARAM wp, LPARAM lp)
{
	if (LOWORD(wp) == IDC_BUTTON1)
	{
		MessageInfo("Hello from DLL");
		if (!__FUnloadDelayLoadedDLL2("implicit_linking.dll"))
		{
			MessageAboutError(GetLastError());
			return;
		}
		MessageInfo("Hello from DLL");
	}
}
예제 #4
0
void CMyDialog::OnCommand(WPARAM wp, LPARAM lp)
{
	if(LOWORD(wp) == IDC_BUTTON1)
	{
		MessageInfo("Привет от первичного потока!");
		CreateThread(0,0,Thread,0,0,0);
	}
	else if(LOWORD(wp)==IDC_BUTTON2)
	{
		int f = 12;
		Ref(f);
		char str[10];
		wsprintf(str, "%d", f);
		MessageInfo(str);
		wsprintf(str, "%d", counter);
		MessageInfo(str);
	}

}
예제 #5
0
//============================================================
TCharC* TNetMessageBuffer::Dump(TChar* pDump, TSize capacity){
   // 获取网络信息
   TNetLength length = _netHead.Length();
   TUint16 protocol = _netHead.Protocol();
   TNetHash hash = _netHead.Hash();
   // 获取消息信息
   TUint8 type = _messageHead.Type();
   TUint8 command = _messageHead.Command();
   TUint16 code = _messageHead.Code();
   TNetMessageInfo* pMessageInfo = MessageInfo();
   TUint16 sourceTerminal = ENetTerminal_Unknown;
   TUint16 targetTerminal = ENetTerminal_Unknown;
   if(NULL != pMessageInfo){
      sourceTerminal = (TUint16)pMessageInfo->SourceTerminal();
      targetTerminal = (TUint16)pMessageInfo->TargetTerminal();
   }
   TCharC* pSourceTerminal = REnumNetTerminal::ToString((ENetTerminal)sourceTerminal);
   TCharC* pTargetTerminal = REnumNetTerminal::ToString((ENetTerminal)targetTerminal);
   // 生成数据信息
   TFsTrack dataTrack;
   TCharC* pDataTrack = RNetMessageFactory::DumpData(this, &dataTrack);
   // 生成信息
   TCharC* pName = RNetMessageFactory::CodeName(code);
   MO_LIB_STRING_FORMAT(pDump, capacity,
      TC("[ %s ]\n"
         "--------------------------------------------------------------------------------\n"
         "-- Net     : length=0x%04X(%d), protocol=%d, hash=0x%08X\n"
         "-- Message : code=(%02X:%04X), command=%d, source=%s(0x%04X), target=%s(0x%04X)\n"
         "--------------------------------------------------------------------------------\n"
         "%s"),
         pName,
         length, length, protocol, hash,
         type, code, (TUint8)command, pSourceTerminal, sourceTerminal, pTargetTerminal, targetTerminal,
         pDataTrack);
   return pDump;
}
예제 #6
0
void GameObject::clean(){
	send(ComponentMessage(ComponentMessage::CATEGORY_MISC, ComponentMessage::MISC_CLEAN, MessageInfo()));
}
예제 #7
0
DWORD WINAPI Thread(LPVOID lp)
{
	MessageInfo("Привет от фонового потока!");
	return 0;
}