BSTR thru COM does not seem to be passed.....
-
Hi everybody, I've got a strange thing using my DCOM application(s). I wrote both server and client, and one of the last issues I can't resolve is the following: On the server machine (EXE Server with MFC) I have the following class method (with implementation):
STDMETHODIMP CAugVisionEngine::ReadText(BSTR CharSetName, int pTop, int pLeft, int pHeight, int pWidth, BSTR *OcrString) { AFX_MANAGE_STATE(AfxGetStaticModuleState()) ...
[code omitted here for brevity] ...char* strTemp = (char*) malloc(sizeof(OcrReport_tmp->readString)+1); strcpy(strTemp, OcrReport_tmp->readString); *OcrString = W2BSTR(A2W(strTemp)); return S_OK; }
where the last parameter, the BSTR, is the return value of the function (just [out], not [out, retval]) When I call the function from the client (for now MFC application, just to test, but the release will be a console application), in a way like this:BSTR OCRBSTR; pIVE->ReadText ("C:\\Patterns\\3260\\05042800\\1235.abc",40, 249, 48, 83, &OCRBSTR);
I get that the server constructs the BSTR correctly (at least, it seems to do it, since a logfile is populated correctly), but my client retrieves nothing... I'm stuck... Any ideas? Thanks in advance, Morenz. -
Hi everybody, I've got a strange thing using my DCOM application(s). I wrote both server and client, and one of the last issues I can't resolve is the following: On the server machine (EXE Server with MFC) I have the following class method (with implementation):
STDMETHODIMP CAugVisionEngine::ReadText(BSTR CharSetName, int pTop, int pLeft, int pHeight, int pWidth, BSTR *OcrString) { AFX_MANAGE_STATE(AfxGetStaticModuleState()) ...
[code omitted here for brevity] ...char* strTemp = (char*) malloc(sizeof(OcrReport_tmp->readString)+1); strcpy(strTemp, OcrReport_tmp->readString); *OcrString = W2BSTR(A2W(strTemp)); return S_OK; }
where the last parameter, the BSTR, is the return value of the function (just [out], not [out, retval]) When I call the function from the client (for now MFC application, just to test, but the release will be a console application), in a way like this:BSTR OCRBSTR; pIVE->ReadText ("C:\\Patterns\\3260\\05042800\\1235.abc",40, 249, 48, 83, &OCRBSTR);
I get that the server constructs the BSTR correctly (at least, it seems to do it, since a logfile is populated correctly), but my client retrieves nothing... I'm stuck... Any ideas? Thanks in advance, Morenz.your code doesn't seem to have problem.
morenz wrote:
*OcrString = W2BSTR(A2W(strTemp));
As you said, this value you are writing in log file, isn't it? -- modified at 4:56 Tuesday 14th November, 2006
Prasad Notifier using ATL | Operator new[],delete[][^]
-
your code doesn't seem to have problem.
morenz wrote:
*OcrString = W2BSTR(A2W(strTemp));
As you said, this value you are writing in log file, isn't it? -- modified at 4:56 Tuesday 14th November, 2006
Prasad Notifier using ATL | Operator new[],delete[][^]