Old 16th November 2005, 07:42   #1
mydiz
Junior Member
 
Join Date: Nov 2005
Location: Turkey
Posts: 21
Send a message via ICQ to mydiz Send a message via Yahoo to mydiz
Devc++ to Visual c++ codes not working ??

// Clear TAG
cleartag()
{
#define MSNMusicString L"\\0Music\\0%d\\0%s\\0%s\\0%s\\0%s\\0%s\\0"
#define MSNFormat L"{0} - {1}"
HWND msnui = NULL;
COPYDATASTRUCT msndata;
CHAR buffer[500];
wsprintfW(buffer, MSNMusicString,0, L"", L"", L"", L"", L"");
msndata.dwData = 0x547;
msndata.lpData = &buffer;
msndata.cbData = (lstrlenW(buffer)*2)+2;
while (msnui = FindWindowEx(NULL, msnui, "MsnMsgrUIManager", NULL))
{
SendMessage(msnui, WM_COPYDATA, (WPARAM)NULL, (LPARAM)&msndata);
}
}

this code is successfully compiled in devc++ but i couldt compile it with visual c++, does any one knows why? it gives tons off error first error given in HWND line
mydiz is offline   Reply With Quote
Old 16th November 2005, 18:18   #2
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
Are you sure this is correct:
PHP Code:
msnui FindWindowEx(NULLmsnui"MsnMsgrUIManager"NULL


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 16th November 2005, 18:20   #3
DrO
 
Join Date: Sep 2003
Posts: 27,873
and those errors would be...? without knowing the error you can't really expect an answer since that code looks ok from what i can tell. did you make sure you included all relevant header files, etc

-daz
DrO is offline   Reply With Quote
Old 16th November 2005, 18:58   #4
mydiz
Junior Member
 
Join Date: Nov 2005
Location: Turkey
Posts: 21
Send a message via ICQ to mydiz Send a message via Yahoo to mydiz
--------------------Configuration: myim - Win32 Debug--------------------
Compiling resources...
Compiling...
myim.c
c:\program files\microsoft visual studio\myprojects\myim\myim.c(34) : error C2275: 'HWND' : illegal use of this type as an expression
c:\program files\microsoft visual studio\vc98\include\windef.h(195) : see declaration of 'HWND'
c:\program files\microsoft visual studio\myprojects\myim\myim.c(34) : error C2146: syntax error : missing ';' before identifier 'msnui'
c:\program files\microsoft visual studio\myprojects\myim\myim.c(34) : error C2065: 'msnui' : undeclared identifier

------------------------------------------------------------
error is like that.. i can compile the same project with dev-c++, but i want to use resource files so that i click new dynamic dll on visual c++ 6.0 and then i add my header and c file, but when i try to compile it, it gives this error

note: my headers #include <windows.h>
#include "myim.h"
mydiz is offline   Reply With Quote
Old 16th November 2005, 23:23   #5
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
Try this:
PHP Code:
HWND msnui;
//...
msnui NULL


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 17th November 2005, 06:56   #6
mydiz
Junior Member
 
Join Date: Nov 2005
Location: Turkey
Posts: 21
Send a message via ICQ to mydiz Send a message via Yahoo to mydiz
Quote:
Originally posted by Joel
Try this:
PHP Code:
HWND msnui;
//...
msnui NULL
this time error happened like this it still not working
--------------------Configuration: myim - Win32 Debug--------------------
Compiling...
myim.c
C:\Program Files\Microsoft Visual Studio\MyProjects\myim\myim.c(51) : warning C4013: 'cleartag' undefined; assuming extern returning int
C:\Program Files\Microsoft Visual Studio\MyProjects\myim\myim.c(62) : error C2275: 'HWND' : illegal use of this type as an expression
c:\program files\microsoft visual studio\vc98\include\windef.h(195) : see declaration of 'HWND'
C:\Program Files\Microsoft Visual Studio\MyProjects\myim\myim.c(62) : error C2146: syntax error : missing ';' before identifier 'msnui'
C:\Program Files\Microsoft Visual Studio\MyProjects\myim\myim.c(62) : error C2065: 'msnui' : undeclared identifier
mydiz is offline   Reply With Quote
Old 17th November 2005, 07:11   #7
mydiz
Junior Member
 
Join Date: Nov 2005
Location: Turkey
Posts: 21
Send a message via ICQ to mydiz Send a message via Yahoo to mydiz
i am too stupid, i find the error my source code name is myim.c not myim.cpp :P thanks for your helps
mydiz is offline   Reply With Quote
Old 17th November 2005, 09:22   #8
mydiz
Junior Member
 
Join Date: Nov 2005
Location: Turkey
Posts: 21
Send a message via ICQ to mydiz Send a message via Yahoo to mydiz
when i changed the source file's extension .c to cpp my code is working but winamp couldnt recognize the plugin, does any one have suggestion?
mydiz is offline   Reply With Quote
Old 17th November 2005, 09:35   #9
Joonas
Forum King
 
Join Date: Mar 2004
Location: Sweden
Posts: 2,263
Quote:
Originally posted by mydiz
when i changed the source file's extension .c to cpp my code is working but winamp couldnt recognize the plugin, does any one have suggestion?
Hard to say without seeing your code...
Joonas is offline   Reply With Quote
Old 17th November 2005, 10:07   #10
mydiz
Junior Member
 
Join Date: Nov 2005
Location: Turkey
Posts: 21
Send a message via ICQ to mydiz Send a message via Yahoo to mydiz
i search in the form and i learn that i had to put extern "C", i have another question is there any way to make smaller files.. same code when i compile with dev-c++ it become 21 kb, when i compile the same code with visual c++ 2005 code size become 40 kb, how can i reduce the file size?
mydiz is offline   Reply With Quote
Old 17th November 2005, 10:10   #11
Joonas
Forum King
 
Join Date: Mar 2004
Location: Sweden
Posts: 2,263
Quote:
Originally posted by mydiz
i search in the form and i learn that i had to put extern "C", i have another question is there any way to make smaller files.. same code when i compile with dev-c++ it become 21 kb, when i compile the same code with visual c++ 2005 code size become 40 kb, how can i reduce the file size?
well there are some things you can do to decrease filesize...I've attached AggressiveOptimize.h. read the instructions...though VC++ usually gives larger files...that's the price you pay
Attached Files
File Type: zip aggressiveoptimize.zip (4.0 KB, 901 views)
Joonas is offline   Reply With Quote
Old 17th November 2005, 13:42   #12
mydiz
Junior Member
 
Join Date: Nov 2005
Location: Turkey
Posts: 21
Send a message via ICQ to mydiz Send a message via Yahoo to mydiz
Quote:
Originally posted by Joonas
well there are some things you can do to decrease filesize...I've attached AggressiveOptimize.h. read the instructions...though VC++ usually gives larger files...that's the price you pay
hehehe thanks alot, my dll now 10.5 kb :P
mydiz is offline   Reply With Quote
Old 17th November 2005, 13:44   #13
Joonas
Forum King
 
Join Date: Mar 2004
Location: Sweden
Posts: 2,263
Quote:
Originally posted by mydiz
hehehe thanks alot, my code now 10.5 kb :P
Np

Btw I see you're running Visual Studio 2005. I tried it but found it so damn slow...took like several minutes to compile anything...and everything is deprecated (eh...dunno spelling) and thus gives warnings. So, nah I didn't like it. But you do?
Joonas is offline   Reply With Quote
Old 17th November 2005, 17:47   #14
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
I use Libctiny.lib.... google-it


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 17th November 2005, 22:10   #15
mydiz
Junior Member
 
Join Date: Nov 2005
Location: Turkey
Posts: 21
Send a message via ICQ to mydiz Send a message via Yahoo to mydiz
i prefer visual studio for resource editing :P after that i compile it with dev-c++ :P much better and small file size i am a newbie in visual c++ enviroment.. i am a student and i am just geting ansi c++ lesson, my coding is hobby and improving my knowledge.. at that why i dont have lots of lines to compile but one day there will be i guess (sorry for my bad english)
mydiz is offline   Reply With Quote
Old 18th November 2005, 07:48   #16
mydiz
Junior Member
 
Join Date: Nov 2005
Location: Turkey
Posts: 21
Send a message via ICQ to mydiz Send a message via Yahoo to mydiz
vs2005 optimized plugins couldnt detected by winamp in some computers does any one have idea about that? libtiny wanted libc.lib.. in visual studio 2005
mydiz is offline   Reply With Quote
Old 18th November 2005, 17:03   #17
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
Libctiny, void some crt... basically I use Multithreaded DLL, with it... maybe you need to add some old and fusy msvcrt.lib


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 18th November 2005, 17:30   #18
DrO
 
Join Date: Sep 2003
Posts: 27,873
most likely vs2005 is linking to the newer msvc dlls (msvcr71.dll) which isn't a default on most OSes.

check out the dll dependancies of your compiled plugin with this

-daz
DrO is offline   Reply With Quote
Old 18th November 2005, 21:52   #19
mydiz
Junior Member
 
Join Date: Nov 2005
Location: Turkey
Posts: 21
Send a message via ICQ to mydiz Send a message via Yahoo to mydiz
i send the compiled dll files.. they have the same code and nearly same resource.. can u check them for me and give me some suggestions?
Attached Files
File Type: rar gen_im.rar (30.9 KB, 805 views)
mydiz is offline   Reply With Quote
Old 18th November 2005, 22:21   #20
mydiz
Junior Member
 
Join Date: Nov 2005
Location: Turkey
Posts: 21
Send a message via ICQ to mydiz Send a message via Yahoo to mydiz
Quote:
Originally posted by Joel
Libctiny, void some crt... basically I use Multithreaded DLL, with it... maybe you need to add some old and fusy msvcrt.lib
Multithreaded DLL -> when i select that winamp doesnt detect the plugin, i use Multithreaded. and i add "msvcrt.lib" tothe additional libraries and a friend of mine test it.. it is 9.5 kb.. and it is working in his computer now.. i will check it with a win98 computer tomorrow (being a newbie is really a hardthing )
mydiz is offline   Reply With Quote
Old 18th November 2005, 22:29   #21
DrO
 
Join Date: Sep 2003
Posts: 27,873
GEN_IM(NOT WORKING ON SOME COMPUTERS OPTIMIZED VS2005).DLL - missing MSVCR80.DLL which is why that's failing. when you distribute the plugin you'd either need to bundle that dll with it and install it into the root winamp folder or you build the plugin dll statically (which would up the dll size but it'll work on any system that way).

the other two builds check out fine on the dll dependancy count.

-daz
DrO is offline   Reply With Quote
Old 19th November 2005, 13:00   #22
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
But that would be increasing installation size
I like Visual Studio 6.0, because the compiler is so dump <- that we can change its behaviour

Although, you still needing msvcrt.dll (which comes BTW since Win95 OS2)


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 19th November 2005, 16:53   #23
DrO
 
Join Date: Sep 2003
Posts: 27,873
true but that's what happens when using the crt/any related functions to it. this is another reason i won't mess around with msvc above v6.

with the msvcrt.dll, it's safe to assume that it'll be present in all cases since if that's not present you're unlikely even to have winamp let alone the rest of windows working correctly

-daz
DrO is offline   Reply With Quote
Old 20th November 2005, 00:33   #24
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,917
Quote:
Originally posted by DrO
true but that's what happens when using the crt/any related functions to it. this is another reason i won't mess around with msvc above v6.
Is easier to create your own src code for those functions, like killing lstrlen, lstrcpy, etc...


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with MATE.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with MATE.
Joel is offline   Reply With Quote
Old 20th November 2005, 00:59   #25
DrO
 
Join Date: Sep 2003
Posts: 27,873
true, which is what i do for atoi, strnicmp, etc

-daz
DrO is offline   Reply With Quote
Old 20th November 2005, 08:13   #26
mydiz
Junior Member
 
Join Date: Nov 2005
Location: Turkey
Posts: 21
Send a message via ICQ to mydiz Send a message via Yahoo to mydiz
newbie solution i finish coding and i compile my dll file with dev-c++ :P would u like to check my newbie plugin? all config files are working.. maybe coding own strlen function is better for msvcrt
mydiz is offline   Reply With Quote
Old 20th November 2005, 08:19   #27
mydiz
Junior Member
 
Join Date: Nov 2005
Location: Turkey
Posts: 21
Send a message via ICQ to mydiz Send a message via Yahoo to mydiz
i forgot to attach my file, it can swap title-song name, have show on pause feauture and dont show video files titles on msn, sometimes its not good to see video files by others especially when i forgot nowplaying open in msn
Attached Files
File Type: rar myimv1.rar (26.6 KB, 728 views)
mydiz is offline   Reply With Quote
Old 24th November 2005, 15:46   #28
Bizzeh
Forum Pirate
Beta Team
 
Bizzeh's Avatar
 
Join Date: Oct 2001
Posts: 2,032
vc2005 uses alot more than just msvcr80.dll even tho depeneds.exe says thats all it needs.

vc2005 creates WinSxS bianrys (not totaly sure what it means, but its something to do with x86 binarys working on x86, x86_64, and itanium versions of windows, without having to use the slow assed emulation layer).

most people who keep fully upto date on windows xp updates (sp2 and everything after it) should already have WinSxS dll's. for those who dont click here for the installer for the package to install most of them (all the needed ones)
Bizzeh is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump