• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 309
  • 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
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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