Namazu-users-en(old)


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Access Violation on nmz_get_field_data



Hello.

I have installed namazu (the Win32 binary distribution version 2.0.10) and setup properly. Documents have been indexed, and I can search and get results using the namazu commandline program.

My intention is to write some C++ code using namazu, and I have been partially successful. I created a simple Visual C++ application for testing, which does the following when a button is pressed:

	nmz_add_index("C:\\namazu\\index");

	NmzResult result = nmz_search("Some query");

	for (int i = 0; i < result.num; i++)
	{
		nmz_data current_hit = result.data[i];
		char title[512] = "";
		nmz_get_field_data(current_hit.idxid, current_hit.docid, "title", title);
	}

... and it works, sometimes. When I click the button the first time, I can search sucessfully and retrieve the title of the documents for all results. When I clicked the button for a second time, the nmz_search call succeeded, and I received a good NmzResult (correct num). However, when the first call to nmz_get_field_data is made, some memory corruption occurrs: a bunch of variables (including the this pointer) are set to 0, which leads to an eventual crash.

I tried adding the nmz_free_hlist(result) and nmz_free_idxnames() calls at the end of the function, but the behaviour is still the same.

Any help would be greatly appreciated. I am running Windows 2000 with Visual C++ 6.0 SP5.

	-Carlos