The Gatling was apart of this but the "endless African Hordes" are mostly a myth made by movies and fiction. The truth is most battles involved Europeans outnumbering Africans.
Not sure where you get this idea from. Consider French colonial expansion. Here's a few examples of their colonial expeditions:
First Franco-Dahomean War - French forces are outnumbered by a 5-1 margin.
http://en.wikipedia.org/wiki/First_Franco-Dahomean_War
Second Franco-Dahomean War - French forces are outnumbered by a 2-1 margin.
http://en.wikipedia.org/wiki/Second_Franco-Dahomean_War
Tonkin Campaign - French forces are outnumbered by a 4-1 margin.
http://en.wikipedia.org/wiki/Tonkin_Campaign
Sino-French War - French forces outnumbered by almost a 2-1 margin.
http://en.wikipedia.org/wiki/Sino-French_War
These were not battles of attrition. The African campaigns especially were fought on the cheap. Huge advantages in technology were the equalizer. Despite being significantly outnumbered on a regular basis, the French forces inflicted huge casualties when they fought local armies.
This was a huge part of the appeal of imperialism. Vast lands could be conquered relatively easily, enhancing national prestige without too many losses. If the conquest of Africa/Asia had required the kind of massive military investment you describe, it would have been much less popular. (France indeed had a large military at this time, but much of it remained at home. Germany remained the primary military concern.)
Last edited: