Wow - confusing to say the least!
Seems that after I read that and a few other links - and a chapter from a Manning book that C++/CLI is all about giving a tool to C++ developers to come in and develop software that can talk to the .Net framework.
Let me explain my task a bit further and hopefully you can tell me if I should explore this C++/CLI further.
I've got a VB app - actually it will be a SERVICE when I'm done - but it's a Winform at the moment for proof-of-concept and demo'ing.
And it's VB.Net...
It sits there waiting for a document (file - WORD or PDF or whatever) to get sent to it (via httplistener code I've created).
Once it receives the document it needs to search for keywords and patterns in the "text" of that document.
This is where VB.Net string manipulation tanked on me - and I started using calls to simple C++ functions that could loop through a STRING (of the whole document contents) and also loop through an array of "keywords and rules" to find out if we have MARKER's in the text for certain keywords.
Here's an example of one of these C++ functions
Code:
__declspec(dllexport) int firstKeyword(char *strSearch, char **keywords, int nKeywords, int *markers) {
int i = 0, j = 0, k = 0, a = 0;
int keywordlen = 0;
int lenSearch = strlen(strSearch);
for(k = 0; k < nKeywords; k++) // Step through the keywords array
{
//keywordlen = strlen(keywords[k]); // Length of the keyword
for(i = 1; i <= lenSearch - keywords[k][0]; i++) // Loop through each character of the search pool ("short of end" by keyword length)
{
a = 0;
for(j = 0; j < keywords[k][0]; j++) // Loop through each character of the keyword
{
if(keywords[k][j+1] != strSearch[i + j]) // Non-match
{
j = keywords[k][0]+1; // Set j "longer" than keyword length
}
}
if(j == keywords[k][0]) // If j "equals" keyword length we have a match
{
markers[k] = i; // Set the Marker to the "location" of the first character
}
}
}
return -1; // Return something
}
and it's called from VB like this
Code:
Dim sTerms As String() = m_dcxE.KeyTerms
Dim sIds As Integer() = m_dcxE.KeyIds
Dim kc As Integer = sTerms.Count
Dim iMarkers(kc - 1) As Integer
For i As Integer = 0 To kc - 1
iMarkers(i) = -1
Next
Dim allText As String = ParsePdfText(FSOb.NewFileName)
Dim x As Object = firstKeyword(allText, sTerms, kc, iMarkers) ' <<<< C++ function call here
Dim tf As Integer = 0
For i As Integer = 0 To kc - 1
If iMarkers(i) <> -1 Then
FSOb.FCTags = New FSObject.dcxT(sIds(i), sTerms(i).Substring(1), "")
tf += 1
End If
Next
Once the function returns the VB.Net code looks at the array of markers and sees which ones were found.
Long story short - I'm going to needs quite a few of these C++ functions and the info I need to pass from VB to C++ is getting more complex as I move past proof-of-concept phase here.
When I asked this question originally I was wondering if using C# would make the parameter passing mechanism that much easier than doing it with VB.
Remember SPEED is PARAMOUNT here - I can suffer with parameter setup. Bottom line is that I want that MARKER array filled in ms's and not seconds...