Problem in OAProject.Properties  
Author Message
jog





PostPosted: Visual Studio Extensibility, Problem in OAProject.Properties Top

Hi

I'm using the MPF with my specific VS projects but I got an error while acessing their properties (i'm using September SDK). In the OAProject property,

public virtual EnvDTE.Properties Properties

{

get

{

object outputProperties = null;

IVsExtensibility3 vsExtensibility3 = this.project.GetService(typeof(IVsExtensibility)) as IVsExtensibility3;

vsExtensibility3.GetProperties(this, this.project.NodeProperties, out outputProperties);

return (EnvDTE.Properties)outputProperties;

}

}

I always get an error 'Attempted to read or write protected memory' in the GetProperties call.

However, if I change the code to an implementation similar to OAProjectItem

...

if (this.project.NodeProperties == null)

{

return null;

}

return new OAProperties(this.project.NodeProperties);

it seems to work fine... What is the problem and the need for the former implementation

thanks




Visual Studio13  
 
 
Carl Brochu MSFT





PostPosted: Visual Studio Extensibility, Problem in OAProject.Properties Top

Couple of questions to figure this out
Where do you get the properties from Is it from a DTE object in an addin or a macro

If you have custom project properties, you could try to make sure that you types have the right COM attributes so they can be passed as IDispatch objects.