Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Fixing crashes in foo_uie_wsh_panel (Read 11126 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Fixing crashes in foo_uie_wsh_panel

I think WSH Panel is an attempt at this, it's just a shame it's buggy and there doesn't seem to be any ongoing development. So I think it's possible, who knows maybe someone will make a similar/ less buggy version of WSH Panel. Javascript isn't too difficult to learn either.

 

Fixing crashes in foo_uie_wsh_panel

Reply #1
I think WSH Panel is an attempt at this, it's just a shame it's buggy and there doesn't seem to be any ongoing development. So I think it's possible, who knows maybe someone will make a similar/ less buggy version of WSH Panel. Javascript isn't too difficult to learn either.

The source is available. It would be great if a programmer took a look at this and it's possibilities. Also it really needs documentation.
Can't wait for a HD-AAC encoder :P

Fixing crashes in foo_uie_wsh_panel

Reply #2
The source is available. It would be great if a programmer took a look at this and it's possibilities. Also it really needs documentation.


Do you have a link? I mean I've tried looking at some C++ before and basically didn't understand any of it, but I'd love to have a go...


Fixing crashes in foo_uie_wsh_panel

Reply #4
Excellent, thanks, I think I'll have a go at building a tweaked version soon. I don't know what's causing all the crashes yet though so it will (hopefully only!) be as buggy as the current version...

One reason for the crashes is that it is built with the compiler option /arch:SSE2, so that it will not work with CPUs that don't support SSE2 like 32bit-Athlons. I rebuilt it for my own without that optimization and couldn't see any differences in performance. But I tried not very hard.

You should also consider one thing: Although the component is published including source code, you need a license or the ok of the original author to publish modified versions of the component.

Fixing crashes in foo_uie_wsh_panel

Reply #5
OK thanks. I'll bear that in mind. I'm having enough trouble just building it though, nevermind going about fixing it for everyone!

Fixing crashes in foo_uie_wsh_panel

Reply #6
man, I would hope that someone could get this component working well, it has so much potential, and the fact that its not stable is keeping a lot of cool development work away from it.

Fixing crashes in foo_uie_wsh_panel

Reply #7
Oh crap, the pressure's on now!

One potentially large problem, while trying to build it, some file or other is asking for a file called atlbase.h, which I don't have, because apparently there's no ATL support for Visual Studio Express Editions, so I'd need the Standard Edition, which I can't afford... I'm downloading a trial version though, maybe that will help...

Fixing crashes in foo_uie_wsh_panel

Reply #8
Oh crap, the pressure's on now!

One potentially large problem, while trying to build it, some file or other is asking for a file called atlbase.h, which I don't have, because apparently there's no ATL support for Visual Studio Express Editions, so I'd need the Standard Edition, which I can't afford... I'm downloading a trial version though, maybe that will help...

No, you don't need the Standard Editition. But you have to install the Windows Server 2003 Platform SDK and you have to do some fixes explained here.

Fixing crashes in foo_uie_wsh_panel

Reply #9
Awesome, thanks, I got the SDK compiling OK with the express edition. I'm still getting errors with the wsh panel code though:

Code: [Select]
Compiling...
main.cpp
.\main.cpp(760) : error C2065: 'IActiveScriptParsePtr' : undeclared identifier
.\main.cpp(760) : error C2146: syntax error : missing ';' before identifier 'parser'
.\main.cpp(760) : error C2065: 'parser' : undeclared identifier
.\main.cpp(766) : error C2065: 'parser' : undeclared identifier
.\main.cpp(769) : error C2065: 'parser' : undeclared identifier
.\main.cpp(769) : error C2227: left of '->InitNew' must point to class/struct/union/generic type
        type is ''unknown-type''
.\main.cpp(773) : error C2065: 'parser' : undeclared identifier
.\main.cpp(773) : error C2227: left of '->ParseScriptText' must point to class/struct/union/generic type
        type is ''unknown-type''


Any idea what's gone wrong? I assume it's just something to do with 'IActiveScriptParsePtr', if that line worked maybe the others would too. I found an entry on msdn for the error: http://msdn.microsoft.com/en-us/library/ewcf0002(VS.80).aspx, and I would guess my problem is no. 2: "You may be calling a function in an SDK header file that is currently not supported in your build environment", so the question is, how do I fix my build environment...? I just did some more googling and IActiveScriptParse is mentioned on msdn, but IActiveScriptParsePtr isn't... maybe I should try it without the Ptr on the end. Don't know if that's a good idea though...

Any help much appreciated!

For reference the problematic bit of code is this:

Code: [Select]
    HRESULT _script_init(){
        HRESULT hr = script_term();
        IActiveScriptParsePtr parser;
        IActiveScriptSitePtr  site;
        pfc::stringcvt::string_wide_from_utf8  u_name, u_code;
        u_name.convert(m_script_name, m_script_name.length());
        u_code.convert(m_script_code, m_script_code.length());
        if(SUCCEEDED(hr)) hr = m_engine.CreateInstance( (OLECHAR*)(const wchar_t*) u_name );
        if(SUCCEEDED(hr)) hr = m_engine->QueryInterface(&parser);
        if(SUCCEEDED(hr)) site.Attach(new ScriptSite(this), true);
        if(SUCCEEDED(hr)) hr = m_engine->SetScriptSite(site);
        if(SUCCEEDED(hr)) hr = parser->InitNew();
        if(SUCCEEDED(hr)) hr = m_engine->AddNamedItem(L"window", SCRIPTITEM_ISVISIBLE | SCRIPTITEM_ISSOURCE);
        if(SUCCEEDED(hr)) hr = m_engine->AddNamedItem(L"gdi", SCRIPTITEM_ISVISIBLE | SCRIPTITEM_ISSOURCE);
        if(SUCCEEDED(hr)) hr = m_engine->AddNamedItem(L"fb", SCRIPTITEM_ISVISIBLE | SCRIPTITEM_ISSOURCE);
        if(SUCCEEDED(hr)) hr = parser->ParseScriptText( (OLECHAR*)(const wchar_t*) u_code, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL);
        if(SUCCEEDED(hr)) hr = m_engine->SetScriptState(SCRIPTSTATE_CONNECTED);
        if(SUCCEEDED(hr)) hr = m_engine->GetScriptDispatch(NULL, &m_script_root);
        return hr;
    }

Fixing crashes in foo_uie_wsh_panel

Reply #10
My guess would be, I don't know, that you need to declare your identifier.

Fixing crashes in foo_uie_wsh_panel

Reply #11
Code: [Select]
typedef _com_ptr_t<_com_IIID<IActiveScriptParse, &__uuidof(IActiveScriptParse)> > IActiveScriptParsePtr;

It's a COM smart pointer typedef or IActiveScriptParse

Fixing crashes in foo_uie_wsh_panel

Reply #12
One reason for the crashes is that it is built with the compiler option /arch:SSE2, so that it will not work with CPUs that don't support SSE2 like 32bit-Athlons.


Okay now I know why it wouldn't work. 

Fixing crashes in foo_uie_wsh_panel

Reply #13
Thank for the code T.P. Wang. I've put it in my code and it seems to have got past that part OK, but there is another error coming up.

One thing though, this is just the source code of the wsh panel, I'm not even trying to build my own version yet, so why on earth is the exact same code that the original dev used not working for me - why do I have to add the line T.P. Wang provided - when it clearly worked for him? This is very frustrating...

Anyway my new error is this:

Code: [Select]
Linking...
   Creating library C:\Program Files\Release\foo_uie_wsh_panel.lib and object C:\Program Files\Release\foo_uie_wsh_panel.exp
foobar2000_sdk.lib(metadb_handle_list.obj) : error LNK2001: unresolved external symbol __imp__StrCmpLogicalW@8
C:\Program Files\Release\foo_uie_wsh_panel.dll : fatal error LNK1120: 1 unresolved externals


Now I don't really want to just rely on this forum for help, but I don't even know where to begin with this one. I will take a guess that, I don't know, one of my externals is not resolved, but where do I go to fix that? It doesn't give me a line of code, and surely I don't want to go editing the SDK???

I'm looking round for anything that might help, on thing is the line: #pragma comment(lib, "foobar2000_SDK.lib") near the top of main.cpp. Maybe it's not pointing to the right place. Or maybe there's something wrong with foobar2000_sdk.lib. It does return some warnings when building. Other than that, I have no ideas...

Sorry to be such a noob at this, I know I'm way out of my depth...

Fixing crashes in foo_uie_wsh_panel

Reply #14
@TomBarlow:
Either link with shlwapi.lib or remove foobar2000_sdk_helpers header in the source file.

Fixing crashes in foo_uie_wsh_panel

Reply #15
Thank you so much, it worked! Oh I'm so happy now. Hopefully I can get to modifying it in the way I want.

Not sure if I should become the new developer of this component, I don't have the experience. Now that I can build it though I'll see how it goes...

Thanks again.

Fixing crashes in foo_uie_wsh_panel

Reply #16
Thank you so much, it worked! Oh I'm so happy now. Hopefully I can get to modifying it in the way I want.

Not sure if I should become the new developer of this component, I don't have the experience. Now that I can build it though I'll see how it goes...

Thanks again.


well, you have been doing more work on this component than anyone else recently..  Just getting it stable would be a wonderful step.