Solved

Persistence CArray in ActiveX

Posted on 2003-11-06
7
295 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
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 

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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

777 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