Click here to Skip to main content
15,870,130 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
I want to implement the IPersistPropertyBag Interface for an ActiveX Control in VB.NET so any sample code or link to an article about that interface would be appreciated.
Posted
Comments
ZurdoDev 6-Dec-14 15:27pm    
I imagine there are many links online if you search google.
VAlain 6-Dec-14 15:35pm    
I imagine you didn't googled it yourself... There is almost nothing for VB.NET, there are some for BizTalk but I don't use BizTalk, I also found some for VB6 but I'm using VB.NET (2012) witch is totally different.
ZurdoDev 6-Dec-14 15:39pm    
You need to be clear on where you are stuck since no one is going to do this all for you.

In Visual Studio, when you implement an intereface you get a smart tooltip and can choose to have .Net put in all the methods for you. Then you need to lookup each method to see what it does.

Then, if you are still still stuck on something specific we can help you.
VAlain 6-Dec-14 16:03pm    
I already made a specific post with the code I had but had no answer so that's why I tried just asking for sample code.
Maciej Los 6-Dec-14 15:58pm    
Do not repost![^]
I suggest to delete this question.

1 solution

Why implementing that interface should be different from other interfaces?
VB
Class MyBag
    Implements IPersistPropertyBag

    Sub Load(ByVal propertyBag As IPropertyBag, ByVal errorLog As Integer) Implements IPersistPropertyBag.Load
    End Sub
End Class
 
Share this answer
 
Comments
VAlain 7-Dec-14 11:04am    
Your solution is very far from been complete I also need the interface definition and it is different because that definition is in native code so I need to use some attributes like ComImport, Guid, InterfaceType, PreserveSig, etc. but with all the code snippets I found yet I could not make the persistence to work, my control work well but it looks like my interface isn't queried by Word or Excel when I put the control on a form as it should be.
Kornfeld Eliyahu Peter 7-Dec-14 11:20am    
The answer is as complete as the question is...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900