There are three ways a person can be discharged under DADT. Proclaiming oneself to be a homosexual, as you said, is one way. Another way is to attempt to marry someone of the same biological gender.
The third way, relevant to your question, is if a person has (from the text of the statute):
ENGAGED IN, ATTEMPTED TO ENGAGE IN, OR SOLICITED ANOTHER TO ENGAGE IN A HOMOSEXUAL ACT OR ACTS UNLESS THERE ARE FURTHER FINDINGS, MADE AND APPROVED IN ACCORDANCE WITH PROCEDURES SET FORTH IN SUCH REGULATIONS, THAT THE MEMBER HAS DEMONSTRATED THAT-
(A) SUCH CONDUCT IS A DEPARTURE FROM THE MEMBER'S USUAL AND CUSTOMARY BEHAVIOR;
(B) SUCH CONDUCT, UNDER ALL THE CIRCUMSTANCES, IS UNLIKELY TO RECUR;
(C) SUCH CONDUCT WAS NOT ACCOMPLISHED BY USE OF FORCE, COERCION, OR INTIMIDATION;
(D) UNDER THE PARTICULAR CIRCUMSTANCES OF THE CASE, THE MEMBER'S CONTINUED PRESENCE IN THE ARMED FORCES IS CONSISTENT WITH THE INTERESTS OF THE ARMED FORCES IN PROPER DISCIPLINE, GOOD ORDER, AND MORALE; AND
(E) THE MEMBER DOES NOT HAVE A PROPENSITY OR INTENT TO ENGAGE IN HOMOSEXUAL ACTS.
This is the section where gay servicemembers who have been outed by a another servicemember come in. This section generally creates a legal loophole where someone who wants a homosexual (or perceived homosexual) to be drummed out of the military can claim that said member made sexual advances against them (if they are the same gender) or someone of the same gender that they know, or they found out that the servicemember has made sexual advances toward, or had sex with, a member of the same sex outside the military. Finding out through items like diaries or letters are admissible.
The military then has to launch an investigation to determine whether or not the servicemember does not qualify for an exemption under the above five criteria.