Hreturn = M_treectrl.insertitem (&curtreeitem);
If insertion fails, it'll return NULL, otherwise it'll return Handle the new item,
if (Hreturn)
Theinterface->addref ();
return hreturn;
}
//////////////////////////////////////////////////////////////////////////////////////////////////
Function:cmclientdlg::ncountparameter ()
//
Parameters:no parameters
//
Description:counts the number of parameters, the function takes
Returns:int
//
//////////////////////////////////////////////////////////////////////////////////////////////////
int Cmclientdlg::ncountparameter ()
{
Lvitem Item;
int ncounter;
int nnum;
Smisinputenum Isinput;
Nnum = M_parameters.getitemcount ();
for (ncounter = 0; Ncounter <= nnum; Ncounter + +)
{
Assignitem (&item, lvif_param,ncounter,0,0,0);
If could not get the item from list, return-1
if (M_parameters.getitem (&item) = = 0)
return-1;
Reinterpret_cast<isoapmapper *> (Item.lparam)->get_isinput (&isinput);
if (isinput = = smoutput)
Nnum--;
}
return nnum;
}
//////////////////////////////////////////////////////////////////////////////////////////////////
Function:cmclientdlg::modifydialog ()
//
Parameters:no Parameter
//
Description:modifies the Parameter list dialog
Returns:int
//
//////////////////////////////////////////////////////////////////////////////////////////////////
int Cmclientdlg::modifydialog ()
{
Modify the List control dialog, add two more column with their headers
RECT Rlistdialog;
int nreturn = 0;
int flag = 1;
M_parameters.getclientrect (&rlistdialog);
Nreturn = M_parameters.insertcolumn (0, _t ("Variable"), Lvcfmt_left, (Rlistdialog.right-rlistdialog.left)/3);
if (Nreturn = = 1)
{
Flag = 0;
MSG ("Could not modify the dialog");
}
Nreturn =m_parameters.insertcolumn (1, _t ("Type"), Lvcfmt_left, (Rlistdialog.right-rlistdialog.left)/3);
if (Nreturn = = 1)
{
Flag = 0;
MSG ("Could not modify the dialog");
}
Nreturn =m_parameters.insertcolumn (2, _t ("Value"), Lvcfmt_left, (Rlistdialog.right-rlistdialog.left)-(2* ( Rlistdialog.right-rlistdialog.left)/3));
if (Nreturn = = 1)
{
Flag = 0;
MSG ("Could not modify the dialog");
}
//////////////////////////////////////////////////////////////////////////////////////////////////
Function:cmclientdlg::checkforurl ()
//
Parameters:no parameters
//
Description:checks whether URL for WSDL file was given or not. If it is not given, returns-1
Returns:int
//
//////////////////////////////////////////////////////////////////////////////////////////////////
int Cmclientdlg::checkforurl ()
{
int flag = 1;
if (M_strurl.isempty ())
{
Flag = 0;
MSG ("WSDL file is not given");
}
Cleanup
if (flag = 0)
return-1;
return 1;
}
//////////////////////////////////////////////////////////////////////////////////////////////////
Function:cmclientdlg::D estroytree ()
//
Parameters:no parameters
//
Description:deletes the existing tree, if no problem occurs for deleting false
Returns:bool
//
//////////////////////////////////////////////////////////////////////////////////////////////////
BOOL Cmclientdlg::D estroytree ()
{
If any, exist, delete it, and also delete the list
int flag = 1;
if (M_treectrl.getcount ()!= 0)
{
if (!m_treectrl.deleteallitems ())
{
Flag = 0;
MSG ("Tree could not to be destroyed");
}
if (M_parameters.getitemcount ()!= 0)
{
if (m_parameters.deleteallitems () = = 0)
{
Flag = 0;
MSG ("Parameter list could not to be destroyed");;
}
}
}
Cleanup
if (flag ==0)
return false;
return true;
}
//////////////////////////////////////////////////////////////////////////////////////////////////
Function:cmclientdlg::updatelist ()
//
Parameters:no parameters
//
Description:updates parameters of the operation
//
Returns:int
//
//////////////////////////////////////////////////////////////////////////////////////////////////
int Cmclientdlg::updatelist ()
{
Uses_conversion;
If list is not empty, delete it
if (M_parameters.getitemcount ()!= 0)
{
if (m_parameters.deleteallitems () = = 0)
{
Flag = 0;
MSG ("Could not delete list");
}
}
Get the selected operation
Tvitem.mask = Tvif_param;
Tvitem.hitem = M_treectrl.getselecteditem ();
if (! Tvitem.hitem)
{
Flag = 0;
MSG ("Could not get selected item");
}
if (M_treectrl.getitem (&tvitem) = = 0)
{
Flag = 0;
MSG ("Could not get item");
}
In this loop take each parameter one by one
while ((hr = Ppienumsoapmappers->next (1, &pisoapmap, &cfetched) = = S_OK) && (Pisoapmap!= NULL))
{
flagsm = 1;
Type of parameter
hr = Pisoapmap->get_elementtype (&bstrelementtype);
Check_hresult (HR, "could not get name of parameter!");
Name of parameter
hr = Pisoapmap->get_elementname (&bstrelementname);
Check_hresult (HR, "Could not get the type of parameter!");
strtmp = Bstrelementtype;
Check what type of parameter it is? [In], [in,out] ...
hr = Pisoapmap->get_isinput (&isinput);
Check_hresult (HR, "Checking input type is failed");
Lvitem.lparam = (DWORD) (isoapmapper*) Pisoapmap;
Insert the item in to list
if (M_parameters.insertitem (&lvitem) = =-1)
{
Flag = 0;
MSG ("Could not set Item to List");
}
Lvitem.mask = Lvif_text;
Lvitem.isubitem = 1;
Lvitem.psztext = Strtmp.getbuffer (0);
Insert the second column
if (M_parameters.setitem (&lvitem) = = 0)
{
Flag = 0;
MSG ("Could not insert the Item to List");
}
I have to ADDREF () before pisoapmap = 0, otherwise I'll loose the object
((iunknown*) pisoapmap)->addref ();
Release Pisoapmap
Pisoapmap = 0;
}
if (flagsm = 0)
{
Flag = 0;
MSG ("Getting Operation parts failed");
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.