|
Yes you got it right. It is installing perfectly but not running. However problem is not in writing files or opening file. It is between Flash ActiveX and my wrapper function who actually calls it.
Here is the implementation of CallFunction()
inline _bstr_t IShockwaveFlash::CallFunction ( _bstr_t request )
{
BSTR _result = 0;
HRESULT _hr = raw_CallFunction(request, &result);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
return _bstr_t(_result, false);
}
It FAILs and then goes for _com_issue_errorex
If my parameter are wrong then it should not work even if it was installed inside English folder. Function Parameters does not have non English chars.
|
|
|
|
|
Find the value of _hr when the it has failed.
You can do 1 of the following:
1. Put a breakpoint on the line if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
2. Print a message with TRACE("%u", _hr); to the "Output" window in Visual Studio if you are using MFC or ATL
3. printf("%u", _hr); if it is a console app
4. Show it in a MessageBox
Let me know what the code is, or see this page on MSDN[^] if you would like to have a shot at decoding the error yourself.
|
|
|
|
|
I added a break point there to check HRESULT value. It was E_FAIL.
|
|
|
|
|
Well, that's a great deal of help. A generic error code.
Perhaps checking the value of query may help, see if it isn't sending anything strange
Other than that, the best I can do then is suggest running ProcMon[^] and filter by your application and Filesystem activity to see if there is any errors when accessing the directory.
Other than that check the documentation.
|
|
|
|
|
Andrew Brock wrote: You need to use the Unicode functions.
I am certain if you are using the Unicode functions, then it will work.
I don't think either of these statements is true. The use of Unicode or ANSI inside a program is not dependent on the character set or language of the platform. If this were the case then I suspect thousands of programs would not run.
I must get a clever new signature for 2011.
|
|
|
|
|
At that stage (until he modified the question) I thought the problem was something along the lines of opening a file that lived inside a folder with a non-english name, then the program crashing as a result of reading from a file that isn't open.
Windows is Unicode. Most functions (in the Win32 API) that have an ASCII version convert the ASCII string to Unicode then call the Unicode version of the function.
Having said that, how do you specify a directory name (in Russian) that only exists within extended character sets (such as Unicode) with only ASCII. You can't.
The OP has since modified the question and has better defined his problem and the location of it, which now makes my answer irrelevant.
|
|
|
|
|
No problem, I just thought you were going off on a bit of a tangent. What you say here is correct, and obviously you cannot specify extended character file names in ASCII.
I must get a clever new signature for 2011.
|
|
|
|
|
You need to capture more information in your catch block, or use the debugger to trap it and see what is going on in the CallFunction() method; perhaps the parameter is incorrect.
I must get a clever new signature for 2011.
|
|
|
|
|
I was unsure what type of error it was throwing so I used ... in catch block. Debugger is not able to help here. By debugging, I have checked for the expiry of the flash object but it was alive so no problem there. Even parameters are also right.
|
|
|
|
|
I think Andrew has made some useful suggestions above. You need to display the actual error code in your catch block; in your case you are just printing a rather unhelpful message.
I must get a clever new signature for 2011.
|
|
|
|
|
This CallFunction is inside flash9c.tli file. Whenever I write any helpful statement there and compiles the code then it automatically reverts back. I am not able to put any statement there. I think this file generates automatically at compile time.
|
|
|
|
|
I have no experience of Flash, so I am unable to make any further suggestions.
I must get a clever new signature for 2011.
|
|
|
|
|
Hi everyone! I had the following lines of C++ code in my program
CFileDialog dialog(true);
CString strFileName=L"";
INT_PTR nResult = dialog.DoModal();
if(nResult == IDOK)
strFileName=dialog.GetFolderPath();
The problem is: When I execute the program on a PC running Windows XP, there always have an ugly exception which I don't know why it happened. But everything's fine when I copied it to another PC running Windows 7.
I'm desperate. Would you guy please tell me why?
anhld
|
|
|
|
|
The hWnd=0x00000000 is probably due to clean-up code.
As for the exception, could you tell us what it is. What code and/or message.
If you go to Debug>Exceptions and tick everything, it should break the debugger the moment the exception is thrown, so you can see what is causing it.
Once you have found the source, reset the exceptions filter (there should be a Reset All button in the dialog) otherwise they will annoy the heck out of you
|
|
|
|
|
|
MSDN[^] says:
The dialog box must have been created with the OFN_EXPLORER style; otherwise, the method will fail with an assertion.
You need to create the dialog like
CFileDialog dialog(true, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_EXPLORER);
|
|
|
|
|
Sorry! It doesn't work.
anhld
|
|
|
|
|
Perhaps i should have read the next line on that page[^].
"You can call this method only while the dialog box is being displayed. After the dialog box has been closed, this function will no longer work, and the method will fail with an assertion."
Not sure why it works on Windows 7, but you can instead use
strFileName = dialog.GetPathName();
strFileName = strFileName.Left(strFileName.ReverseFind(_T('\\')) + 1);
That is just example code, and you should add error checking into it to ensure there is a '\' character
|
|
|
|
|
Yeah! You're right! I should read MSDN carefully before asking this question. Anyway, thank you so much!
anhld
|
|
|
|
|
Hello debug experts.
<b></b>I'll fess-up before I get flamed by someone here..
I did posted this in OpenCV group without success.
<b></b>This is basic dll debugging process I do not know how to do.
I need to debug , step thru, OpenCV function and I just cannot figure out the mechanics.
I put cv dll (dsp) as main project and then I added my application to the workspace.
I set a break point at the cv function entry in my application and then execute the cv dll.
However, I just cannot step into the cv dll function to check the code progress.
F11 goes right over the function.
What bugs me is that I can step thru other OpenCV code (Haar training) without a problem!
Can it be done and dhow ??
What am I missing??
Using VC6.0 , both - dll and my app - are configured for debug. No compiler or linker errors.
My app is linked to the debug library of the cv dll.
The application runs, sort of - bogus Haar objects are being detected.
Thanks for you help, it is as always appreciated.
Cheers Vaclav
|
|
|
|
|
Try rebuilding the complete project (application and DLL) in Debug mode and see if that works.
I must get a clever new signature for 2011.
|
|
|
|
|
Richard,
found out that the function I am after is not in cv but in cvaux.
Added all relevant libraries and dependencies, rebuild all with success.
Still no go.
The question is - do I need to link the correct debug libraries?
Right now I have a mix of release and debug.
I'll do that next anyway.
What about the preprocessor's NDEBUG #define?
The functions I can step thru are in debug libaries and have the NDEBUG defined.
Thanks
Vaclav
|
|
|
|
|
Richard,
noticed difference between project settings - the one which works has a "Link" tab option and the one which does not work - cvaux has a tab "library". No Link.
They both have _DEBUG in various places , no more NDEBUG.
Vaclav
PS Here are the library links. Both are set for debug option and cvhaartraining lets me step thru and the cvaux (both cvaux or cvaud) won't do it.
#pragma comment(lib,"G:\\Program Files\\OpenCV\\lib\\cvhaartraining")
#pragma comment(lib,"G:\\Program Files\\OpenCV\\lib\\cvauxd")
Thanks for helping me. I am stuck!
|
|
|
|
|
I can only assume that the cvauxd library should be a Debug build. You need to recheck all the project settings (Compiler and Library tabs) to ensure that they are creating all the Debug information required.
I must get a clever new signature for 2011.
|
|
|
|
|
Yes, OpenCV designates debug libraies wiht suffix "d". Clever but I had to ask!
I think I need to check if these libraries are the ones I am actually linking to.
Right now I chaged to cxcored and getting this error which I totally do not know how to troubleshoot.
HEAP[Open....exe]: Invalid Address specified to RtlValidateHeap( 1e20000, b570450 )
What is realy strange this "cvhaartraining" dll compiles and builds a library without telleing me if it is debug or release.
I bet I am missing where it should go, but it works!
....
--------------------Configuration: cvhaartraining - Win32 Debug--------------------
Compiling...
cvboost.cpp
cvcommon.cpp
cvhaarclassifier.cpp
cvhaartraining.cpp
OpenMP not defined
cvsamples.cpp
Creating library...
--------------------Configuration: cv - Win32 Debug--------------------
.....
And that is the dll I can step thru!!!
And this is "normal" output
Generating Code...
Linking...
Creating library ../../lib/cvd.lib and object ../../lib/cvd.exp
I guess I'll go over all the options again!
Thanks for your input.
|
|
|
|