HardwareHeaven.com

HardwareHeaven.com

Looking for the skin chooser?
 
 
  • Home

  • Hardware reviews

  • Articles

  • News

  • Tools

  • Gaming at HardwareHeaven

  • Forums

 

Go Back   HardwareHeaven.com > Forums > Hardware and Related Topics > kX Project Audio Driver Support Forum > Effects and the DSP


Reply
 
Thread Tools
Old Sep 16, 2005, 05:07 PM   #1
DriverHeaven Senior Member
 
ROBSCIX's Avatar
 
Join Date: Mar 2004
Posts: 1,732
Rep Power: 0
ROBSCIX is on a distinguished road

arrow Free C++ Compilers and KX DSP

This has been a source of much frustration for me, so I would like to hear everybody's thought. I have asked Eugene to participate also, as I was informed this subject is unknown to most user as it has never been attempted. So here's the thread and let's hear the ideas please.
ROBSCIX is offline   Reply With Quote


Old Sep 16, 2005, 05:33 PM   #2
kX Project Lead Programmer and Coordinator
 
Join Date: Dec 2002
Posts: 3,119
Rep Power: 75
Eugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud of

so, there are at least two possibilities: either use a freeware version of M$ visual C compiler (can be downloaded for free) or mingw32 or any similar gnu/watcom/whatever
--
REQUIREMENTS:
you will need a set of windows headers (windows.h etc..) -- not bundled with freeware msvc(!)
standard ansi headers (usually bundled with the compiler)
a compiler, a linker
a make utility or similar tool
MFC 4.2 headers and libraries (debug ones! - mfc42d.lib, mfcs42d.lib etc..)
kX SDK
--
now go to \fx_demo folder:
here's a brief description of files
--
da_demo.cpp is generated by kX DSP (don't forget to generate new GUID -- and add your copyright notice) -- you may wish to rename it to da_{your fx name}.cpp
debug.cpp -- leave as is
*.dsp/*.dsw - leave it, since you don't use MS VC6
fxlib.rc - edit it to reflect your copyright / name
simple.cpp: edit if you change file names (e.g. 'demo' -> 'my_effect')
demo.cpp: plugin GUI -- will definitely need to be updated
---
you will need to define -D"_MBCS" -D"_AFXDLL" -D"_USRDLL" -D"_WINDLL"
also, if your compiler supports pre-compiled headers, add 'stdafx.h' (e.g. /YX"stdafx.h" optoin)
add '../h' as your include path (e.g. '-I..\h')
add three additional libraries: ../lib/kxapi.lib, ../lib/kxgui.lib, ../lib/kxmixer.lib
(and add '../lib' as your default library path)
there's a simple makefile included, which, however, might be outdated and will only work for MS-based compilers
--
add the following files to your own makefile:
debug.cpp demo.cpp simple.cpp stdafx.cpp
do NOT add da_demo.cpp!
set output type as 'windows DLL'
add fxlib.rc to your project (or use any resource compiler you have to generated .res file)
add MFC42 headers and libraries to your INCLUDE and LIB environment variables
compile and link the .dll
rename it to .kxl and register (right click - register)
---
that's it!

E.
Eugene Gavrilov is offline   Reply With Quote
Old Sep 16, 2005, 07:18 PM   #3
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

Eugene, what is your take on the issue of MFC compatibility with the compiler? My understanding is that MFC (particulairly older versions such as MFC 4.2), are not fully ISO compliant and as such, freeware compilers that do not specifically claim MFC support, will have problems using the MFC headers/libs (even the newer MS compilers (which claim to be more ISO compliant) have issues with some of the MFC 4.2 headers). In trying to help ROBSCIX, I did some brief searching of the DEV C++ forum, and found many threads indicating that it (DEV C++/mingw32) was not compatible with MFC (and have seen simialr info regarding other freeware compilers).

I think the best bet (in using a free compiler) is to use the free compiler from the Visual C++ Toolkit 2003, as it claims to be the same compiler (a command line version) as that which is included with VC++ .NET 2003. However, in my VC++ .NET 2003 testing (using MFC 4.2), I have found that afxtempl.h needed to be modified, and math.h from VC++ 6 needed to be used to get it to compile, otherwise it worked (math.h was needed due to issues with plgmath.h, alternativley plgmath.h could be modified). I imagine since the toolkit uses the same compiler, that the same modifications would be needed to get it to work.

-Russ
Russ is online now   Reply With Quote
Old Sep 16, 2005, 07:52 PM   #4
DriverHeaven Lover
 
radiocolonel.it's Avatar
 
Join Date: Jan 2005
Location: Italy
Posts: 192
Rep Power: 0
radiocolonel.it is on a distinguished road

Donator
None of u knows this? It's more than freeware, it's open-source!

Bloodshed Software - Dev-C++
__________________

http://www.rossanodembech.it
radiocolonel.it is offline   Reply With Quote
Old Sep 16, 2005, 07:56 PM Threadstarter Thread Starter   #5
DriverHeaven Senior Member
 
ROBSCIX's Avatar
 
Join Date: Mar 2004
Posts: 1,732
Rep Power: 0
ROBSCIX is on a distinguished road

All this thread is trying to accomplish is a definative source for information on this subject. I talked to quite a few people regarding this info and I was sent in circles many times. So I went to the horses mouth. Wether using DEV C++ or not is irrelavent..it is an example of a freeware compiler. As long as you have the proper headers and lib's to link to I guess it's compatible-that's from Eugene.
ROBSCIX is offline   Reply With Quote
Old Sep 17, 2005, 03:11 AM   #6
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69
Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!

ROBSCIX

>Eugene, what is your take on the issue of MFC compatibility with the compiler?

Don't forget: kX started in 2001-2002... that time we have had to get something working as sooner as possible (and not super-puper portable, and not the center of someone's digital universe) - and we decided to use MFC for user-intefaces. It's not a big problem to rewrite everything w/o MFC - but for now it makes no sense to waste a year just for ghostly possibility of wider uses of different compilers.

> As long as you have the proper headers and lib's to link to I guess it's compatible-that's from Eugene.

Exactly, i see no problem using mingw for building kX mixer plugins as soon as you have required headers and libs (win32/mfc)
and, btw - stop calling Dev-C++ _compiler_ - it is not - it is IDE.. its compiler is gcc (kinda "mingw edition" ;) - wrong definitions add unnecessary-confusing-mix-ups.

And as other people already said to you before: to get started with kX you can write your plugins without C++ at all.. (yes using Dane) - more over you still have to write your DSP code using Dane (“Dane” as a language - not kX Editor) whether or not you’re plannig your plugin to have user-interface written in C++... so if you have no DSP code - you have no plugin - (whatever your C++ compiler and your C++ experience are)...
- i hope you've got my idea – this (“compiler war”) is just wrong starting point.

---
(just for case - if you are really interested in "programming DSP algorithms with C/C++" - consider starting your training with VST/DirectShow plug-ins - not kX)

Last edited by Max M.; Sep 17, 2005 at 03:28 AM.
Max M. is offline   Reply With Quote
Old Sep 17, 2005, 06:57 PM Threadstarter Thread Starter   #7
DriverHeaven Senior Member
 
ROBSCIX's Avatar
 
Join Date: Mar 2004
Posts: 1,732
Rep Power: 0
ROBSCIX is on a distinguished road

I understand perfectly what Eugene said. But if you feel the need to repeat it to me ok. Yes I know IDE, GCC is the compiler..etc..thanks for the terminology lesson...I guess I should know better than to shorten a term in a forum ...AS for the Dane info, Yes I know that also. Thx though. Maybe this thread could be a good source for people with the same questions... That was my idea.

Last edited by ROBSCIX; Sep 17, 2005 at 07:36 PM.
ROBSCIX is offline   Reply With Quote
Old Sep 18, 2005, 06:01 AM   #8
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69
Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!

>aybe this thread could be a good source for people with the same questions...

Exactly.
[color=gray] (sorry, i know - sometimes i sound too hard... yep... i decided to put that here just for some case... - or other people entering this thread may start to think that "kX is a secret agent of MS, it forces people to buy old and useless VC6 and does not really like others to contribute, abases free compilers (like "Dev C++" one) and so on..." ;) [/color]

Last edited by Max M.; Sep 18, 2005 at 06:08 AM.
Max M. is offline   Reply With Quote
Old Sep 18, 2005, 06:49 PM Threadstarter Thread Starter   #9
DriverHeaven Senior Member
 
ROBSCIX's Avatar
 
Join Date: Mar 2004
Posts: 1,732
Rep Power: 0
ROBSCIX is on a distinguished road

hmm, I just wanted a straight answer if it was an option or not. See I had alot of information regarding that question. Yes, No, Maybe but linking is required, Yes but never been done in this fashion. You can get a free Ms compiler-but it doesn't contain the MFC, you can get a different version from MS but you cannot use it for MFC type projects?..now you see where all the frustration comes fom when all I wanted to do was contribute and possibly develop my own ideas... oh well.
ROBSCIX is offline   Reply With Quote
Old Sep 18, 2005, 11:40 PM   #10
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

Well it is a catch 22... Most people that have MFC, have VC++, so they do not need to try and use it with other compilers. MFC compatibilty with other compilers has nothing at all to do with kX, and although you think that some of us should know for sure what will work, and what won't, that is simply not the case. We can only tell you what we think based on our individual experiances, we cannot say anything for absolute certainty, regarding any 3rd party software, without having done it successfully ourselves (or at least having some reliable source of information to refer to).

The bottom line is that MFC (being a commercial library) is not likely to be included with any freely available software, and if it was, it is also likely that it would be under a very limited license (i.e. as in an introductory version of VC++), that would most likley prevent you from being able to publish anything that you created using it (for anything other than demonstration purposes).

The free stuff that is available from Microsoft (as well as the commercial software), specifically states what it can be used for (i.e. licensing info), and what is included with the software. Any confusion regarding MS software can be cleared up by refering to the documentation (and FAQ's) for that software.

The same things goes for 3rd party compilers, etc. The developers of that software would be the best source of information regarding compatibility with specific libraries such as MFC.

We can only offer information based on our experiances, and/or refer you to information that we may find about the issue. Beyond that it is just an educated case, which may not always be correct ("should work" does not mean "will work").

When I give information that I cannot be sure about, I try to indicate that in my response, and I try to give the reasons behind my thinking that way, or the source of the information, that lead me to that conclusion, etc (see my previous post). Beyond that it is up to you to follow up on that info (i.e. if you think it is not correct).

Last edited by Russ; Sep 18, 2005 at 11:53 PM.
Russ is online now   Reply With Quote
Old Dec 7, 2005, 07:53 AM   #11
Tail Razer
 
Maddogg6's Avatar
 
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 0
Maddogg6 will become famous soon enoughMaddogg6 will become famous soon enough

I spied this - LCC - then, theres this post in their forums that -
Assuming KX requires the MFC library for calling COM objects - (??)

Offers a work around. Both the Library named in this post:
http://www.q-software-solutions.de/f...&highlight=mfc
and LCC are freeware (or free for private use) - comments?

I guess Im asking if the MFC libs are needed ONLY to call COM objects?
Not that I understand completely, but Im just curious.

edit: nevermind - I misunderstood - theyre just accomplishing something wothout the need of MFC - like KX should - arg... lol j/k.

Last edited by Maddogg6; Dec 7, 2005 at 08:03 AM.
Maddogg6 is offline   Reply With Quote
Old Dec 19, 2005, 10:19 PM   #12
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

Quote:
Originally Posted by Maddogg6
I spied this - LCC - then, theres this post in their forums that -
Assuming KX requires the MFC library for calling COM objects - (??)

Offers a work around. Both the Library named in this post:
http://www.q-software-solutions.de/f...&highlight=mfc
and LCC are freeware (or free for private use) - comments?

I guess Im asking if the MFC libs are needed ONLY to call COM objects?
Not that I understand completely, but Im just curious.

edit: nevermind - I misunderstood - theyre just accomplishing something wothout the need of MFC - like KX should - arg... lol j/k.
kX's MFC dependancy is not the biggest problem.
It is absolutly possible to write kX plugins without using MFC
as long as you don't use/link to kxgui.lib.
Of course you'll have to provide your own gui framework (plain win32 api works fine for me),
and write some alternative code for preset handling and a few other things.
Providing your own GUI framework sounds like a big turnoff,
but not using kxgui certainly has it's advantages .

The real problem however is that you can not link the import library kxapi.lib
with any other compiler then the one who produced it, namely MSVC's compiler.
So forget about any Free non-MS compiler. 99% that it won't work!!
If someone has achieved this (which I doubt) without having kxapi.dll source code, then plz speak up!

The only way to write kX plugins 'for free',
is by using a free MS-compiler (.NET/VS2005 Express/MS Platform SDK)
and provide your own GUI framework.


/LeMury

Last edited by LeMury; Dec 29, 2005 at 10:53 AM.
Lex Nahumury is offline   Reply With Quote
Old Dec 19, 2005, 10:54 PM   #13
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69
Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!

>If someone has achieved this (which I doubt) without having kxapi.dll source code, then plz speak up!

I have. (google for 'coff2omf' and 'implib')
Max M. is offline   Reply With Quote
Old Dec 19, 2005, 11:04 PM   #14
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

>>I have. (google for 'coff2omf' and 'implib')
I hoped you did.
Hmm,... yes, I've tried that, but no success. I will try it again and report back.
Lex Nahumury is offline   Reply With Quote
Old Dec 19, 2005, 11:08 PM   #15
Tail Razer
 
Maddogg6's Avatar
 
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 0
Maddogg6 will become famous soon enoughMaddogg6 will become famous soon enough

Ahhh. ok, now its making more sense.

Thanks for the info LeMury.

I guess Im a bit off from making anything usefull.... but I am looking for 'if its in my realm of possibilities' to even start heavy 'study' on this subject.

Im trying to learn, but it seems like the beginner tutorials (On C/C++) are either, too simple (and boring) OR more intersting stuff is too complex and not very well commented, or is using terms assumed is understood already... I have a hard time finding stuff thats more complex yet well commented code examples.

I have a particular hard time grasping techniques NOT opcodes/commands per se.

A good example is a simple sort routine... I understand the various string manipulations, I understand the need for sorting - but no matter how much I look an an example in C - I dont understand the programming logic to it by examining code. - So I've been looking at BASIC implementaions to try to understand these types of techniques.

Any good site you can recommend (on C/C++) for a guy like me?

Any insight would be greatly appreciated.

and Thanks again....
Maddogg6 is offline   Reply With Quote
Old Dec 19, 2005, 11:55 PM   #16
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

I think the problems with some of the beginner tutotrials is that they are for C/C++ itself, and thus they really do not include any GUI stuff (other than the basic console), and because of this, much of the material covered is a bit boring. It does however include the basic information about the language that you need to understand (you really want to have a good understanding of classes and pointers). It gets more interesting when you start working with GUI's, but the problem with that is that you are learning more about a specific library than you are about the language itself (and is the reason why it is usually not covered on the basic C/C++ tutorials). If you are looking for stuff that can be built using basically any compiler, then I would start with Windows Platform SDK stuff. This will allow you to design Windows programs, and the GUI lib is basically part of the OS itself so you do need need any extra libs. In this case you are learning more about programming Windows itself, then you are about the language, but it is a lot more interesting. The key is to start building something/anything. Once you start actually doing it, you will find that you will start to understand it a lot more (kind of like using kX).

The FunctionX website provides many tutorials for a wide variety of topics including programming languages like C++.
The Forger's Win32 API Programming tutorial is pretty good for someone getting starting with Windows programming using the Platform SDK and C++.
The CodeGuru forums are a great place to find answers to some questions you might have. Also the CodeGuru and CodeProject websites include a bunch of example source code for various things.

One you start working with it, and understand the terminolgy, etc, then you will be able to locate the information you are looking for yourself. When trying to understand something that maybe a little difficult, it helps immensly if you have a real interest in the topic, and until you actually have a need for some of the things covered in the tuturials you are reading (which you will not have until you actually start programming), maybe that interest does not exist.
Russ is online now   Reply With Quote
Old Dec 20, 2005, 01:54 AM   #17
Tail Razer
 
Maddogg6's Avatar
 
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 0
Maddogg6 will become famous soon enoughMaddogg6 will become famous soon enough

Quote:
Originally Posted by Russ
When trying to understand something that maybe a little difficult, it helps immensly if you have a real interest in the topic, and until you actually have a need for some of the things covered in the tuturials you are reading (which you will not have until you actually start programming), maybe that interest does not exist.
This is prolly somewhat true... as the tutorials I do see - Source code that is commented well, are on a subject - or maybe is of little use to me personally.
So YES - for me programming is not 'fun' per se, more of a means to an end.

For instance - I picked up PHP pretty quick (faster than C anyway, Im still NOT a programmer) - because I was able to find example code that is similar to my needs. I dont find this with C/C++ - where working source examples arent usually very well documented.

Im very much that way - Its like pulling teeth for me to learn stuff thats NON-APPLICAPLE to me. (Like Algebra - as soon as it was applied to electronics, real world 'association' kicks in and then it made clear sense to me, the abstract isnt very friendly to me)

I figured with KX - I do have this interest - BUT, most of the info is using an old VC (I have an old NFR VC 2003 now, btw). AND not to mention the hidden stuff, PHP - EVERY thing is exposed and PHP.NET has an EXCELENT reference with A TON of examples for each command.

And yes, no GUI makes it more difficult to get 'instant' gratification from these efforts.

Thanks for the great info Russ.
Maddogg6 is offline   Reply With Quote
Old Dec 20, 2005, 02:12 AM   #18
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

Quote:
Originally Posted by Maddogg6
I have an old NFR VC 2003 now, btw.
Ah, that is good (and not necessarily old). I think the only restrictions on that is re-sale, right? Additionally, with that I think you should be eligible for the downgrade option (that I mentioned in another thread), which would allow you to get VC++ 6 (if you wanted to) for a reasonable price (something like $20), and that is the easiest solution for kX plugin development (for .dll plugins) as it includes the right version of MFC.

Also, since you have MFC, then for a quick start, you may want to look at the FunctionX Visual C++ turorials first, as it also covers MFC GUI stuff, and MFC makes rapid GUI development much easier.

BTW:
You can do some kX programming with that version of VC++ without any problems and without having to jump through hoops. As LeMury indicated, the MFC requirement is on the kX GUI stuff which is mostly used by plugins. You can still do a lot of other things.

(Just to clarify, by VC 2003, do you mean Visual C++ 2003 .NET Standard Edition?)

Last edited by Russ; Dec 20, 2005 at 02:41 AM.
Russ is online now   Reply With Quote
Old Dec 20, 2005, 02:47 AM   #19
Tail Razer
 
Maddogg6's Avatar
 
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 0
Maddogg6 will become famous soon enoughMaddogg6 will become famous soon enough

Well, I mentioned old - cuz the disc looks like it - my friend doesn't take much care of his CD's - lol - as well it not being the last version..

The NFR = Not Fo Re-sale - AFAIK - its a full version - BUT could be like a student version, It was given to a friend of mine in the biz (not a programmer tho) and he gave me this - 'to entice me into buying VS2005 from him' his words... not mine. So I have no clue how it may or may not be restricted.

I had asked him for a VC6 - but he couldnt find his NFR version of that.

The restriction I DO see - is the need for the MSDN subscription just to get the damn helpfile for it - thats what I get when I try to look at the help within the IDE. More $$$ there - just kinda rubs me the wrong way. But I will look into FunctionX -

Keep in mind - Im just trying to learn this so I can play around - as I dont really have a NEED (read, Im self employed, and cant justify the cost on it as a biz expense) for VC in any any flavor.

I guess - I was hoping to learn abit by trying my hand at a KX skin or plugin - because after looking at some of the existing skins - looks like its up my ally competence-wise.


I'll prolly end up just un-installing VC2003 because of the missing help for it and my friend doesnt have the MSDN subscription either.

I do understand C isnt the best language to begin learning programming - but I figured I would give it at least a 'lick and a promise' try. hehe.
Maddogg6 is offline   Reply With Quote
Old Dec 20, 2005, 02:48 AM   #20
Tail Razer
 
Maddogg6's Avatar
 
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 0
Maddogg6 will become famous soon enoughMaddogg6 will become famous soon enough

Yes - .net - heh ** I think - how do I know?
The install routine (shows features and such) as I recall it was mentioned in there - other than that - there aint much to look at here.
Maddogg6 is offline   Reply With Quote
Old Dec 20, 2005, 02:51 AM   #21
Tail Razer
 
Maddogg6's Avatar
 
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 0
Maddogg6 will become famous soon enoughMaddogg6 will become famous soon enough

But I did D/L the SDK and its .net - but was for Server 2003 - ?? Its so damn confusing...
Maddogg6 is offline   Reply With Quote
Old Dec 20, 2005, 03:00 AM   #22
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

The 'About' window should tell you exactly what verison it is. You keep saying C, but I assume you mean C++ (I do not think there is a VC? as opposed to VC++). In any case, the reason I asked is because I also have that version (although mine in not NFR). I am surprised it did not come with the MSDN help (I suppose it is possible (i.e the downgrade version of VC++ 6 did not include the older help), but, are you sure your friend gave you all the CD's?), but all that info is available free online anyway, at the MSDN site (it is just easier if it is installed locally). The MSDN subscription thing is different, it is not really about the help.

And yes, the SDK names are somewhat confusing, but that should be the right version.

Last edited by Russ; Dec 20, 2005 at 03:20 AM.
Russ is online now   Reply With Quote
Old Dec 20, 2005, 03:50 AM   #23
Tail Razer
 
Maddogg6's Avatar
 
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 0
Maddogg6 will become famous soon enoughMaddogg6 will become famous soon enough

Yes it Is 'Microsoft Visual C++ 2003 .NET' - and there must a disc missing - but he swears he never dont have it. Even tho there wasnt anything indicating a missing disc - just 1 disk and it installed - THEN finished and asked if I would like to install the MSDN help - I couldnt as I dont have the disc- but it still seems to run.. ??

- I looked (quite a bit too) at M$ and all I run into is buying a MSDN subscription for access or have archives sent on cd - Thats all Ive found anyway. No CHM or HLP files to D/L - Im not even sure what I would order if I even cared to do so. So Im thinking it is a 'student version'.
Maddogg6 is offline   Reply With Quote
Old Dec 20, 2005, 04:11 AM   #24
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

Mine came with like 7 CD's... Of course I do not remember what is on each CD. I think one is a system check type of disk which is used to update components, another is the VC++ installation (actually 2 disks, but one might just be extras, I do not remember). 3 are the MSDN library, and one is the latest service pack (at the time). It is possble that the NFR versions are like what you have.

One thing to note about the Help/MSDN library, it is not a tutorial, or the type of help you might be thinking it is. It is more of a language reference, ie. documentation of functions, etc. The same exact help is available online (for viewing online, i.e. not to download .CHM files, etc).

Look here (use Internet Explorer (and sync the toc), Firefox messes it up some times):
http://msdn.microsoft.com/library/de...lcmainnode.asp

<edit>
fixed above link to point to VC++ docs

Last edited by Russ; Dec 20, 2005 at 04:58 AM. Reason: typo
Russ is online now   Reply With Quote
Old Dec 20, 2005, 05:25 AM   #25
Tail Razer
 
Maddogg6's Avatar
 
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 0
Maddogg6 will become famous soon enoughMaddogg6 will become famous soon enough

Ahhh - it was FF I used and not seen the TOC there.

Yes - I understood the help was reference and not tutorial -

Thanks again...

I bet my friend threw them discs away not knowing what they were... the lunk-head
Maddogg6 is offline   Reply With Quote
Old Dec 21, 2005, 09:07 AM   #26
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

@Max;
Did you actualy managed to staticly link kxapi.dll
(or any other MSVC DLL that exports classes by __declspec(dllexport)
without extern "C" for that matter) in lets say, mingw/Dev-C++?

For anyone else interested in this kinda stuff, here's what I did as a test case;

1. Write and build a WIN32 Test.dll in MSVC;
Code:
 
/////////////////////////////////////////////////////////////////////////////////
// mydll.h -DLL declaration 
////////////////////////////////////////////////////////////////////////////////
#include <windows.h>
#ifdef LEMURY_EXPORTS
#define LEMURY_API __declspec(dllexport)
#else
#define LEMURY_API __declspec(dllimport)
#endif
 
class LEMURY_API CMyClass
{
public:
CMyClass();
~CMyClass(); 
int my_function(int value); 
};
 
/////////////////////////////////////////////////////////////////////////////////
// mydll.cpp -DLL implementation
////////////////////////////////////////////////////////////////////////////////
#define LEMURY_EXPORTS
#include "mydll.h"
// Had an entry point here, but doesn't make any diff.
CMyClass::CMyClass()
{
OutputDebugStringA(" Construct Yeah!");
};
CMyClass::~CMyClass()
{
OutputDebugStringA("Destruct Whoo!!");
};
int CMyClass::my_function(int value)
{
OutputDebugStringA("Function, duhh..!");
return value;
};
Now here's the problem;
We have MSVC Test.DLL and Test.LIB, but unfortunatly we can not simply link Test.LIB with MinGW (or any other compiler) because it is in Microsoft format and contains name mangled funtion names.
All tricks to get around this issue I've seen do basicly the same:

-Extract a .DEF export list from the third-party DLL or .LIB,
-edit it,
-build a new import library file from the edited .DEF file.

Here it goes;
2. produce a Test.DEF file from the Test.dll;
IMPDEF Test.def Test.dll
or,
PEXPORTS -o -h Test.h Test.dll>test.def
or,
DUMPBIN etc, etc,...

Output looks like this:
LIBRARY Test.dll
EXPORTS
??0CMyClass@@QAE@XZ @1
??1CMyClass@@QAE@XZ @2
??4CMyClass@@QAEAAV0@ABV0@@Z @3
?my_function@CMyClass@@QAEHH@Z @4

3. Edit the exports function names in the .DEF file by giving them aliases like;
_imp__myfunction = ?my_function@CMyClass@@QAEHH@Z @4
etc.

4. build the .a library file from the above .DEF file;
DLLTOOL -U -d Test.def -l libTest.a

Now link libTest.a as the import library for a simple testApp.exe in MinGW/Dev-C++;
Code:
 
///////////////////////////////////////////////////////////////////////
// DEV-C++ Test App that uses class from MSVC dll
///////////////////////////////////////////////////////////////////////
#include "mydll.h" // The above .dll header
#include <stdio.h>
//-----------------------------------------------------------------
int main()
{
CMyClass* p;
p = new CMyClass;
if(p)
{
printf("....p ok!\n");
p->my_function(2);
}
else printf("....p Error!\n");
printf("Press a Key to quit:..\n\n");
getchar();
if(p){delete p; p=0;}
return 0;
};
Well, I've tried all kinds of settings/tricks/tools/switches, but it still doesn't work.
It will link but the app can't find the Class function entry points.

Well we could always do dynamicly LoadLibrary() approach
which will bypass all this crap, but rather not.

Any thoughts anyone, or care to share some info Max?

BTW: I'm curious how many people realy are interested in using a free compiler for
writing their kX plugins?

/LeMury

Last edited by LeMury; Dec 28, 2005 at 07:11 PM.
Lex Nahumury is offline   Reply With Quote
Old Dec 21, 2005, 09:27 AM   #27
DH Senior Member
 
Join Date: Jan 2003
Location: The Netherlands
Posts: 1,932
Rep Power: 64
Lex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really niceLex Nahumury is just really nice

Forgot,

I've also tried Borland C++Builder applying all the Borland tips&tools regarding third party DLL usage.
Also no luck!

/LeMury

Last edited by LeMury; Dec 28, 2005 at 07:12 PM.
Lex Nahumury is offline   Reply With Quote
Old Dec 21, 2005, 06:14 PM   #28
Tail Razer
 
Maddogg6's Avatar
 
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 0
Maddogg6 will become famous soon enoughMaddogg6 will become famous soon enough

For me...
I would like to learn C++, but as I wrote above - its difficult to find 'interesting' examples that are well documented. Being a music type-o-guy - playing with C++ with KX is the 'interesting' aspect I desire - and code I looked at in KX API looks simple enough for me to figure out with out extensive commenting/docs. (THEN theres the DANE tho too.. :S)

Im still getting a grip on how the sound cards architecture is - which Im certain is necessary to program much of anything for it. So Im a ways off from anything really productive.

Now - I have to beleive that if theres a way to compile with freeware - would open the doors for some other 'non-pros' to dive in and maybe skin up some un-skinned plugins, if not develop new ones.

If I understand correctly - what your proposing is that - fucntion calls can be identified by making (some utility exists to do this I presume) a creating a new .DEF - I imagine the tool used does some sort of reverse engineering of a DLL when you dont have access to the source.

THEN aliases are assigned that are 'freeware compiler' friendly - thus (theoretically) possible to compile with a compliler compatable with these new aliases -
I imagine 1 alias file would be for MingW - and one for DevC++.

Am I following this correctly?

Does the KXAPI.DLL contain code thats protected by an NDS?

I guess I assumed CL provided a DLL directly as well as info on what functions are performed by that DLL, rather than supply source code.

Sorry Im not answering questions for you - but Im (maybe a little too much) the curious type and would like to understand these things better.

Im trying to decide which direction to go - M$VC++ and make some things easier...
Or use Open source and have more flexibility (like future proofing) but more complicated.

I would glady dump M$VC++2003.NET - as I only installed it thinking it would be easier to learn with. But - between limited KX API compatability, AND with M$VC++ docs 'ONLINE only' in my case makes it a bit more tedious and slow.

I also read complaints about .NET in some articles Ive been reading - but I do account for the 'old dogs and new tricks' potential motivation behind such comments.
I didnt uderstand the complaints, just sounds negitive enough to question and evaluate any alternatives.

Can other apps be developed also this way - not just plugins??
Maddogg6 is offline   Reply With Quote
Old Dec 22, 2005, 07:51 AM   #29
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,563
Rep Power: 62
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

Do not confuse the .NET comments that you see, with VC++ .NET. I think the negative comments you see, are most likely related to managed C++. VC++ 2003 .NET allows you to do both managed C++ and regular C++.

As far as the DEF file goes, different compilers decorate (name mangling) the function names a different way. The name decoration is just the way the compiler see's it itself. The DEF file just makes a name alias (not reverse engineering or anything). Also for regular .dll functions, etc, it is easy enough to make it not decorate the names. It is .dll claases and class functions that LeMury is talking about, and this is mainly an issue with linking to libs in one compiler, that were created by another compiler. (i.e. using a free compiler to link with kxapi.lib). BTW: MingW is the compiler, Dev C++ is just the IDE (i.e. a graphical front end).

Regarding opensource, that really has nothing to do with the compiler. It is not a VC++ vs free compiler topic. You can do opensource things in any compiler.
Russ is online now   Reply With Quote
Old Dec 22, 2005, 08:23 AM   #30
Tail Razer
 
Maddogg6's Avatar
 
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 0
Maddogg6 will become famous soon enoughMaddogg6 will become famous soon enough

Ok - I see I have WAY more reading up on the subject - so Ill shut up now.... :S

Thanks for the info...

But... just so Im clear - If I take (any win32) source code (assuming I have all libs linked to in the code - and code was meant for my OS), M$VC++2003.NET can compile without any code changes?

I Assumed (or thought I read) potentially significant changes to the code would need to be made to successfully compile.
Maddogg6 is offline   Reply With Quote
Reply

Thread Tools