Skip to main content
Topic: msvc++ 6 or msvc++ .net? (Read 4951 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

msvc++ 6 or msvc++ .net?

hi there.

i use foobar for quite a while. as disgusting as this may sound to some of you, i like eye candy      now that foobar v0.7 beta includes a simple visualization plugin i am inspired to create one myself.  i downloaded the latest foobar beta and the sdk. before i jump into the code, i would like to know what version of microsoft visual c++ do plugin developers use? is the foobar sdk a msvc6-project or was it created using visual c++ .net? is there a faq/manual for creating foobar plugins or does one have to figure out everything on his own? the sdk's readme doesn't contain a lot of information...

greetings,

pcween

msvc++ 6 or msvc++ .net?

Reply #1
Standard foobar2000 binaries are compiled with MSVC6, and included project files are made with it too.
MSVC.NET has been reported to work correctly though, I know that some of component developers successfully use it.
You can figure most of things by looking at included sourcecode (most of standard components have been made opensource for that purpose), and most of API functions are documented in appropiate header files.

msvc++ 6 or msvc++ .net?

Reply #2
VC++.NET will automagically convert the VC++6 project files into the newer format, so either will work fine.

msvc++ 6 or msvc++ .net?

Reply #3
i successfully compiled foobar2000_SDK.dsp and pfc.dsp using msvc7. converting the workspace from msvc6 to msvc7 obviously works like a charm.

i'd like to have a tutorial for a "hello world"-foobar-plugin 

what i already did:

1. create a new mfc-dll (called foo_pcwvis)
2. add existing project to workspace -> \sdk\foobar2000\sdk\foobar2000_sdk.dsp
3. add existing project to workspace -> \sdk\pfc\pfc.dsp
4. add existing element to workspace (or plugin-project?) -> \sdk\foobar2000\component_client\component_client.cpp
5. setting project dependencies for plugin-project (= rightclick on foo_pcwvis, select project dependencies and check foobar2000_SDK and pfc)

to (4): do i add component_client to the workspace or to my plugin-project (foo_pcwvis)? it only compiles without errors when adding it to the workspace, just like foobar2000_SDK and pfc.

what do i need, so that foobar recognizes my dll as a foobar-dll?

pcween

msvc++ 6 or msvc++ .net?

Reply #4
Component_client is the DLL glue part - somehow I didn't manage to make it export DLL symbols when linked as a .lib so you have to manually insert it to your project, like all included projects do.
Nice to see that you are using dependencies, a lot of people set their workspace up in the messy way and include all sdk/pfc cpp files in their project.

msvc++ 6 or msvc++ .net?

Reply #5
i finally managed to compile a "foobar-loadable" dll.

here's what i did step by step:
01. extract SDK_0.7b21.zip to c:\sdk
02. start ms visual studio .net
03. new project -> mfc-dll (name: foo_pcwvis) in c:\sdk\foobar2000\foo_pcwvis
04. delete all the unnecessary files (i.e. all files except foo_pcwvis.cpp)
05. delete all code from foo_pcwvis.cpp
06. rightclick on foo_pcwvis, add existing element "component_client.cpp"
07. rightclick on workspace, add existing project "foobar2000_SDK.dsp"
08. rightclick on workspace, add existing project "pfc.dsp"
09. rightclick on foo_pcwvis, project dependencies
10. check foobar2000_SDK and pfc
11. comment out the following lines from pfc/string.h:
Code: [Select]
#ifndef WCHAR
typedef unsigned short WCHAR;
#endif

12. disable precompiled header for foo_pcwvis-project
13. use configuration manager to change build-options to "release ansi"

you're ready to go. the result is a ~6kb dll-file that does nothing. maybe this helps someone anyway.

pcween

msvc++ 6 or msvc++ .net?

Reply #6
You shouldn't need "Release ANSI" stuff in 0.7 anymore if you use utf8api.dll properly.

msvc++ 6 or msvc++ .net?

Reply #7
to see that my useless dll actually works, paste the following code in the (empty) foo_pcwvis.cpp:

Code: [Select]
#include "../SDK/componentversion.h"

DECLARE_COMPONENT_VERSION("pcwvis","0.1","copyright (c)2003,\npcween");


a doubleclick on "pcwvis 0.1" in the component window now displays the copyright-string 

msvc++ 6 or msvc++ .net?

Reply #8
i need some help.
i copied the contents from vis_test.cpp in foo_pcwvis.cpp and tried to compile it, but i always get the following linker errors:
Quote
foo_pcwvis error LNK2019: Nicht aufgeloestes externes Symbol __imp__uCreateWindowEx, verwiesen in Funktion "public: virtual void __thiscall visualization_test::on_data(struct vis_chunk const *)" (?on_data@visualization_test@@UAEXPBUvis_chunk@@@Z)
foo_pcwvis error LNK2019: Nicht aufgeloestes externes Symbol __imp__uDefWindowProc, verwiesen in Funktion "long __stdcall g_windowproc(struct HWND__ *,unsigned int,unsigned int,long)" (?g_windowproc@@YGJPAUHWND__@@IIJ@Z)
foo_pcwvis error LNK2019: Nicht aufgeloestes externes Symbol __imp__uLoadCursor, verwiesen in Funktion "public: virtual void __thiscall visualization_test::on_data(struct vis_chunk const *)" (?on_data@visualization_test@@UAEXPBUvis_chunk@@@Z)
foo_pcwvis error LNK2019: Nicht aufgeloestes externes Symbol __imp__uRegisterClass, verwiesen in Funktion "public: virtual void __thiscall visualization_test::on_data(struct vis_chunk const *)" (?on_data@visualization_test@@UAEXPBUvis_chunk@@@Z)

that's very strange, because i did include the needed lib's (user32.lib and gdi32.lib). here is my linker command line:
Quote
/OUT:"Release/foo_pcwvis.dll" /INCREMENTAL:NO /NOLOGO /DLL /DEF:".\foo_pcwvis.def" /SUBSYSTEM:WINDOWS /MACHINE:IX86 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \sdk\foobar2000\SDK\Release\foobar2000_SDK.lib \sdk\pfc\Release_unicode\pfc.lib

any ideas?

msvc++ 6 or msvc++ .net?

Reply #9
Add utf8api to dependencies.

msvc++ 6 or msvc++ .net?

Reply #10
The project dependency structure is outlined in the included Foobar2000.dsw workspace.

(Your project) -> Foobar2000_SDK

Foobar2000_SDK -> PFC
Foobar2000_SDK -> utf8api


This way, you only need to check one dependency for each project you add to your workspace.

msvc++ 6 or msvc++ .net?

Reply #11
this (adding utf8api) does not solve the problem...

msvc++ 6 or msvc++ .net?

Reply #12
... nor does changing the project dependency structure as outlined in foobar2000.dsw. still the same linker errors.  :alien:  :alien:

msvc++ 6 or msvc++ .net?

Reply #13
Are you possibly trying to link debug object files with non-debug object files?

msvc++ 6 or msvc++ .net?

Reply #14
Thanks kode and peter, you just solved a compile problem that I was having.

msvc++ 6 or msvc++ .net?

Reply #15
Sounds like you are not linking against utf8api correctly.

msvc++ 6 or msvc++ .net?

Reply #16
Quote
VC++.NET will automagically convert the VC++6 project files into the newer format, so either will work fine.

Yeah, right. I'm using VC7 for my component too. The only problem is the need for the updated C-runtime DLL. I've linked my component DLL staticly to it because I won't provide the updated C-runtime DLL and foobar2k is still based on VC6. It would be *very* helpful if Peter would compile it against the current DLLs and not against the outdated VC6 DLLs.

msvc++ 6 or msvc++ .net?

Reply #17
Quote
Quote
VC++.NET will automagically convert the VC++6 project files into the newer format, so either will work fine.

Yeah, right. I'm using VC7 for my component too. The only problem is the need for the updated C-runtime DLL. I've linked my component DLL staticly to it because I won't provide the updated C-runtime DLL and foobar2k is still based on VC6. It would be *very* helpful if Peter would compile it against the current DLLs and not against the outdated VC6 DLLs.

Foobar2000 requiring additional msvc7 dlls to run, just what we need.

msvc++ 6 or msvc++ .net?

Reply #18
Quote
Foobar2000 requiring additional msvc7 dlls to run, just what we need.

But the VC7 DLLs won't be installed with the FB2k installer ?

msvc++ 6 or msvc++ .net?

Reply #19
Three cheers for unnecessary bloat!

msvc++ 6 or msvc++ .net?

Reply #20
i fail to compile test_vis.cpp using msvs7:

1. extract SDK_0.7b21.zip in c:\sdk
2. doubleclick on c:\sdk\foobar2000\foo_vis_test\foo_vis_test.dsp
3. convert project to vc7.0
4. add existing projects to workspace: foobar2000_SDK, utf8api and pfc
5. changing dependencies
        foo_vis_test -> foobar2000_SDK
        foobar2000_SDK -> pfc
        foobar2000_SDK -> utf8api

when i try to compile now, i get the following error messages:

Quote
error LNK2019: Nicht aufgeloestes externes Symbol "unsigned int __cdecl convert_utf8_to_ansi(char const *,char *,unsigned int)" (?convert_utf8_to_ansi@@YAIPBDPADI@Z), verwiesen in Funktion "public: __thiscall string_ansi_from_utf8::string_ansi_from_utf8(char const *,unsigned int)" (??0string_ansi_from_utf8@@QAE@PBDI@Z)
text_drawing.obj : error LNK2001: Nichtaufgeloestes externes Symbol "unsigned int __cdecl convert_utf8_to_ansi(char const *,char *,unsigned int)" (?convert_utf8_to_ansi@@YAIPBDPADI@Z)
utf8api.obj : error LNK2001: Nichtaufgeloestes externes Symbol "unsigned int __cdecl convert_utf8_to_ansi(char const *,char *,unsigned int)" (?convert_utf8_to_ansi@@YAIPBDPADI@Z)
utf8api.obj : error LNK2019: Nicht aufgeloestes externes Symbol "unsigned int __cdecl utf16_encode_char(unsigned int,unsigned short *)" (?utf16_encode_char@@YAIIPAG@Z), verwiesen in Funktion _uStringCompare
utf8api.obj : error LNK2019: Nicht aufgeloestes externes Symbol "unsigned int __cdecl utf8_decode_char(char const *,unsigned int *)" (?utf8_decode_char@@YAIPBDPAI@Z), verwiesen in Funktion _uStringCompare
utf8api.obj : error LNK2019: Nicht aufgeloestes externes Symbol "unsigned int __cdecl utf8_char_len(char const *)" (?utf8_char_len@@YAIPBD@Z), verwiesen in Funktion _uCharLength
utf8api.obj : error LNK2019: Nicht aufgeloestes externes Symbol "public: void __thiscall string_base::add_string_ansi(char const *,unsigned int)" (?add_string_ansi@string_base@@QAEXPBDI@Z), verwiesen in Funktion "public: void __thiscall string_base::set_string_ansi(char const *,unsigned int)" (?set_string_ansi@string_base@@QAEXPBDI@Z)
utf8api.obj : error LNK2019: Nicht aufgeloestes externes Symbol "public: void __thiscall string_base::add_char(unsigned int)" (?add_char@string_base@@QAEXI@Z), verwiesen in Funktion _uGetOpenFileNameMulti
utf8api.obj : error LNK2019: Nicht aufgeloestes externes Symbol "unsigned int __cdecl convert_ansi_to_utf8(char const *,char *,unsigned int)" (?convert_ansi_to_utf8@@YAIPBDPADI@Z), verwiesen in Funktion "public: __thiscall string_utf8_from_ansi::string_utf8_from_ansi(char const *,unsigned int)" (??0string_utf8_from_ansi@@QAE@PBDI@Z)
utf8api.obj : error LNK2019: Nicht aufgeloestes externes Symbol "public: void * __thiscall mem_block::set_size(unsigned int)" (?set_size@mem_block@@QAEPAXI@Z), verwiesen in Funktion "public: char * __thiscall mem_block_t<char>::set_size(unsigned int)" (?set_size@?$mem_block_t@D@@QAEPADI@Z)
utf8api.obj : error LNK2019

when i change the configuration type for utf8api from DLL to LIB, utf8api compiles successfully, but i get the 4 annoying errors from before:
Quote
foo_vis_test error LNK2019: Nicht aufgeloestes externes Symbol __imp__uCreateWindowEx, verwiesen in Funktion "public: virtual void __thiscall visualization_test::on_data(struct vis_chunk const *)" (?on_data@visualization_test@@UAEXPBUvis_chunk@@@Z)
foo_vis_test error LNK2019: Nicht aufgeloestes externes Symbol __imp__uDefWindowProc, verwiesen in Funktion "long __stdcall g_windowproc(struct HWND__ *,unsigned int,unsigned int,long)" (?g_windowproc@@YGJPAUHWND__@@IIJ@Z)
foo_vis_test error LNK2019: Nicht aufgeloestes externes Symbol __imp__uLoadCursor, verwiesen in Funktion "public: virtual void __thiscall visualization_test::on_data(struct vis_chunk const *)" (?on_data@visualization_test@@UAEXPBUvis_chunk@@@Z)
foo_vis_test error LNK2019: Nicht aufgeloestes externes Symbol __imp__uRegisterClass, verwiesen in Funktion "public: virtual void __thiscall visualization_test::on_data(struct vis_chunk const *)" (?on_data@visualization_test@@UAEXPBUvis_chunk@@@Z)

any ideas?

msvc++ 6 or msvc++ .net?

Reply #21
utf8api depends on pfc.

msvc++ 6 or msvc++ .net?

Reply #22
@zZzZzZz: thanks. that was the missing information. now it works.    you guys should write a small beginners faq ...

msvc++ 6 or msvc++ .net?

Reply #23
.DSW workspace included with SDK should have all that stuff set up properly.

 
SimplePortal 1.0.0 RC1 © 2008-2019