Original Post
Hi,
I have a dialog type application, A in VC++ which need to execute and pass some information to a single document with database view type application, B.I can easily execute the B without passing any information easily but when i need to pass some information to B, it seems that there is some problem.Because I actually need to pass the information to B and the B in turns input the information to the database.Lets say for the B to execute, which part of the code does it call?To call another application to execute,this is how it works.
In application A,
sprintf(strMsg, "testing | %s ", strRemoteBDAddr);
_spawnlp(_P_NOWAIT,"ISDatabaseAccess","HMMM",strMsg,NULL);
ISDatabaseAccess is the name of the application B.
strMsg is the char[100] information that is going to be passed.
_spawnlp is the command to execute another application.
In application B,
BOOL CISDatabaseAccessView:
reCreateWindow(CREATESTRUCT& cs)
{
CWinApp *pApp;
pApp = AfxGetApp( );
CHAR *str_BDAddr = NULL;
str_BDAddr = pApp->m_lpCmdLine; //get the information from application A
m_bdaddress_edit.ReplaceSel((CString)str_BDAddr);
return CRecordView:
reCreateWindow(cs);
}
I place the code where it retrieve the data in the PreCreateWindow(..) because I think this is the first function it will called when it first started but it will still pop up an error saying the data is not found.I tried to put the retrieving of data codes in OnInitialUpdate() functions but it also popup the same error.I may not explain this problem clearly but this is all I know how to explain my problem.Can someone kindly help me?Thank you.
