kX Project SDK and development

Discussion in 'General Discussion' started by Eugene Gavrilov, Aug 9, 2006.

  1. Eugene Gavrilov

    Eugene Gavrilov kX Project Lead Programmer and Coordinator

    some time ago there were questions about porting kX Driver to a more recent compiler (e.g. VS .Net etc.) or to any 'free' compiler (GNU/mingw32/...)

    the main problem is with VS6's MFC headers and libraries - the new versions are no longer compatible with kX

    the best solution so far is to get a -free- version of compiler + headers + libraries from microsoft: http://www.microsoft.com/whdc/driver/wdf/KMDF_pkg.mspx

    the package is called 'KMDF', although it is just Windows .NET DDK + KMDF extensions

    this should fix any compatibility issues, since I use KMDF1.1 for building kX Driver

    Eugene
     
  2. Lex Nahumury

    Lex Nahumury DH Senior Member

    To summerize all this a bit;

    1. It is *not* possible to develop kX plugins, or otherwise use kX API,
    with any non-MS compiler such as GNU/MINGW etc.
    This is because of different ABIs, not because of MFC dependancies!

    2. It *is* possible to develop kX plugins, or otherwise use kX API,
    with any MS compiler such as VC6, and all the free .NET variants
    provided that;

    a. you have the correct MFC headers & libraries
    (Eugene already explained where to get them for free)

    or,

    b. you Plugin or program doesn't use kXGUI.
    In that case you don't need MFC headers & libraries at all
    and any free MS .NET compiler will work.
    (ProFx 3.xx works this way)​

    /Lex.
     
  3. Eugene Gavrilov

    Eugene Gavrilov kX Project Lead Programmer and Coordinator

    yes, this is correct

    however, care must be taken when compiling with newer C++ compilers (.NET):
    for 'debug' builds the compiler might generated additional code (stack checks, buffer overrun detection, exception handling) -- this might conflict with kX binaries, so, please disable such extensions
    --
    kX only supports 'debug' builds, since it is linked against msvcrtd and mfc42d libraries. if you wish to compile your plugins as 'release' builds, you need to be sure you do NOT use these libraries. otherwise a conflict between 'msvcrt' and 'msvcrtd' will occur.
    --
    the link above has full compiler, MFC libraries (headers and libs), CRT etc., however, it lacks 3-4 files. (such as 'zmouse.h' or 'richtext.h') These files are found in either in different folders of the NTDDK, or in the platform SDK. some of them can be easily changed to empty 'placeholders'.

    E.
     
  4. Eugene Gavrilov

    Eugene Gavrilov kX Project Lead Programmer and Coordinator

    by the way, there's an unofficial, unsupported, unrelated to kX Project site with all MFC42 headers and libraries: http://mfc42.narod.ru/

    E.
     
  5. Maddogg6

    Maddogg6 Tail Razer

    Sorry to drudge up an old subject... but I was wondering what it would take to make the 'non-GUI' parts of KX API compatible with other non-MS compilers.
    It seems all the discussion is on plugins - is that all the KX SDK is good for?
    I would think a wrapper for the non-GUI & non-plugin aspects of KX would be possible. Like making an addon (with its own GUI, or 'ini file' based) in GCC for instance.)

    Or does that conflict with the NDA E. signed??

    Sorry if I ask dumb questions...

    Mark
     
  6. Max M.

    Max M. h/h member-shmember

    unfortunalty, making kX API "any compiler friendly" means rewriting everything in a pure C - a hell of stupid work... (that's not MS fault but general C++ weirdness - none of C++ compilers have compatible ABI). Finally, i'd say this would be a real waste of time (finally it would much easier for you to learn a basics of C++ then for anyone to rewrite anything from scratch in a lowerlevel language). Today, there're already three variants of free MS C++ compilers available for free (VC Toolkit (VC7.1), one built in DDK (same VC7.1 + all nesessary headers & libraries) and VC Express (VC8 + anything and IDE).
     
  7. Maddogg6

    Maddogg6 Tail Razer

    Well I see your point max -thanks btw..

    But Im more interested in the ability to import KX lib into other languages that are at least within my comprehension level - like FreeBasic or PureBasic. Which, can import C++ libs (in purebasic AFAIK)- but the name mangling need 'conversion' or something like that - But I was told the original SDK could be exported or wrapped in VC to allow more easier import... I most certainly could be (probably) confused in this, and for that I appologize.... I'm a programming idiot trying to learn and make something with KX SDK in any way I can.

    I tried VC and its just too much for my idiot brain to grasp.

    I'll stop now :D

    Thanks again Max.

    Mark
     
  8. Max M.

    Max M. h/h member-shmember

    btw. if i'm not mistaken - Eugene has blustered to provide such compability. I seriously doubt - but nobody made him to say so ;)
     
    Last edited: Jan 4, 2007
  9. Tril

    Tril Triple screen racing ftw

    I successfully compiled a few kX plugins (demo, TheDelay, TimeBalanceV2) using Microsoft Visual Studio .NET 2003 by using the includes and libs in Windows Driver Kit (WDK).

    You have to download WDK (2,4 GB) and install it. The files from WDK that you need for compiling kX plugins only take about 49 MB of disk space. From reading the license of WDK, it does not seem that you can legally redistribute the headers and library files. I personally installed "Microsoft Document Explorer" and "WDK Build Environments, Samples, and Documentatin (Development Kit)".

    Microsoft Visual Studio .NET 2003 contains a list of include files and library files. You can get to that list that way : Tools->Options...->Projects->VC++ Directories. Before attempting to compile kX plugins, the IDE was already correctly set-up to compile Windows programs by having the includes ands libraries paths of DirectX and the Windows Platform SDK entered.

    To compile kX plugins, I added the following include folders :
    (WDK install folder)\inc\mfc42
    (WDK install folder)\inc\api

    and the following library folders :
    (WDK install folder)\lib\mfc\i386

    This worked to compile the demo and TheDelay plugins. When compiling TimeBalanceV2, I got a linker error on the function KillTimer. I fixed this by adding

    Code:
    [B]#define _AFX_ENABLE_INLINES[/B]
    before the includes of the MFC headers in StdAfx.h.
     
  10. Maddogg6

    Maddogg6 Tail Razer

    Ok - I got VS2003 working now...and I went to install the WDK - and I have a Q:

    You mention we only need 49MB of what the WDK installs - yet the mcf42.zip file linked to above is showing 775KB only. I mean - thats > 50:1 compression ration does that sound right?

    Id like to avoid the extra ~1,195 (thats 'thousand') MB install of the build environment of the WDK?

    Has anyone verified the linked mfc42.zip works?

    edit: nvrmnd - that mfc42.zip file appears to be corrupt. winzip and winrare choke on it and I notice its only 50KB not the 775KB FF d/l manager indicated.

    So - I guess I'll just install the build env of WDK and let everyone know that mfc42.zip was very slow to D/L and the file doesnt open.

    Mark
     
    Last edited: Feb 25, 2007
  11. Maddogg6

    Maddogg6 Tail Razer

    Update:
    here before you is a complete moron who can confirm - after, installing the WDK with VC2003 as Tril posted, I was able to compile AND run successfully the KX demo plugin. And if I can do it - pfff....
     
  12. Lex Nahumury

    Lex Nahumury DH Senior Member

  13. Doug W

    Doug W New Member

    Well Md6, if you are a complete moron, I am afraid that some of us are sub-idiots because I don't even know what you are talking about.

    I guess I will have to go back to the beginning and see if I can figure out any of this type of programming.

    My only programming experience is AutoLISP and a smidgeon of visual basic. I don't know if any of that will even help me at all. But if I give this a try, it should move you up the ranks from moron to beginner, I will assume the moron position and scrub the kX toilets on the night shift.
     
  14. Russ

    Russ New Member

    Here is some updated info:

    The WDK link has been moved, so it seems it is not so easy to get now (although it can be found elsewhere on the web).

    In any case it should not be needed. The Windows Server 2003 SP1 DDK should also work, and it is only 236MB (as opposed to 2.4 gigabytes).

    Install the DDK:

    The minimum options to install:
    Windows Driver Development Kit Common Headers
    Windows Driver Development Kit Required Build Tools
    Anything else is optional.

    Add the WINDDK\3790.1830\inc\mfc42 folder to the list of includes (at the top) in VC.
    Add the WINDDK\3790.1830\lib\mfc\i386 folder to the list of libraries (at the top) in VC.

    Tested with MS Visual Studio .NET 2003.

    -Russ
     
    Last edited: Apr 19, 2007
  15. zaboomafoo

    zaboomafoo New Member

    kx gui classes - reference

    Hello,

    Is there any document or thread here ini the forum or anywhere else which gives some details about the kx gui classes (kKnob, kPeak, kSlider, ...) and functions (create_vfader, ...)?

    I am looking at the header files and provided source code. Many of the gui classes are not used in the sources and header files don't have any comments :( .

    Regards,
    Frank
     
  16. Lex Nahumury

    Lex Nahumury DH Senior Member

    No, there are no such documents.
    But most gui classes *are* used in the sources.
    Besides, the class member function names in the headers (should) more or less speak for themself.
    FYI; kx gui classes are subclassed MFC controls so it shouldn't be to hard to figure out how they work.
    Else, just ask here.

    Cheers.
     
    Last edited: Aug 6, 2008
  17. zaboomafoo

    zaboomafoo New Member

    Thanks for the reply.

    I shouldn't have said "most of" :) ... but some of the controls are not used in the sample sources. I am not able to find an example of using kKnob class. Actually I have no idea how it is supposed to look like. Is there a plugin somewhere that uses this class?

    I tried this:

    Code:
     
        // kKnob test
        knob = new kKnob;
        knob->Size.init(50,50);
        knob->create(0, 4, 4, this, KNOB_ID, 0, 100, -150, 300);
        knob->set_pos(20);
        knob->show();
    
    but nothing shows in the plugin window at position 4,4.

    Anybody has some sample code that uses this control?

    Regards,
    Frank
     
  18. Lex Nahumury

    Lex Nahumury DH Senior Member

    That is correct, kKnob is a non-functional control.
    IIRC it's only a draft. It never got finished.
     
    Last edited: Aug 6, 2008
  19. havvesom

    havvesom New Member

    thanks.But Im more interested in the ability to import KX lib into other languages that are at least within my comprehension level - like FreeBasic or PureBasic. Which, can import C++ libs (in purebasic AFAIK)- but the name mangling need 'conversion' or something like that - But I was told the original SDK could be exported or wrapped in VC to allow more easier import... I most certainly could be (probably) confused in this






    ________________________________________________
    [​IMG][​IMG][​IMG][​IMG][​IMG][​IMG][​IMG][​IMG][​IMG][​IMG]
     
  20. fenway2k

    fenway2k New Member

    Ok, I don't know where to post so forgive me...but I have a problem and I need it explained to me like I was a child.

    I have a very old Dell computer (about 9 years) running Windows XP with an old Audigy Live Soundblaster card (don't know which model it is, sorry). I'm still very happy with my computer.

    It does everything I need it to do do I will not upgrade until XP stops working. However, I used a program called Driver Checker that automatically scanned my computer for outdated drivers and it installed this KX audio driver and as long as I am on the Internet and am using iTunes or Media player to play music, it sounds great.

    However, when I attempt to play cd's or dvd's, I get no sound at all.

    While I consider myself an above average user, I have no knowledge of sound mixers, channels, whatever, and the KX mixer is very confusing and complicated to me so I cannot figure out how to tweak it in order to be able to enable the sound from my dvd burner.

    If anyone can help me I would appreciate it very much. Thank you.
     

Share This Page