M
Mike Marshall
Hi all
I've got an Unmanaged C++ DLL that basically acts as a wrapper for some
classes, that then wrap up some C libraries (namely CLucene and SQLite)
I've now trying to make use of those classes within my C++ .NET Webservice
I've got some code like this
SearchResults RepositoryNETClass::SearchRepository(String* Query, int
Number)
{
SearchResults oResults;
oResults.NumberOfHits = Number;
oResults.Query = Query;
oResults.Test = 100;
//Create the session
KAppRepositorySession* pRepositorySession = new KAppRepositorySession();
if (pRepositorySession->OpenRepository("default") != 0)
{
//Can't connect to the db
MessageBox(NULL,"Unable to connect","KApp Repository Demo",MB_OK);
return FALSE;
}
else
{
HitArray data = new SearchHit __gc[Number];
if (Number > 0 && Number <= 10)
{
for (int i = 0; i < Number; i++)
{
data.Title = new String("Hit ");
data.Title->Concat(i.ToString());
data.ID = i;
}
}
oResults.Hits = data;
}
return oResults;
}
but I get all manner of linker errors when i compile this.
I had a hunt around and found out about consuming unmanaged code when its
just functions exported out of a DLL but couldn't find anything relating to
classes.
Any help would be greatly appreciated
Mike Marshall
I've got an Unmanaged C++ DLL that basically acts as a wrapper for some
classes, that then wrap up some C libraries (namely CLucene and SQLite)
I've now trying to make use of those classes within my C++ .NET Webservice
I've got some code like this
SearchResults RepositoryNETClass::SearchRepository(String* Query, int
Number)
{
SearchResults oResults;
oResults.NumberOfHits = Number;
oResults.Query = Query;
oResults.Test = 100;
//Create the session
KAppRepositorySession* pRepositorySession = new KAppRepositorySession();
if (pRepositorySession->OpenRepository("default") != 0)
{
//Can't connect to the db
MessageBox(NULL,"Unable to connect","KApp Repository Demo",MB_OK);
return FALSE;
}
else
{
HitArray data = new SearchHit __gc[Number];
if (Number > 0 && Number <= 10)
{
for (int i = 0; i < Number; i++)
{
data.Title = new String("Hit ");
data.Title->Concat(i.ToString());
data.ID = i;
}
}
oResults.Hits = data;
}
return oResults;
}
but I get all manner of linker errors when i compile this.
I had a hunt around and found out about consuming unmanaged code when its
just functions exported out of a DLL but couldn't find anything relating to
classes.
Any help would be greatly appreciated
Mike Marshall