U++ framework
Do not panic. Ask here before giving up.

Home » Community » Newbie corner » Passing an ArrayCtrl / SqlArray to a function template
Passing an ArrayCtrl / SqlArray to a function template [message #49276] Mon, 15 January 2018 11:51 Go to previous message
Giorgio is currently offline  Giorgio
Messages: 218
Registered: August 2015
Experienced Member
Hi folks,
I am creating a small util library for my applications (actually, is a namespace).

I use frequently a method to export the content of a SqlArray /ArrayCtrl to a csv file, so it makes sense to include it in this library.

template <class T>
	void ExportCSV(T o)
	{
		String filename = "";
		FileSel fs;
	
		CoInitialize(NULL);
		PWSTR path = 0;
		SHGetKnownFolderPath(FOLDERID_Desktop, KF_FLAG_SIMPLE_IDLIST, NULL, &path);
		std::wstring s = path;
		std::string homedir( s.begin(), s.end() );
		homedir.append("\\");
		CoTaskMemFree(path);
		
		fs.Type("CSV", "*.csv");
		fs.PreSelect(homedir);
		if(!fs.ExecuteSaveAs()) return;
		filename = fs;
		SaveFile(filename, "Prova");
		FileOut out(filename);
		if(!out) {
			Exclamation(t_("Failed opening ") + filename);
			return;
		}
		
		out.Put(o.AsCsv());
	}


When I compile I get the following error:

error C2280: 'Upp::ArrayCtrl::ArrayCtrl(Upp::ArrayCtrl &)': attempting to reference a deleted function

I know this is a really generic question, but I am bit lost.

Regards,
Gio
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: build methods
Next Topic: StreamRasterEncoder?
Goto Forum:
  


Current Time: Fri May 29 19:01:46 GMT+2 2026

Total time taken to generate the page: 0.00588 seconds