Solved

Persistence CArray in ActiveX

Posted on 2003-11-06
7
293 Views
Last Modified: 2013-11-20
How can i save a CArray with user defined structure in the persistence of an ActiveX?
0
Comment
Question by:DAE
  • 4
  • 3
7 Comments
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9698798
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
 

Author Comment

by:DAE
ID: 9698995
I mean in:

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

etc, etc, etc.
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9699074
use void pointers (void *) in the structire as members.... Get the memory from Blob etc by calling GlobalAlloc.
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:DAE
ID: 9699268
Give me an example, please.

Thaks Rosh.
0
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 50 total points
ID: 9699284
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
 

Author Comment

by:DAE
ID: 9699305
Thaks Rosh, you are like the superman of the code.

Diego.
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9699315
Thankx :o)
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now