Click here to Skip to main content
13,802,976 members
Click here to Skip to main content

Stats

292.7K views
78.4K downloads
226 bookmarked
Posted 30 Dec 2005
Licenced CPOL

Form Designer

, 1 Aug 2009
Component for adding scriptable forms capabilities to an application.
MFCDemo.exe
CSDemo
App.ico
Bmp
ABottom.bmp
About.bmp
ALeft.bmp
ARight.bmp
ATop.bmp
AX.bmp
BringFront.bmp
Button.bmp
Center.bmp
Check.bmp
Combo.bmp
Copy.bmp
Cut.bmp
Delete.bmp
Down.bmp
Edit.bmp
Frame.bmp
Grid.bmp
GridSettings.bmp
HCenter.bmp
HScroll.bmp
HSL.bmp
HSpace.bmp
HSS.bmp
Left.bmp
List.bmp
New.bmp
Open.bmp
Paste.bmp
Picture.bmp
Preview.bmp
Progress.bmp
Props.bmp
Radio.bmp
Rectangle.bmp
Redo.bmp
Right.bmp
Save.bmp
SelAll.bmp
SelNone.bmp
SendBack.bmp
SL.bmp
Slider.bmp
Spin.bmp
SS.bmp
Tab.bmp
Text.bmp
Undo.bmp
Up.bmp
Validate.bmp
VCenter.bmp
VScroll.bmp
VSL.bmp
VSpace.bmp
VSS.bmp
Wand.bmp
CSDemo.suo
DaeDoe.bmp
MFCDemo
MFCDemo.dsp
MFCDemo.odl
MFCDemo.reg
res
DaeDoe.bmp
MFCDemo.ico
MFCDemoDoc.ico
Toolbar1.bmp
Toolbar2.bmp
Toolbar3.bmp
Wand.bmp
VBDemo
Bmp
ABottom.bmp
About.bmp
ALeft.bmp
ARight.bmp
ATop.bmp
AX.bmp
BringFront.bmp
Button.bmp
Center.bmp
Check.bmp
Combo.bmp
Copy.bmp
Cut.bmp
Delete.bmp
Down.bmp
Edit.bmp
Frame.bmp
Grid.bmp
GridSettings.bmp
HCenter.bmp
HScroll.bmp
HSL.bmp
HSpace.bmp
HSS.bmp
Left.bmp
List.bmp
New.bmp
Open.bmp
Paste.bmp
Picture.bmp
Preview.bmp
Progress.bmp
Props.bmp
Radio.bmp
Rectangle.bmp
Redo.bmp
Right.bmp
Save.bmp
SelAll.bmp
SelNone.bmp
SendBack.bmp
SL.bmp
Slider.bmp
Spin.bmp
SS.bmp
Tab.bmp
Text.bmp
Undo.bmp
Up.bmp
Validate.bmp
VCenter.bmp
VScroll.bmp
VSL.bmp
VSpace.bmp
VSS.bmp
Wand.bmp
DaeDoe.bmp
VBDemo.vbp
DDForms.chm
DDForms
Archive
FormEditorItems.rgs
vssver.scc
Constants.scr
DaeDoe.bmp
DDForms.def
DDForms.vcproj
DDForms.vcproj.vspscc
EventSinkPassThrough.rgs
FormEditor.bmp
FormEditor.rgs
FormEditorItemCollection.rgs
FormEditorItemDetails.rgs
FormViewer.bmp
FormViewer.rgs
FormViewerItemCollection.rgs
FormViewerItemDetails.rgs
mssccprj.scc
PropPageExtended.rgs
PropPageFormEditor.rgs
PropPageFormViewer.rgs
PropPageSimpleScriptEditor.rgs
SimpleScriptEditor.bmp
SimpleScriptEditor.rgs
vssver.scc
DDFormsTools
CodeMaxDriver
CodeMaxDriver.rgs
CodeMaxDriver.vcproj
CodeMaxDriver.vcproj.vspscc
CodeMaxDriverps.def
CodeMaxDriverPS.vcproj
CodeMaxDriverPS.vcproj.vspscc
mssccprj.scc
vssver.scc
CodeSenseDriver
CodeSenseDriver.rgs
CodeSenseDriver.vcproj
CodeSenseDriver.vcproj.vspscc
CodeSenseDriverps.def
CodeSenseDriverPS.vcproj
CodeSenseDriverPS.vcproj.vspscc
mssccprj.scc
vssver.scc
DDPropPageAll
DDPropPageAll.def
DDPropPageAll.vcproj
DDPropPageAll.vcproj.vspscc
mssccprj.scc
PropPageAll.rgs
vssver.scc
DDUnlock
DDUnlock.vcproj
DDUnlock.vcproj.vspscc
mssccprj.scc
vssver.scc
DDControlPack
DDButton.bmp
DDCheckBox.bmp
DDComboBox.bmp
DDControlPack.rgs
DDControlPack.vcproj
DDControlPack.vcproj.vspscc
DDHorzScrollBar.bmp
DDLabel.bmp
DDListBox.bmp
DDPicture.bmp
DDRadioButton.bmp
DDTextBox.bmp
DDVertScrollBar.bmp
mssccprj.scc
vssver.scc
Redistributables
Ansi
CodeMaxDriver.dll
CodeSenseDriver.dll
DDControlPack.dll
DDForms.dll
DDPropPageAll.dll
Unicode
CodeMaxDriver.dll
CodeSenseDriver.dll
DDControlPack.dll
DDForms.dll
DDPropPageAll.dll
// StringHelpers.h
//
// Author : David Shepherd
//			Copyright (c) 2002, DaeDoe-Software
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_STRINGHELPERS_H__4468EFA1_2854_11D6_B6A6_856C06A39D46__INCLUDED_)
#define AFX_STRINGHELPERS_H__4468EFA1_2854_11D6_B6A6_856C06A39D46__INCLUDED_

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

// helper for client -> server
template <class T> // takes most standard containers
auto_array_ptr<LPCOLESTR> ComClientStringArrayToServer(const T &Container)
{
	// create a string array suitable for passing over com
	auto_array_ptr<LPCOLESTR> pArray(new LPCOLESTR [Container.size()]);
	// initialise each element
	DWORD Index=0;
	T::const_iterator iter=Container.begin();
	while(iter!=Container.end())
	{
		pArray.get()[Index++]=iter->c_str();
		iter++;
	}
	return pArray;
}

// helper for client <- server
template <class T> // takes most standard containers
void ComClientStringArrayFromServer(DWORD Count,LPCOLESTR *pArray,T &Container)
{
	// check parameters
	if(pArray==NULL)
	{
		throw std::exception();
	}
	// place each string into the container and free the remote storage
	for(long l=0; l<(long)Count; l++)
	{
		LPCOLESTR pString=pArray[l];
		if(pString==NULL)
		{
			throw std::exception();
		}
		Container.push_back(pString);
		CoTaskMemFree((LPVOID)pString);
	}
	// free the array remote storage
	CoTaskMemFree((LPVOID)pArray);
}

// helper for server -> client
template <class T> // takes most standard containers
LPCOLESTR *ComServerStringArrayToClient(const T &Container)
{
	// create a string array suitable for passing over com
	LPCOLESTR *pArray=
		(LPCOLESTR *)CoTaskMemAlloc(Container.size()*sizeof(LPCOLESTR));
	if(pArray==NULL)
	{
		throw std::exception();
	}
	// initialise each element
	DWORD Index=0;
	T::const_iterator iter=Container.begin();
	while(iter!=Container.end())
	{
		LPOLESTR pString=
			(LPOLESTR)CoTaskMemAlloc((iter->length()+1)*sizeof(OLECHAR));
		if(pString==NULL)
		{
			throw std::exception();
		}
		wcscpy(pString,iter->c_str());
		pArray[Index++]=pString;
		iter++;
	}
	return pArray;
}

// helper for server <- client
template <class T> // takes most standard containers
void ComServerStringArrayFromClient(DWORD Count,LPCOLESTR *pArray,T &Container)
{
	// check parameters
	if(pArray==NULL)
	{
		throw std::exception();
	}
	// place each string into the container
	for(long l=0; l<(long)Count; l++)
	{
		LPCOLESTR pString=pArray[l];
		if(pString==NULL)
		{
			throw std::exception();
		}
		Container.push_back(pString);
	}
}

#endif // !defined(AFX_STRINGHELPERS_H__4468EFA1_2854_11D6_B6A6_856C06A39D46__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)

Share

About the Author

DaveShep
Web Developer
United Kingdom United Kingdom
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web04 | 2.8.181215.1 | Last Updated 1 Aug 2009
Article Copyright 2005 by DaveShep
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid