Ok - I took this issue out of the immediate window - don't need to add more to my problem then I need
Took the spot where I was doing the breakpoint - and instead of the immediate window I added this code to call the firstIndexOfKeyword() function
Code:
Private Sub ScanFile(ByVal FSObParam As Object)
Dim x As Object = firstIndexOfKeyword("i had fancy italian food for lunch", {"meh", "feh", "italian"}, 3)
Dim FSOb As New FSObject
FSOb = DirectCast(FSObParam, FSObject)
and I am getting this error
Code:
System.EntryPointNotFoundException was unhandled
Message=Unable to find an entry point named 'firstIndexOfKeyword' in DLL 'D:\ACS Desktop\dcx\dcx\Debug\StringLibrary.dll'.
Source=Librarian
TypeName=""
StackTrace:
at Librarian.Librarian.firstIndexOfKeyword(String s, String[] substr, Int32 substrLength)
at Librarian.Librarian.ScanFile(Object FSObParam) in D:\ACS Desktop\dcx\dcx\Librarian\Librarian.vb:line 145
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart(Object obj)
InnerException:
I am sure I am missing something from the C/C++ project - first time trying to work with C/C++.
This is in a file called StringLibrary.cpp
Code:
// StringLibrary.cpp : Defines the exported functions for the DLL application.
//
#include "stdafx.h"
__declspec(dllexport) int firstIndexOfKeyword(char *str, char **keywords, int nKeywords) {
int i, j, k;
int keywordlen;
int len = strlen(str);
for(k = 0; k < nKeywords; k++)
{
keywordlen = strlen(keywords[k]);
for(i = 0; i <= len - keywordlen; i++)
{
for(j = 0; j < keywordlen; j++)
{
if(keywords[k][j] != str[i + j])
j = keywordlen+1;
}
if(j == keywordlen)
return i;
}
}
return -1;
}