.
                obj.IsConsoleApplication, obj.ParentWindow);
            
            % Only one ccs job ID for v1 jobs.
            schedulerJobIDs = ccsJobID;
        end
        
        %---------------------------------------------------------------
        % submitParallelJob
        %---------------------------------------------------------------
        % NB Assumes that the job's tasks have already been duplicated and that the job has been
        % prepared for submission
        %
        % taskCommandToRun          the command to run by the task (i.e. mpiexec .......)
        % workersRange              a vector of 2 numbers indicating min/max workers
        % numTasks                  the number of tasks in this job
        % jobEnvironmentVariables   all the environment variables that are common for the distributed job
        % logLocation               the (full path to the) location to use for the task's log
        % username                  the username which will be used to launch the matlab processes
        % password                  the password associated with the username (an empty string will
        %                           cause the user to be prompted to enter a password).
        function [schedulerJobIDs, schedulerTaskIDs] = submitParallelJob(obj, taskCommandToRun, ...
                workersRange, numTasks, ...
                jobEnvironmentVariables, logLocation, ...
                username, password)
            obj.errorIfNotConnected;
            
            % Ensure we have enough cores on the cluster
            minProcessors = workersRange(1);
            maxProcessors = workersRange(2);
            totalCores = obj.TotalNumberOfCores;
            assert(totalCores >= minProcessors, 'parallel:cluster:HPCServerResourceLimit', ...
                    'The job has requested %d workers. The scheduler only has %d cores in the cluster.', ...
                    minProcessors, totalCores);
            
            % Determine whether or not we should set isExclusive or 
            % if we should defer to the XML file values.  We aren't interested
            % in whether or not the XML file defines min/max processors, as we
            % will be using the values defined in the parallel job.
            try
                [~, ~, isExclusiveDefined] = obj.parseDescriptionFile;
            catch err
                % Something went wrong when parsing the XML file. (Unlikely to get in here
                % since if the XML file is incorrect, createJobOnScheduler would already have
                % errored.)
                % Assume that we need to override the properties.
                warning(message('parallel:cluster:HPCServerFailedToParseJobDescriptionFile', err.message));
                isExclusiveDefined = false;
            end

            % Create a new job
            ccsJob = obj.createJobOnScheduler;
            % Always set the requested number of processors for parallel jobs, regardless
            % of whether these values may/may not be defined in the XML.
            ccsJob.MaximumNumberOfProcessors = maxProcessors;
            ccsJob.MinimumNumberOfProcessors = minProcessors;
            if ~isExclusiveDefined
                ccsJob.IsExclusive = obj.DoNotUseResourcesExclusively;
            end
            
            % All tasks will attach to task 1 on the scheduler
            schedulerTaskIDs = ones(numTasks, 1);
            
            % Create the one parallel task
            t = obj.ComputeClusterConnection.CreateTask();
            % Set the requ// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.

#include "stdafx.h"

#include "afxtoolbarbutton.h"
#include "afxtoolbardroptarget.h"
#include "afxtoolbar.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

/////////////////////////////////////////////////////////////////////////////
// CMFCToolBarDropTarget

CMFCToolBarDropTarget::CMFCToolBarDropTarget()
{
	m_pOwner = NULL;
}

CMFCToolBarDropTarget::~CMFCToolBarDropTarget()
{
}

BEGIN_MESSAGE_MAP(CMFCToolBarDropTarget, COleDropTarget)
END_MESSAGE_MAP()

BOOL CMFCToolBarDropTarget::Register(CMFCToolBar* pOwner)
{
	m_pOwner = pOwner;
	return COleDropTarget::Register(pOwner);
}

/////////////////////////////////////////////////////////////////////////////
// CMFCToolBarDropTarget message handlers

DROPEFFECT CMFCToolBarDropTarget::OnDragEnter(CWnd* /*pWnd*/, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point)
{
	ENSURE(m_pOwner != NULL);

	if (!m_pOwner->IsCustomizeMode() || !pDataObject->IsDataAvailable(CMFCToolBarButton::m_cFormat))
	{
		return DROPEFFECT_NONE;
	}

	return m_pOwner -> OnDragEnter(pDataObject, dwKeyState, point);
}

void CMFCToolBarDropTarget::OnDragLeave(CWnd* /*pWnd*/)
{
	ENSURE(m_pOwner != NULL);

	m_pOwner->OnDragLeave();
}

DROPEFFECT CMFCToolBarDropTarget::OnDragOver(CWnd* /*pWnd*/, COleDataObject* pDataObject, DWORD dwKeyState, CPoint point)
{
	ENSURE(m_pOwner != NULL);

	if (!m_pOwner->IsCustomizeMode() || !pDataObject->IsDataAvailable(CMFCToolBarButton::m_cFormat))
	{
		return DROPEFFECT_NONE;
	}

	return m_pOwner -> OnDragOver(pDataObject, dwKeyState, point);
}

DROPEFFECT CMFCToolBarDropTarget::OnDropEx(CWnd* /*pWnd*/, COleDataObject* pDataObject, DROPEFFECT dropEffect, DROPEFFECT /*dropList*/, CPoint point)
{
	ENSURE(m_pOwner != NULL);

	if (!m_pOwner->IsCustomizeMode() || !pDataObject->IsDataAvailable(CMFCToolBarButton::m_cFormat))
	{
		return DROPEFFECT_NONE;
	}

	return m_pOwner -> OnDrop(pDataObject, dropEffect, point) ? dropEffect : DROPEFFECT_NONE;
}


