
442 S.E.2d 86 (1994)
114 N.C. App. 424
Walter COLE, Alfreda Cole Lee, Leondas Cole, Virginia Cole Bembury, Hercules Cole, Plaintiffs,
v.
Cleveland HUGHES, Richard Johnson, James L. Weeks, William L. Sharpe, Jr., and Hercules Cole, Sr., Defendants.
No. 931SC191.
Court of Appeals of North Carolina.
April 19, 1994.
*87 Happy, Mulkey & Warley, L.C. by J. Nelson Happy, Newport News, VA, for plaintiffs-appellees (Brief filed by Frank W. Ballance Jr. & Associates, P.A. by Frank W. Ballance Jr., and John H. Harmon, who were permitted to withdraw as counsel of record).
Clark & Stant, P.C. by Stephen C. Swain, Virginia Beach, VA, and C. Everett Thompson, II, Elizabeth City, for defendants-appellants Cleveland Hughes, Richard Johnson, James L. Weeks, and William L. Sharpe, Jr.
LEWIS, Judge.
On 30 September 1992 plaintiffs filed an action in Pasquotank County Superior Court seeking a declaratory judgment that they are the sole owners of a winning Virginia lottery ticket and its proceeds. Defendants filed an answer and counterclaim contending that the ticket is the property of a joint venture of which both plaintiffs and defendants were members. The trial court granted plaintiffs' motion for a judgment on the pleadings and *88 declared plaintiffs to be the sole owners of the ticket. The court also dismissed defendants' counterclaim on the basis that the joint venture was illegal and against North Carolina public policy. Defendants now appeal, alleging, among other things, that the trial court lacked subject matter jurisdiction over the Virginia lottery ticket and its proceeds, and that the trial court erred in determining the joint venture to be illegal.
In late 1989 defendants Johnson, Weeks, and Hughes, plaintiff Walter Cole, and several others who are not parties to this lawsuit, formed a joint venture for the purpose of pooling their money to purchase Virginia Lotto tickets. Membership in the group changed over time, and, at the time of the incident in question, included the parties to this lawsuit. Members of the venture periodically agreed upon the numbers to be chosen for their Lotto tickets. Various people were designated to buy the tickets over the years with the understanding that any money won would be divided among the members. On 9 September 1992, plaintiff Walter Cole purchased six tickets on behalf of the venture. According to Cole, he also purchased an additional ticket for himself, using a number which had previously been agreed upon and used by the venture. On 12 September 1992 the Virginia Lottery Department drew the numbers Cole had played on the additional ticket, thereby entitling the owner of the ticket to about $9,000,000. When members of the group contacted Cole, rejoicing in their good fortune at having one of their numbers chosen, Cole informed them that he would be keeping the money for himself and his children. Before Cole could claim the proceeds, however, defendants filed a Bill of Complaint seeking injunctive relief in a Virginia court. That court entered a preliminary injunction and ordered the Virginia Lottery Department to retain the lottery ticket and its proceeds pending a determination of "jurisdiction, venue, and other matters."

I.
The threshold issue is whether the trial court had subject matter jurisdiction to adjudicate ownership of the Virginia lottery ticket and to determine the validity of the joint venture. Defendants characterize this case as an in rem proceeding regarding the lottery ticket, and argue that the North Carolina trial court lacked in rem jurisdiction because the ticket itself was located in Virginia at the time the suit and counterclaim were filed. Plaintiffs, on the other hand, characterize this case as a declaratory judgment proceeding to determine the validity of, and the rights of the parties under, an alleged lottery-sharing agreement or venture. According to plaintiffs, the court did not attempt to exercise in rem jurisdiction over the lottery ticket. We agree with defendants that the trial court attempted to exercise in rem jurisdiction in adjudicating title to the Virginia lottery ticket.
In rem jurisdiction encompasses any action to
determine title to or to affect interests in specific property located within territory over which [the] court has jurisdiction[,]... [and also encompasses] [a]ctions in which the court is required to have control of the thing or object and in which an adjudication is made as to the object which binds the whole world and not simply the interests of the parties to the proceeding.
Black's Law Dictionary 793 (6th ed. 1990) (citations omitted). In North Carolina, a court is authorized to exercise in rem jurisdiction "[w]hen the subject matter of the action is real or personal property in this State and the defendant has or claims any lien or interest therein, or the relief demanded consists wholly or partially in excluding the defendant from any interest or lien therein." N.C.G.S. § 1-75.8(1) (1983). In rem jurisdiction may not be invoked over property located outside this State. See, e.g., Kirstein v. Kirstein, 64 N.C.App. 191, 306 S.E.2d 552 (1983) (real property); Lessard v. Lessard, 68 N.C.App. 760, 316 S.E.2d 96 (1984) (stating that court had in rem jurisdiction because the personal property, the estate of the defendant's deceased daughter, was located in North Carolina and the relief demanded was the exclusion of the defendant from the estate); Koob v. Koob, 283 N.C. 129, 195 S.E.2d 552 (1973) (stating that a court may exercise in rem jurisdiction over personal *89 property which is in the legal custody of the court).
Plaintiffs contend in their brief that their primary objective in filing this lawsuit was not to obtain a declaration of ownership of the ticket, but to obtain a declaration that the joint venture was unenforceable. Regardless of their primary objective, it is clear that at least part of plaintiffs' requested relief was a determination of ownership so as to exclude defendants from any interest in the lottery ticket. The ticket may or may not have been taken to North Carolina. The only question for us is where the ticket was located when plaintiffs sought to put the matter before the Superior Court of Pasquotank County, North Carolina. It is undisputed that it had been presented to the lottery authorities in Virginia, and that it is there now. Should we proclaim that some North Carolina party owns the ticket and all or part of the proceeds and the Virginia court disagrees, we would have done a vain thing. We do not have the jurisdiction to assert, or the power to enforce, such a decision in Virginia.
We note that the trial court entered two separate orders. In the first, the court declared that plaintiffs "are the sole and individual owners of Virginia lottery ticket XX-XX-XX-XX-XX-XX... and all proceeds arising from the ownership of said ticket...." In the second, the court dismissed defendants' counterclaim, which sought to establish a claim to the proceeds under the joint venture, on the basis that the venture was illegal and against the public policy of North Carolina.
The first order adjudicated title to an item of personal property located in Virginia. In determining title to the ticket, the court attempted to exercise in rem jurisdiction over it. We find that this order is invalid, because the ticket was in Virginia, and the court could not exercise in rem jurisdiction over personal property located outside this state. That order must be vacated. The second order adjudicated the rights of the parties under the alleged joint venture agreement. It is clear that the court had jurisdiction as to this issue: all parties to the agreement are North Carolina residents, and they entered into the venture in North Carolina.

II.
Defendants second contention on appeal is that the trial court erred in determining their joint venture to be illegal. We disagree. North Carolina public policy is against gambling and lotteries. See, e.g., State v. McCleary, 65 N.C.App. 174, 308 S.E.2d 883 (1983) (discussing North Carolina's public policy against gambling), aff'd per curiam, 311 N.C. 397, 316 S.E.2d 870 (1984). Several North Carolina statutes specifically render certain forms of gambling illegal. See N.C.G.S. §§ 14-290 (dealing in lotteries a misdemeanor, and mere possession of lottery ticket prima facie evidence of a violation of this section), -291.1 (selling or bartering lottery tickets "to be drawn or paid within or without the State" a misdemeanor, and possession of lottery ticket prima facie evidence of a violation of this section), -292 (operating or playing a game of chance a misdemeanor), -299 (money or property exhibited to allure persons to bet on any game is subject to seizure by court) (1993); N.C.G.S. § 16-1 (1983). We find that N.C.G.S. § 16-1 is applicable to the case at hand. That section provides:
All wagers, bets or stakes made to depend upon any race, or upon any gaming by lot or chance or upon any lot, chance, casualty or unknown or contingent event whatever, shall be unlawful; and all contracts, judgments, conveyances and assurances for and on account of any money or property, or thing in action, so wagered, bet or staked, or to repay, or to secure any money, or property or thing in action, lent or advanced for the purpose of such wagering, betting, or staking as aforesaid, shall be void.
The parties to the case at hand paid money and entered into an agreement, the outcome of which was dependent upon the Virginia Lotto, a contingent event, a chance, a lot, however "high tech." We believe that the trial court properly dismissed defendants' counterclaim, because it sought to enforce a contract or joint venture which is illegal and against the public policy of North Carolina.


*90 III.
In their final argument to this court, defendants contend that the trial court erred in granting plaintiffs' motions for a judgment on the pleadings and to dismiss. Because the motion for a judgment on the pleadings related to the in rem portion of the trial court's proceedings, we will not address it further. A claim should be dismissed only if it appears that the pleader is entitled to no relief under any statement of the facts which could be proven. Garvin v. City of Fayetteville, 102 N.C.App. 121, 401 S.E.2d 133 (1991). A dismissal is warranted if there is insufficient law to support the claim, if there are insufficient facts to support the claim, or if the disclosure of some fact will necessarily defeat the claim. Id.
We find the trial court properly granted plaintiffs' motion to dismiss the counterclaim. Taking the allegations to be true, defendants' counterclaim reveals that the parties entered into an agreement to purchase lottery tickets and purchased such tickets over a period of time. Under any statement of the facts, it is indisputable that the agreement is void as against North Carolina public policy and in violation of N.C.G.S. § 16-1. The agreement is unenforceable in North Carolina.
In conclusion, we find that the North Carolina courts may not exercise in rem jurisdiction over an item of personal property located in another state, nor may our courts enforce an agreement which is illegal and in violation of our public policy. We recognize that our disposition of this case leaves resolution of the issue of ownership of the lottery ticket and entitlement to its proceeds to the Virginia authorities.
Vacated in part and affirmed in part.
ORR and JOHN, JJ., concur.
