Click here to Skip to main content
15,880,427 members
Articles / Desktop Programming / MFC

CPerlWrap - A class wrapper for embedding Perl into your MFC program

Rate me:
Please Sign up or sign in to vote.
4.85/5 (23 votes)
23 Feb 2012CPOL10 min read 215.5K   2.2K   90  
Simple class to allow fast, easy access to Perl and Perl variables.
// CPerlWrapperView.h : interface of the CCPerlWrapperView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_CPERLWRAPPERVIEW_H__8CA2A872_EEF9_41B0_BCDA_E60438F47B21__INCLUDED_)
#define AFX_CPERLWRAPPERVIEW_H__8CA2A872_EEF9_41B0_BCDA_E60438F47B21__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "PerlWrap.h"

class CCPerlWrapperView : public CFormView
{
protected: // create from serialization only
	CCPerlWrapperView();
	DECLARE_DYNCREATE(CCPerlWrapperView)

public:
	//{{AFX_DATA(CCPerlWrapperView)
	enum { IDD = IDD_CPERLWRAPPER_FORM };
	CEdit	m_PERLCODE;
	//}}AFX_DATA

// Attributes
public:
	CCPerlWrapperDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CCPerlWrapperView)
public:
	virtual void OnInitialUpdate(); // called first time after construct

protected:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	
	//}}AFX_VIRTUAL

// Implementation
public:
	CPerlWrap perlInstance;
	virtual ~CCPerlWrapperView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CCPerlWrapperView)
	afx_msg void OnEditCopy();
	afx_msg void OnEditCut();
	afx_msg void OnEditPaste();
	afx_msg void OnEditUndo();
	afx_msg void OnRun();
	afx_msg void OnSetvar();
	afx_msg void OnGetvar();
	afx_msg void OnSetarray();
	afx_msg void OnGetarray();
	afx_msg void OnGetwarn();
	afx_msg void OnClrwarn();
	afx_msg void OnGeterrs();
	afx_msg void OnSethash();
	afx_msg void OnGethash();
	afx_msg void OnEval();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in CPerlWrapperView.cpp
inline CCPerlWrapperDoc* CCPerlWrapperView::GetDocument()
   { return (CCPerlWrapperDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CPERLWRAPPERVIEW_H__8CA2A872_EEF9_41B0_BCDA_E60438F47B21__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Thales Visionix
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions