I've got this code - and I cannot seem to get it to work...
and my keywords array looks like thisCode:__declspec(dllexport) int firstKeyRegions(char *strSearch, char **keywords, int nKeywords, int *smarkers, int *emarkers) { int i = 0, j = 0, k = 0, a = 0; int keywordlen = 0; int lenSearch = strlen(strSearch); bool gotSpace = false; //, inMatch = false, gotMatch = false, doNext = true; int wordcnt = 0; int headers = 0, headerse = 0; int titles = 0, titlee = 0; for(i = 0; i < lenSearch; i++) // Step through the whole text { j = strSearch[i]; gotSpace = (j == 32); if(gotSpace) { wordcnt += 1; } } //string kw; for(k = 0; k < nKeywords; k++) // Step through the keywords array { if (keywords[k] == "wordcnt") { smarkers[k] = wordcnt; } //{ // switch("xxx") // { // case 'wordcnt': // smarkers[k] = wordcnt; // break; // case 'header': // if (headers != 0) // { // smarkers[k] = headers; // emarkers[k] = hearere; // } // break; // case 'title': // if (titles != 0) // { // smarkers[k] = titles; // emarkers[k] = titlee; // } // break; // } } return -1; // Return something }
How do I work with this in C++???Code:?keywords[0] 0x0668e620 "wordcnt" ?keywords[1] 0x066849e8 "header" ?keywords[2] 0x0668e698 "title"
This is called from VB like this
Code:Dim rKeyTerms As String() = {"wordcnt", "header", "title"} Dim kcValue As Integer = rKeyTerms.Count Dim rKeyStart(kcValue - 1) As Integer Dim rKeyEnd(kcValue - 1) As Integer For i As Integer = 0 To kcValue - 1 rKeyStart(i) = -1 rKeyEnd(i) = -1 Next Dim x As Object = firstKeyRegions(allText, rKeyTerms, kcValue, rKeyStart, rKeyEnd)


Reply With Quote