关于问题1:
我有一个类,想在WIN窗口模式(消息驱动)下不编译某个构造函数和一个成员函数。而另几个函数在CONSOLE APPLICATION里是一定要编译的。请问如何定义#ifdef后的变量以满足我要求? 如
void myFun()
{
  cout << "hello world"  << endl;
}
就不想在窗口模式下被编译。
问题2
我想DOWN个可播MP3的DLL或COM组件,哪里有?

解决方案 »

  1.   

    http://www.chinasoft.net.cn/v01/insert/insert_show.php?in_id=97
    BW MP3 OCX 是一个 MP3 播放功能的插件,它可以使你的程序可以播放 MP3,这个版本增加了将 MP3 文件转换为 WAV 文件的功能。
      

  2.   

    1. 可以这样实现
    #define _MY_CONSOLE_#ifdef _MY_CONSOLE_
    void myFun()
    {
      cout << "hello world"  << endl;
    }
    #endif
    在CONSOLE APPLICATION中就定义#define _MY_CONSOLE_
    在WIN窗口模式中,就把#define _MY_CONSOLE_去掉
      

  3.   

    1. 凡是console应用,VC会定义_CONSOLE,所以不用自己定义,只要:
    #ifdef _CONSOLE
    void myFun()
    {
      cout << "hello world"  << endl;
    }
    #endif
      

  4.   

    2. 这里甚至有源代码:
    http://www.codeproject.com/audio/mp3player.asp
      

  5.   

    to pcman1990(pcman): Not an MP3 player   Anonymous  12:20 14 Jun '01  
      ...unless you have Media Player with the codex's installed.
    Or you can also say "divx" player, or mpeg player, or midi player, etc. Since all you're doing is just showing how to use the media player.
      
    it is not the code that i expect.