Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Using MFC with Dark SDK

Author
Message
Gyoergy
18
Years of Service
User Offline
Joined: 29th Nov 2005
Location: Syntax E33o3
Posted: 29th Nov 2005 22:23
Hi, I am fairly new to the SDK development. How can I use/link MFC classes (Microsoft Foundation Classes) like CObArray, CObList, CString and so on with the Dark SDK? If I try to include "afxwin.h" header I get unresolved linker errors:

nafxcw.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcw.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex

I was using the search forum function with no success...

I think there is some linker conflict going on, but how to get rid off it? is it possible to use MFC with the Dark SDK??

many many thanks,
George
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 29th Nov 2005 22:52
Dont think you can use MFC directly - Mike was going to make a post showing how it can be done, but he hasn't got around to it yet.

Paisleys finest
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: In a house
Posted: 3rd Jan 2006 00:31
Mike says in another thread that he compiled the Dark SDK using the single threaded, static mode.

Maybe that is why you are getting errors with thread library functions.

Try changing your link options to suit and see if that works.

Scott Tunstall
Author of the UNIFIED ZOMBIE MOD (www.unifiedzombiemod.wz.cz)
Current work in progress: Retro Remake of BRUCE LEE, by Datasoft (1984)
Paisleys finest
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: In a house
Posted: 3rd Jan 2006 15:24
Just tried it there. My advice to anyone is:

DON'T!!!

I tried:
* using the single-threaded debug DLL;
* ignoring certain libraries (why MFC has a dependency on ATL is beyond me);

It's just a complete mess!!!

I'm going to try to see if Windows Template Library (a lightweight set of Windows classes for dialogs, controls etc) can compile with it... doubt it.

Here's a list of errors I get:



Scott Tunstall
Author of the UNIFIED ZOMBIE MOD (www.unifiedzombiemod.wz.cz)
Current work in progress: Retro Remake of BRUCE LEE, by Datasoft (1984)
Paisleys finest
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: In a house
Posted: 3rd Jan 2006 15:31
Having said that, why bother using MFC anyway

I already had this argument with rabid stoat , or whatever he calls himself.. but the standard template library will do all you have specified:

e.g. instead of using CObList, CArray, CString and so on, use the dequeue, map and string objects instead. They use far less memory than their MFC equivalents and are as easy to use....

Scott Tunstall
Author of the UNIFIED ZOMBIE MOD (www.unifiedzombiemod.wz.cz)
Current work in progress: Retro Remake of BRUCE LEE, by Datasoft (1984)
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 3rd Jan 2006 15:51 Edited at: 3rd Jan 2006 15:57
Unfortunately not using MFC means your going to have to use Windows message functions for dealing with Listboxes, Edit Boxes, Combo Boxes etc etc - theres more to MFC than CString you know!

It doesn't stop you using seperate MFC windows - as long as the project is defined as a standard Windows one, all others can be MFC'ed (and should work fine) - my AtomZ game, does, if I remember correctly, use a MFC configuration window.

Paisleys finest
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: In a house
Posted: 3rd Jan 2006 16:01
I'm interested in how you got it to compile, Stoat.

I was using an .EXE MFC application, not a DLL, and got the aforementioned errors.

Mind you, I was compiling with VS.NET 2003 - did you use VC++ 6?

What build options did you use?

Scott Tunstall
Author of the UNIFIED ZOMBIE MOD (www.unifiedzombiemod.wz.cz)
Current work in progress: Retro Remake of BRUCE LEE, by Datasoft (1984)
Paisleys finest
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: In a house
Posted: 3rd Jan 2006 16:02
No need to ask - downloading it from your site

Scott Tunstall
Author of the UNIFIED ZOMBIE MOD (www.unifiedzombiemod.wz.cz)
Current work in progress: Retro Remake of BRUCE LEE, by Datasoft (1984)
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 3rd Jan 2006 16:11 Edited at: 3rd Jan 2006 16:13
I used VS 2003. It appears that AtomZ didn't use a MFC window unfortunately - however, my speech plug-in did use MFC to retain the list of voices.

As MFC classes cant be added to a non-MFC project, messages will have to be sent everywhere... Fun!

Paisleys finest
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: In a house
Posted: 3rd Jan 2006 16:21
Well, it doesn't compile - it's missing Title.cpp and GetDXVersion.cpp, but I see you have an extern int doTitle(void) declaration there, so you are referencing an MFC lib you made earlier, in true Blue Peter fashion , and accessing the components of the dialog resource the lib displays via their HWNDs.

Scott Tunstall
Author of the UNIFIED ZOMBIE MOD (www.unifiedzombiemod.wz.cz)
Current work in progress: Retro Remake of BRUCE LEE, by Datasoft (1984)
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 3rd Jan 2006 16:23
Have to see if I can update the AtomZ file later on - assuming I've still got it all...

Paisleys finest
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: In a house
Posted: 3rd Jan 2006 16:26
Or not referencing an MFC Lib, even, lol

Hmm..

Scott Tunstall
Author of the UNIFIED ZOMBIE MOD (www.unifiedzombiemod.wz.cz)
Current work in progress: Retro Remake of BRUCE LEE, by Datasoft (1984)
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 3rd Jan 2006 16:36
Thought I had used MFC with DarkSDK, but obviously not...

Mike Johnson
TGC Developer
22
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 3rd Jan 2006 20:09
The only way you can currently use MFC and the Dark Game SDK together is by having 2 separate applications with the host in MFC and the Dark Game SDK attaching itself to a child window of the host.

I have an example that I emailed out to a few people. Will find it and post on here.
Smithy
19
Years of Service
User Offline
Joined: 8th Dec 2004
Location: Switzerland
Posted: 12th Jan 2006 13:35
*bump*

Dear Mike, ehr.. Mr. Johnson,...
Is there any chance for the example to get posted?

A big "thank you in advance",
Smithy (and some others I assume heh)

//Awards: Best DM at NeverwinterConventionIII (NWCon3)
//Sys: Pentium IV 3200E/Prescott;800Mhz FSB;HT;WinXPPro;ATIR9700PRO;1024MB RAM(2x512MB"DualChanneled";VC++7.net;Delphi6;ADSL512;

Login to post a reply

Server time is: 2024-11-19 04:35:05
Your offset time is: 2024-11-19 04:35:05