Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Flyff > Flyff Private Server
You last visited: Today at 19:04

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



When App close it wont open again.

Discussion on When App close it wont open again. within the Flyff Private Server forum part of the Flyff category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2012
Posts: 948
Received Thanks: 157
When App close it wont open again.

Hi elitepvpers,

I am wondering about something.
Inside WndFriendConfirm.cpp we have an class called CWndAddFriend()

Now what I did was remove it from the WndFriendConfirm and made an new file called WndAddFriend.cpp and .h.

I copied the function from WndFriendConfirm to WndAddFriend.

I also removed the m_pWndAddFriend from WndManager.cpp cause there are to many if/else constructions.

I show here the codes.

WndAddFriend.cpp
Code:
#include "stdafx.h"
#include "WndAddFriend.h"
#include "defineText.h"
#include "AppDefine.h"
#include "DPClient.h"
#include "WndFriendConFirm.h"
extern	CDPClient	g_DPlay;

CWndAddFriend g_AddFriend;

#include "WndManager.h"
/****************************************************
  WndId : APP_ADD_FRIEND - Add Friend
  CtrlId : WIDC_STATIC1 - Ä£±¸ À̸§
  CtrlId : WIDC_EDIT1 - 
  CtrlId : WIDC_OK - Ok
  CtrlId : WIDC_CANCEL - Cancel
****************************************************/

CWndAddFriend::CWndAddFriend()
{
	m_pWndAddFriend = NULL;
}
CWndAddFriend::~CWndAddFriend()
{
	SAFE_DELETE(m_pWndAddFriend);
}
void CWndAddFriend::OnDraw(C2DRender* p2DRender)
{
}
void CWndAddFriend::OnInitialUpdate()
{
	CWndNeuz::OnInitialUpdate();
	// 여기에 코딩하세요

	CWndEdit* pWndEdit = (CWndEdit*)GetDlgItem(WIDC_EDIT1);
	pWndEdit->SetFocus();

	// 윈도를 중앙으로 옮기는 부분.
	CRect rectRoot = m_pWndRoot->GetLayoutRect();
	CRect rectWindow = GetWindowRect();
	CPoint point(rectRoot.right - rectWindow.Width(), 110);
	Move(point);
	MoveParentCenter();
}
// 처음 이 함수를 부르면 윈도가 열린다.
BOOL CWndAddFriend::Initialize(CWndBase* pWndParent, DWORD /*dwWndId*/)
{
	// Daisy에서 설정한 리소스로 윈도를 연다.
	return CWndNeuz::InitDialog(g_Neuz.GetSafeHwnd(), APP_ADDFRIEND, 0, CPoint(0, 0), pWndParent);
}
BOOL CWndAddFriend::OnCommand(UINT nID, DWORD dwMessage, CWndBase* pWndBase)
{
	return CWndNeuz::OnCommand(nID, dwMessage, pWndBase);
}
void CWndAddFriend::OnSize(UINT nType, int cx, int cy) \
{
	CWndNeuz::OnSize(nType, cx, cy);
}
void CWndAddFriend::OnLButtonUp(UINT nFlags, CPoint point)
{
}
void CWndAddFriend::OnLButtonDown(UINT nFlags, CPoint point)
{
}
BOOL CWndAddFriend::OnChildNotify(UINT message, UINT nID, LRESULT* pLResult)
{
	if (nID == WIDC_OK)
	{
		LPCTSTR szAddName;
		CWndEdit* pWndEdit = (CWndEdit*)GetDlgItem(WIDC_EDIT1);
		szAddName = pWndEdit->GetString();
		if (strlen(szAddName) < MAX_NAME)
		{
			if (strcmp(szAddName, g_pPlayer->GetName()) != 0)
			{
				if (g_pPlayer->GetWorld() && g_pPlayer->GetWorld()->GetID() == WI_WORLD_GUILDWAR)
				{
					g_WndMng.OpenMessageBox(prj.GetText(TID_GAME_GUILDCOMBAT_CANNOT_FRIENDADD));	// "수정해야함 : 길드대전장에는 친구추가를 할수 없습니다" );
				}
				else
				{
					g_DPlay.SendAddFriendNameReqest(szAddName);
					//g_WndMng.PutString( "메신저 추가 요청중입니다. 잠시만 기다려주세요", NULL, 0xffff0000 );
					CString str;
					str.Format(prj.GetText(TID_GAME_MSGINVATE), szAddName);
					g_WndMng.PutString(str, NULL, prj.GetTextColor(TID_GAME_MSGINVATE));
				}
				Destroy();
			}
			else
			{
				pWndEdit->SetString("");
				g_WndMng.OpenMessageBox(_T(prj.GetText(TID_DIAG_0056)));
				//				g_WndMng.OpenMessageBox( "자기 자신은 추가할수 없습니다. 다시 입력해주세요." );
			}
		}
		else
		{
			pWndEdit->SetString("");
			g_WndMng.OpenMessageBox(_T(prj.GetText(TID_DIAG_0057)));
			//			g_WndMng.OpenMessageBox( "이름이 너무 깁니다. 다시 입력해주세요." );
		}
		// 여기다가 승락하는 처리 추가하시오
		//		g_DPlay.SendAddFriend( m_uLeader, m_nLeaderSex );
	}
	else
	if (nID == WIDC_CANCEL)
	{
		Destroy();
	}

	return CWndNeuz::OnChildNotify(message, nID, pLResult);
}
void CWndAddFriend::OnDestroyChildWnd(CWndBase* pWndChild)
{
	if (m_pWndAddFriend == pWndChild)
	{
		SAFE_DELETE(m_pWndAddFriend);
		pWndChild = NULL;
	}
}
void CWndAddFriend::Destroy(void)
{
	SAFE_DELETE(m_pWndAddFriend);
}
void CWndAddFriend::Free()
{
	SAFE_DELETE(m_pWndAddFriend);
}
I added CWndAddFriend::OnDestroyChildWnd() / CWndAddFriend:estroy() and CWndAddFriend::Free()

well here is the problem. When I open the Add Friend App and close it. It wont open up again. I need to close the Neuz entirely to be able to open up the APP_ADD_FRIEND.

I am learning on how it works by seeing other Wnd functions that doenst involve WndManager so I can clear things up.

If you have an tip on where I need to look I can do the rest my self.
Atm I am an bit lost.

With kind regards,
raventh1984 is offline  
Old 08/09/2015, 17:43   #2
 
Mognakor's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 598
Received Thanks: 465
Are you sure you want to destroy the APP?
Shouldn't you just close it.
Mognakor is offline  
Old 08/09/2015, 18:36   #3
 
elite*gold: 0
Join Date: Oct 2012
Posts: 948
Received Thanks: 157
Well if I take an close look to some other Applets they are all getting destroyed.

It only happens when I take the m_pWndAddFriend out of WndManager.cpp inside these functions

void CWndMgr::Free()
void CWndMgr::OnDestroyChildWnd( CWndBase* pWndChild )

When I leave it in there then its working fine. I think its because CWndMgr is Class extension of CWndBase correct?
raventh1984 is offline  
Old 08/09/2015, 19:35   #4
 
Mognakor's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 598
Received Thanks: 465
Did you compare the way you create/open the applet to how other applets do it?

And can you show us the code which creates/opens your applet?
Mognakor is offline  
Old 08/09/2015, 21:48   #5
 
elite*gold: 0
Join Date: Oct 2012
Posts: 948
Received Thanks: 157
Well this one is quite simple because its an existing code. Its the code to add an player to your Friends list.

Here it is
Code:
BOOL CWndMessenger::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) 
{
        if( nID == WIDC_ADD )
	{
//		if( g_WndMng.GetWndBase( APP_ADD_FRIEND ) == FALSE )
		if( !g_WndAddFriend.m_pWndAddFriend )
		{
			g_WndAddFriend.m_pWndAddFriend = new CWndAddFriend;
			g_WndAddFriend.m_pWndAddFriend->Initialize();
			
		}
	}
}
Because I no longer use the CWndMngr I have it now like the above code instead of

Code:
BOOL CWndMessenger::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ) 
{ 
	if( nID == WIDC_ADD )
	{
//		if( g_WndMng.GetWndBase( APP_ADD_FRIEND ) == FALSE )
		if( !g_WndMng.m_pWndAddFriend )
		{
			g_WndMng.m_pWndAddFriend = new CWndAddFriend;
			g_WndMng.m_pWndAddFriend->Initialize();
			
		}
	}
raventh1984 is offline  
Reply


Similar Threads Similar Threads
S4 League wont open?
05/22/2014 - S4 League - 2 Replies
Hi epvp, My s4 league opens and closes really fast... Look at the video and you will see what i mean. Plssss help me ;) https://www.youtube.com/watch?v=UK7Co2BJmgo
sro wont open site wont open
04/02/2010 - Silkroad Online - 21 Replies
Ok well i was in sro on my way to grind, and outta no where i discconected, im like w/e ill reopen it, then i open it pops up that thing that says 'silkroad online is under inspection blahblahblah" so im like ok lets see how long is left on it on the website i go to joymax.com it keeps saying Unable to connect
bot wont open >:
05/16/2007 - Silkroad Online - 9 Replies
i seem to have a problem with sm.dll cuz when i try to run the game it gets stuck somewhere... and if rename sm.dll &#092;delete it , the game starts but without the auto training button &#092; multi client &#092; +unknown skillz ... heres a screen shot of whats going on ,, NotiCe that the screen has been made AFTER i pressed start (so u wouldnt think that thats my question) http://www.2shared.com/file/1900997/eae770...tmap _Image.html also the sm log seems to b corrupted ... cuz whenever i try to...
bot wont open
05/14/2007 - Silkroad Online - 49 Replies
i've tryed to install net framework reinstalled sro ... treyd every softmod on the site ... nothing helped me some1 knows what to do ... cuz without the softmod the game is running but when i put the softmod files in it gets stuck at and the game dont come up ...



All times are GMT +1. The time now is 19:05.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.