Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » How to create controls through scripting ? Collapse All
Subject Author Date
Jayender S Jan 18, 2006 - 11:38 PM

Hi, I need to create some controls like button , Edit box .. how to do it ? say here is the code where u can get the value or set inot Editbox through Scripting


STDMETHODIMP CAppObject::SetStringToOutputField( BSTR str )
{
   AFX_MANAGE_STATE( ::AfxGetStaticModuleState() );
   if( str == NULL )
   return E_POINTER;
   USES_CONVERSION;
   CString s = OLE2CT( str );
   if(  m_pMainFrame->GetSafeHwnd() != NULL  && m_pMainFrame->m_wndView.m_editInputField.GetSafeHwnd() != NULL  )
       m_pMainFrame->m_wndView.m_editOutputField.SetWindowText( s );
   return S_OK;
}


 


No i need to create a button or edit box:.. how to do it ? say like i know to create edit box at run time like this:


CEdit* pEdit = new CEdit;
  pEdit->Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_BORDER,
   CRect(800, 10, 900, 30), this, IDC_MYEDIT);


but i need to call this function through scripting. how to do it ?


 

Technical Support Jan 20, 2006 - 1:58 PM

The CAppObject::SetStringToOutputField() method is invoked when the script invokes the AppObject.SetStringToOutputField() method. We do not think that creating windows from the script is reasonable. The better approach is to allow the script to operate with Active X controls and containers.

Jayender S Jan 23, 2006 - 1:49 AM

How to  allow the script to operate with Active X controls and containers  here? I have got the idea of assigning values to the Editboxthrough scriptin. buti need to create abutton or textbox through sripting.please help. waiting for ur reply.  thanks,

Technical Support Jan 25, 2006 - 4:38 AM

You need to merge the sample application we coded for you with implementation of the ActiveX control container which we suggested you to use. This will be a solution for creating any kind of controls via scripting.