Pamela Edstrom, a communications strategist who shaped the public image of Microsoft and its co-founder, Bill Gates, during the company’s reign as the most powerful technology player in the world, died on Tuesday at her home in Vancouver, Wash. She was 71.

Representatives of the public relations agency she co-founded in Bellevue, Wash., said she had died in her sleep after a four-month struggle with cancer.

When Ms. Edstrom joined Microsoft in Seattle in 1982 as its first director of public relations, the company was an obscure maker of software and personal computers were only beginning to climb out of hobbyist culture and into everyday businesses.

She departed less than two years later to join an acquaintance, Melissa Waggener, in forming a public relations agency known for most of its existence as Waggener Edstrom. Microsoft remains the biggest client of the firm, now known as WE Communications, one of the largest independent public relations agencies in the world, with revenue of $102 million last year.

Ms. Edstrom continued to exert huge influence on Microsoft, becoming one of Mr. Gates’s most trusted outside advisers and helping to promote the company’s mission of putting a PC into every home.

Later, as Microsoft became more powerful, it became ensnared in a series of bruising antitrust battles, emerging blemished with the image of a corporate bully toward partners and competitors.

Ms. Edstrom was one of a handful of counselors who helped the PC industry’s early entrepreneurs translate their work from engineering-speak into language the mainstream press and public could understand. Tech company founders, in their hands, were pitched as boy-genius wizards out to change the world. Steve Jobs, the co-founder of Apple, had a similar communications adviser in Regis McKenna.

“Pam was a creative pioneer who defined new ways of doing P.R. that made a huge mark on Microsoft and the entire industry,” Mr. Gates, who retired from Microsoft in 2008 to focus on philanthropy, wrote in an email.

In that era, before computer technology had seeped into the public consciousness and the internet and social media had transformed the media landscape, the traditional press was the gatekeeper to getting Microsoft’s story out. Ms. Edstrom — animated by what her partner, now named Melissa Waggener Zorkin, called a “relentless pursuit of relationships” — was a virtuoso of cultivating journalists.

In the 1990s she organized sleepovers for select groups of journalists at Mr. Gates’s vacation compound on Hood Canal, near Seattle, where they got to hear the Microsoft chief share his vision of technology.

David Kirkpatrick, then a technology writer at Fortune magazine, said that when his daughter was born 24 years ago, Ms. Edstrom mailed him aspirin and caffeine tablets in what she described as an emergency tool kit for new parents.

“She was a person who had an unusually deft ability to befriend and advise the journalist in a way that was truly beneficial while also serving her client,” said Mr. Kirkpatrick, who founded Techonomy, a technology conference.

Pamela Edstrom was born on Feb. 15, 1946, in Minneapolis to Richard Henley Newsome and Barbara Estelle Johnston. She received a bachelor’s degree from the University of Minnesota and a master’s from Portland State University.

In a commencement speech at the University of Minnesota last year, Ms. Edstrom said that she had wanted to pursue a career in law enforcement, but that she was told she was too short to get a job as a police officer or an F.B.I. agent. She was five feet tall.

Instead, she talked herself into a public relations job at Tektronix, a maker of oscilloscopes in Oregon, where she got her first exposure to an early technology company.

Steven A. Ballmer, who succeeded Mr. Gates as chief executive of Microsoft, recruited and hired Ms. Edstrom. In an email he recalled the time Ms. Edstrom, in the mid-1980s, organized a press event at a trade show in Las Vegas called the Windows Roast to commemorate the launch of the first version of that Microsoft operating system.

Microsoft was exceedingly late in delivering the product, and Ms. Edstrom decided that the best way to deal with that was with self-deprecation, which did not come naturally to Microsoft’s hard-charging executives.

“I thought it was nuts to make fun of ourselves for being two years later than we announced in shipping, but Pam was right on,” Mr. Ballmer, now the owner of the Los Angeles Clippers basketball team, wrote.

A book published in 1998, “Barbarians Led by Bill Gates,” said Ms. Edstrom and Rowland Hanson, another early communications executive, led the charge to turn Mr. Gates into a more public figure, “essentially the company mascot — a sort of high-technology Colonel Sanders.” The book was written by Marlin Eller, a former Microsoft programmer, and Jennifer Edstrom, Ms. Edstrom’s daughter, who survives her.

In her commencement speech last year, Ms. Edstrom described how she approached the risk of failure in her professional life by asking herself a question. “I mean, what is the very worst thing that could happen if I do this project?” she said. “I could die.”

“Hallelujah!” she continued. “I’m not going to die.”

Besides her daughter, from her first marriage, which ended in divorce, her survivors include her husband, Joseph Lamberton; four stepchildren, Suzanne Goodman and Todd, Bryan and Greg Lamberton; and seven grandchildren.