Compiler errors

Discussion in 'Effects and the DSP' started by Doomsayer, Jul 9, 2004.

  1. Doomsayer

    Doomsayer New Member

    Joined:
    Feb 3, 2004
    Messages:
    154
    Likes Received:
    0
    Trophy Points:
    0
    I'm trying to compile the fx_demo program from the SDK, and I have problems. There's a conflict between kDefs.h and the system's atlconv.h - same functions AtlA2WHelper, AtlW2AHelper, AtlA2WHelper, AtlW2AHelper and macros A2W, W2A are defined. Their bodies are somewhat different in the two files. Trying to comment them out in kDefs.h leads to a perfect compile, but later to an assertion fail in winocc.cpp line 290 as soon as I press "tweak" on the plugin in the DSP. Commenting them out in atlconv.h leads to lots of "undeclared identifier" compiler errors. Using Visual C++ 7.0. So what am I doing wrong? :confused:
     
  2. Tiger M

    Tiger M kX user

    Joined:
    Apr 14, 2004
    Messages:
    851
    Likes Received:
    0
    Trophy Points:
    0
    That is strange. I've been using VC 6.0 and haven't had such problems at all. Did you try to compile it as it was, without altering the code or the project settings in any way?
     
  3. Doomsayer

    Doomsayer New Member

    Joined:
    Feb 3, 2004
    Messages:
    154
    Likes Received:
    0
    Trophy Points:
    0
    The project/code wasn't altered in any way. atlconv.h gets included with some mfc header files, as far as I understand. Any ideas on how to resolve this problem?
     
  4. Tiger M

    Tiger M kX user

    Joined:
    Apr 14, 2004
    Messages:
    851
    Likes Received:
    0
    Trophy Points:
    0
    fx_demo should be all right, being already compiled in the SDK distribution and working fine.
    This must be a kX SDK <-> VC 7.0 relation issue, because there are no such problems in 6.0.

    The difference between kDefs.h and atlconv.h is:

    ASSERT(something... != NULL); //kDefs

    ATLASSERT(something... != NULL); //atlconv.h

    Surely Eugene would know what this is about. I'll send him a mail.

    You can switch back to VC 6.0, but I don't know if this would be very comfortable for you for such a small problem.
     
    Last edited: Jul 12, 2004
  5. Doomsayer

    Doomsayer New Member

    Joined:
    Feb 3, 2004
    Messages:
    154
    Likes Received:
    0
    Trophy Points:
    0
    The contents of my atlconv.h (hope I don't get massacred for posting its contents :) ) :
    inline LPWSTR WINAPI AtlA2WHelper(LPWSTR lpw, LPCSTR lpa, int nChars, UINT acp) throw()
    {
    ATLASSERT(lpa != NULL);
    ATLASSERT(lpw != NULL);
    if (lpw == NULL)
    return NULL;
    // verify that no illegal character present
    // since lpw was allocated based on the size of lpa
    // don't worry about the number of chars
    lpw[0] = '\0';
    MultiByteToWideChar(acp, 0, lpa, -1, lpw, nChars);
    return lpw;
    }

    inline LPSTR WINAPI AtlW2AHelper(LPSTR lpa, LPCWSTR lpw, int nChars, UINT acp) throw()
    {
    ATLASSERT(lpw != NULL);
    ATLASSERT(lpa != NULL);
    if (lpa == NULL)
    return NULL;
    // verify that no illegal character present
    // since lpa was allocated based on the size of lpw
    // don't worry about the number of chars
    lpa[0] = '\0';
    WideCharToMultiByte(acp, 0, lpw, -1, lpa, nChars, NULL, NULL);
    return lpa;
    }
    inline LPWSTR WINAPI AtlA2WHelper(LPWSTR lpw, LPCSTR lpa, int nChars) throw()
    {
    return AtlA2WHelper(lpw, lpa, nChars, CP_ACP);
    }

    inline LPSTR WINAPI AtlW2AHelper(LPSTR lpa, LPCWSTR lpw, int nChars) throw()
    {
    return AtlW2AHelper(lpa, lpw, nChars, CP_ACP);
    }
    /*... Some more defines here ... */
    #define A2W(lpa) (\
    ((_lpa = lpa) == NULL) ? NULL : (\
    _convert = (lstrlenA(_lpa)+1),\
    ATLA2WHELPER((LPWSTR) alloca(_convert*2), _lpa, _convert, _acp)))

    #define W2A(lpw) (\
    ((_lpw = lpw) == NULL) ? NULL : (\
    _convert = (lstrlenW(_lpw)+1)*2,\
    ATLW2AHELPER((LPSTR) alloca(_convert), _lpw, _convert, _acp)))

    Please check if yours are the same (I mean for VC++ 6.0). Also, how is this not a conflict on your system? Is atlconv.h not #included in your MFC headers?
     
    Last edited: Jul 10, 2004
  6. Tiger M

    Tiger M kX user

    Joined:
    Apr 14, 2004
    Messages:
    851
    Likes Received:
    0
    Trophy Points:
    0
    There is a difference. Here it is:


    throw() //this is not present in VC 6.0 version of the header

    I'll tell you what we'll do, but we should switch to PMs for that...:)
     
  7. Doomsayer

    Doomsayer New Member

    Joined:
    Feb 3, 2004
    Messages:
    154
    Likes Received:
    0
    Trophy Points:
    0
    Well, another interesting thing I noticed. These functions/macros aren't used anywhere in the demo. So this means that I can safely comment them out. But then the abovementioned Assertion Fail seems to prove that there's deeper incompatibility between SDK 3537 and VC 7.0 include files...
    The Assertion Fail happens here :
    int CWnd::GetDlgCtrlID() const
    {
    ASSERT:):IsWindow(m_hWnd) || (m_pCtrlSite != NULL)); // Line 290

    if (m_pCtrlSite == NULL)
    return ::GetDlgCtrlID(m_hWnd);
    else
    return m_pCtrlSite->GetDlgCtrlID();
    }
    Perhaps this thread should be moved to the bug reports section?
     
  8. Doomsayer

    Doomsayer New Member

    Joined:
    Feb 3, 2004
    Messages:
    154
    Likes Received:
    0
    Trophy Points:
    0
    Btw, the Assertion Fail is caused by kxmixer.exe, so I'm not even sure if it's MY winocc.cpp where the error occurs. Probably it isn't.
    Anyway, I seem to have narrowed the problem to one call inside iDemoPlugin::create_cp, namely tmp->create(). I'm afraid only the developer can investigate further...
     
    Last edited: Jul 10, 2004
  9. Tiger M

    Tiger M kX user

    Joined:
    Apr 14, 2004
    Messages:
    851
    Likes Received:
    0
    Trophy Points:
    0
    This is always the case when you get a plugin compiled without errors in VC, but there is still something wrong or missing in the code. I had this type of error many times:) .

    I think this is the right place for this thread, but it actually doesn't matter, because nobody of the regular users would understand it anyway :D .

    btw, the 'Effects and the DSP' forum was intended by Eugene mostly for programmers and code sharing. It didn't turn out to be so, which is sad...:tears:

    Here is one very dramatic episode of kX history, take a look, its a real drama:

    http://www.driverheaven.net/showthread.php?s=&threadid=21385&highlight=distortion
     
  10. Tiger M

    Tiger M kX user

    Joined:
    Apr 14, 2004
    Messages:
    851
    Likes Received:
    0
    Trophy Points:
    0
    Check out your PM box again...
     
  11. Lex Nahumury

    Lex Nahumury DH Senior Member

    Joined:
    Jan 5, 2003
    Messages:
    1,944
    Likes Received:
    6
    Trophy Points:
    0
    >>I think this is the right place for this thread,
    Yes it is,.. So by all means continue..!!

    >>but it actually doesn't matter, because nobody of the regular users would understand it anyway.
    :)

    >>Here is one very dramatic episode of kX history, take a look, its a real drama:
    I got over it ...:cool:

    /LeMury
     
  12. Tiger M

    Tiger M kX user

    Joined:
    Apr 14, 2004
    Messages:
    851
    Likes Received:
    0
    Trophy Points:
    0
    Yes, I think that it will be nice if I put the conclusion here, so anyone interested in plugins programing will be informed:

    The best (and maybe the only working) compiler for kX Project related programming is MS Visual C++ 6.0.
    VC++ 7.0 or .NET doesn't seem to work due to MFC changes.
     
  13. Tiger M

    Tiger M kX user

    Joined:
    Apr 14, 2004
    Messages:
    851
    Likes Received:
    0
    Trophy Points:
    0
    And here is the final conclusion and solution directly from Eugene:

    "yes, VC7 uses different headers & binaries and is not 100% compatible with
    kX SDK.
    you may, however, use it provided you point to the original VC6 headers in
    your project"

    Its clear what should be done...
     
  14. dj_stick

    dj_stick Apple Fanboy?

    Joined:
    Jun 3, 2003
    Messages:
    17,575
    Likes Received:
    204
    Trophy Points:
    88
    bloody microsoft and their non-standard following apps
     
  15. Soeren_B

    Soeren_B kX Project DSP Engineer

    Joined:
    Dec 12, 2002
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    0
    A little browsing in this forum should tell you this, since it has been discussed before.
    MS Visual Studio 7 (.Net) will not work for creating kX-plugins.

    Cheers
    Soeren
     
  16. Tiger M

    Tiger M kX user

    Joined:
    Apr 14, 2004
    Messages:
    851
    Likes Received:
    0
    Trophy Points:
    0
    Did you read the previous posts?
    VC 7 itself will work, provided that you have VC 6 MFC headers.

    By the way, I have read the thread you're speaking of, yes.
     
  17. Doomsayer

    Doomsayer New Member

    Joined:
    Feb 3, 2004
    Messages:
    154
    Likes Received:
    0
    Trophy Points:
    0
    Well, that's sad. It's just another problem in the way of those who wish to participate actively in the kX community. And VS 7 is gaining in popularity, btw... Anyway, when I get past this problem, I'll post a how-to :)
     
  18. Soeren_B

    Soeren_B kX Project DSP Engineer

    Joined:
    Dec 12, 2002
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    0
    Cool the jets ;)

    Do you know if it is possible to get the VC 6 MFC headers somewhere (free, as in beer)?
    I am still using VC 6, but it would be nice to be able to show people the old headers. Still, if they want to make kX plugs badly enough they should be able to locate them by themselves :evil:

    /Soeren
     
  19. Tiger M

    Tiger M kX user

    Joined:
    Apr 14, 2004
    Messages:
    851
    Likes Received:
    0
    Trophy Points:
    0
    aha, right, but the truth is that I really like to encourage dsp development among kX users.
    its a great shame that kX project is such a superb environment and there are only 7-8 people in the whole world to venture in programming it;)

    Have fun.
     
  20. dj_stick

    dj_stick Apple Fanboy?

    Joined:
    Jun 3, 2003
    Messages:
    17,575
    Likes Received:
    204
    Trophy Points:
    88
    when i get the time i'm gonna take a good look at your guide and see what i can come up with - but i have never done any programming before so it may take a while
     

Share This Page

visited