Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / March 2005

Tip: Looking for answers? Try searching our database.

ATLASSERT (p == NULL)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Frankie - 07 Mar 2005 10:27 GMT
I am always getting this alert when I am iterating through the
projects in a solution. It occurs when this is executed:
cpp_projects->Item(num, &current_project)
cpp_projects is of type CComPtr<EnvDTE::Projects>.

Does one have to call the following functions all in one function?
cpp_solution->get_Projects(&cpp_projects);
cpp_projects->get_Count(&project_count);
cpp_projects->Item(num, &current_project);
Currently I have each function call in separate functions.

I am using VS .NET 2003 on WinXP SP2.
Mikhail Arkhipov (Microsoft) - 07 Mar 2005 15:16 GMT
You are probably leaking a project item interface. Each time you call Item()
it expects current_project to be NULL (i.e. Released). You have to manually
release the interface even if it is a smart pointer since it is probably
declared outside of the loop.

CComPtr<EnvDTE::Projects> cpp_projects;
CComPtr<Project> current_project;
...

for(int i = 0 ; i < project_count; i++)
{
   cpp_projects->Item(&current_project);
...
   current_project.Release();
}

OR declare pointer inside the loop instead (then you don't have to release
it).

for(i = 0 ; i < project_count; i++)
{
   CComPtr<Project> current_project;

...
}

Thanks

Mikhail Arkhipov (Microsoft)
-- This post is provided 'AS IS' with no warranties and confers no rights

On 3/7/05 2:27, in article
1110191253.598204.74650@l41g2000cwc.googlegroups.com, "Frankie"
<franzaklein@yahoo.co.uk> wrote:

> I am always getting this alert when I am iterating through the
> projects in a solution. It occurs when this is executed:
[quoted text clipped - 8 lines]
>
> I am using VS .NET 2003 on WinXP SP2.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.