Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Run, Want Project to Live On #1

Open
Gabby-Paolucci opened this issue Oct 26, 2016 · 4 comments
Open

Can't Run, Want Project to Live On #1

Gabby-Paolucci opened this issue Oct 26, 2016 · 4 comments

Comments

@Gabby-Paolucci
Copy link

Gabby-Paolucci commented Oct 26, 2016

The original CDex project has been taken over and hijacked to include adware in the installer, and the SourceForge project no longer exists (see CDex - Wikipedia). You have the only source code I can find online for CDex. I'm hoping to revive the clean CDex.

The problem is, I can't run the Visual Studio project in your repository. I'm getting the error:

Unhandled exception at 0x00FF9AF3 in CDex.exe: An invalid parameter was passed to a function that considers invalid parameters fatal.

At invarg.c Line 132:
`` __fastfail(FAST_FAIL_INVALID_ARG);

I'm familiar with C# but not C++, and I'm not sure what I can do to resolve this issue. Any help you could give would be greatly appreciated.

@wech71
Copy link
Collaborator

wech71 commented Oct 27, 2016

Could you provide the complete call stack? This method is just a helper function which is being called when an invalid argument was passed to a function (probably a null pointer)

Update: I just downloaded, and compiled it and it works for me.

@Gabby-Paolucci
Copy link
Author

Sorry, should have included that. Here's the full Call Stack:

CDex.exe!invoke_watson(const wchar_t * pszExpression, const wchar_t * pszFunction, const wchar_t * pszFile, unsigned int nLine, unsigned int pReserved) Line 132 C++
CDex.exe!invalid_parameter(const wchar_t * pszExpression, const wchar_t * pszFunction, const wchar_t * pszFile, unsigned int nLine, unsigned int pReserved) Line 86 C++
CDex.exe!fputws(const wchar_t * string, iobuf * stream) Line 48 C
CDex.exe!CStdioFile::WriteString(const wchar_t * lpsz) Line 239 C++
CDex.exe!CLanguage::ReportChangedID(int nID, const CUString & strResource, const CUString & strEnglish, int nType) Line 154 C++
CDex.exe!CLanguage::GetString(const unsigned long nID) Line 265 C++
CDex.exe!CLanguage::ParseLanguageFile(const CUString & strFileName) Line 458 C++
CDex.exe!CLanguage::SetLanguage(const CUString & strLanguage) Line 586 C++
CDex.exe!CLanguage::Init(const CUString & strLanguageDir, const CUString & strLanguage) Line 561 C++
CDex.exe!CCDexApp::InitInstance() Line 380 C++
CDex.exe!AfxWinMain(HINSTANCE
* hInstance, HINSTANCE
_ * hPrevInstance, wchar_t * lpCmdLine, int nCmdShow) Line 37 C++
CDex.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpCmdLine, int nCmdShow) Line 26 C++

Looks like the CDex code that is causing the problem is line 380 in CDex.cpp:
g_language.Init( g_config.GetAppPath(), g_config.GetLanguage() );

And the problem is with the call to g_config.GetLanguage().

@Gabby-Paolucci
Copy link
Author

Gabby-Paolucci commented Oct 27, 2016

I found the issue. Line 139-140 in Language.cpp is trying to create a file in C:\temp, which the application doesn't have rights to do:

if ( cFile.Open(    _T( "c:\\temp\\missing.txt" ),
                            CFile::modeReadWrite | CFile::modeNoTruncate | CFile::modeCreate ) )

Changing this to a directory the application has access to resolves the issue. Any idea how to get this to use a temporary path based on the Windows environment? I'm trying but am having trouble getting it with the CStdioFile.Open.

wech71 pushed a commit to wech71/CDex that referenced this issue Oct 28, 2016
…le c:\temp\missing.txt and crashed if c:\temp did not exist. Moved location to %temp%-Directory and changed g_nReportMissing to FALSE to disabled writing missing.txt at all.
@Gabby-Paolucci
Copy link
Author

Thanks for fixing this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants