The bright TeV source HESS J1640-465 is positionally coincident with the young SNR G338.3-0.0, and the nearby HESS J1641-463 with TeV gamma-ray emission seems to be closely associated with it. Based on the nonlinear diffusion shock acceleration (NLDSA) model, we explore the emission from these two TeV sources, the particle diffusion is assumed to be different inside and outside the absorbing boundary of the particles accelerated in the SNR shock. The results indicate that (1) the GeV to TeV emission from the region of the HESS J1640-465 is produced as a result of the particle acceleration inside the SNR G338.3-0.0; and (2) the runaway cosmic-ray particles outside the SNR are interacting with nearby dense molecular cloud (MC) at the region of the HESS J1641-463, corresponding $pi^0$ decay gamma-ray in proton-proton collision contribute to the TeV emission from the HESS J1641-463. Also we investigate the possible X-ray emission in molecular cloud from synchrotron procedure by secondary $e^pm$ produced through escaped protons interaction with the MC.