[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 307
  • Last Modified:

Persistence CArray in ActiveX

How can i save a CArray with user defined structure in the persistence of an ActiveX?
0
DAE
Asked:
DAE
  • 4
  • 3
1 Solution
 
Roshan DavisCommented:
typedef struct tagSTRUCTAx
{
      // members;
}
STRUCTAx;


#include "AfxTempl.h"


CArray<STRUCTAx, STRUCTAx> m_arAx;


You can use CArchieve for saving this into a file also

Rosh :)
0
 
DAEAuthor Commented:
I mean in:

PX_Blob( )
PX_Bool( )
PX_IUnknown( )
PX_Long( )

etc, etc, etc.
0
 
Roshan DavisCommented:
use void pointers (void *) in the structire as members.... Get the memory from Blob etc by calling GlobalAlloc.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
DAEAuthor Commented:
Give me an example, please.

Thaks Rosh.
0
 
Roshan DavisCommented:
typedef struct tagSTRUCTAx
{
     HANDLE hBlob;
     bool bBool;
}
STRUCTAx;

#include "AfxTempl.h"


in the class header ActiveXCtl.h

CArray<STRUCTAx, STRUCTAx> m_arAx;


void CActiveXCtrl::DoPropExchange(CPropExchange* pPX)
{
      ...

      STRUCTAx sSTRUCTAx;

      PX_Blob(pPX, _T("YourProperty"), sSTRUCTAx.hBlob);

      m_arAx.Add(sSTRUCTAx);
      
      ...
}

Rosh :)
0
 
DAEAuthor Commented:
Thaks Rosh, you are like the superman of the code.

Diego.
0
 
Roshan DavisCommented:
Thankx :o)
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now