?
Solved

Persistence CArray in ActiveX

Posted on 2003-11-06
7
Medium Priority
?
303 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 

Author Comment

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

Thaks Rosh.
0
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 200 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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 this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

752 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