SQLite Forum

Loading my extension: specified procedure can't be found
Login
I have written two SQLite3 extensions. Both compile/build with Visual Studio. The first one works great, the second one gets the message "The specified procedure could not be found." I have stripped the second one down to its bare essentials in an attempt to locate the problem. No luck. I would appreciate if somebody would try to compile/build then .load the extension. (The stripped-down extension is toAscii.dll, and does nothing but return its text argument.) I think the problem may be Visual Basic settings, so if the code below loads into SQLite3 without an error, then some help with VB settings would be appreciated.

//SQLite3 extension to return text argument (and nothing else)

#include "pch.h"
#include <c:\eMail\sqlite3ext.h>
SQLITE_EXTENSION_INIT1

#ifdef __cplusplus
extern "C" {
#endif

	static void toAscii(
		sqlite3_context* context,
		int argc,
		sqlite3_value** argv
	)
	{
		char* text = (char*)sqlite3_value_text(argv[0]);	
		sqlite3_result_text(context, text, -1, SQLITE_TRANSIENT);
		return;
	}

#ifdef _WIN32
	__declspec(dllexport)
#endif

		int sqlite3_toAscii_init(
			sqlite3* db,
			char** pzErrMsg,
			const sqlite3_api_routines* pApi
		) {
		int rc = SQLITE_OK;
		SQLITE_EXTENSION_INIT2(pApi);
		(void)pzErrMsg;  /* Unused parameter */
		rc = sqlite3_create_function(db, "toAscii", 1,
			SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
			toAscii, 0, 0);
		return rc;
	}

#ifdef __cplusplus
}
#endif