Click here to Skip to main content
15,900,906 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDoubles change behavior in CreateThread process, why? Pin
TragicComic3-Oct-07 15:13
TragicComic3-Oct-07 15:13 
AnswerRe: Doubles change behavior in CreateThread process, why? Pin
TragicComic3-Oct-07 15:32
TragicComic3-Oct-07 15:32 
GeneralRe: Doubles change behavior in CreateThread process, why? Pin
DQNOK4-Oct-07 4:26
professionalDQNOK4-Oct-07 4:26 
Questionretrieve email password on local host? Pin
Gofur Halmurat3-Oct-07 12:36
Gofur Halmurat3-Oct-07 12:36 
AnswerRe: retrieve email password on local host? Pin
Mark Salsbery3-Oct-07 13:03
Mark Salsbery3-Oct-07 13:03 
AnswerRe: retrieve email password on local host? Pin
Stephen Hewitt3-Oct-07 14:44
Stephen Hewitt3-Oct-07 14:44 
AnswerRe: retrieve email password on local host? Pin
Maximilien3-Oct-07 15:37
Maximilien3-Oct-07 15:37 
QuestionLinking to MFC in a non-MFC dll [modified] Pin
Leslie Sanford3-Oct-07 9:45
Leslie Sanford3-Oct-07 9:45 
I'm not sure if the thread title is really accurate, but it's the best description I can think of.

I'm in the process of creating the GUI part of a software synthesizer (VST). The synthesizer will reside in a dll. An application called the host will load the dll and run the synthesizer. I've chosen MFC for putting together the GUI elements for the synthesizer. My approach has been to test out the GUI elements in an MFC dialog based application. I've reached a point where I now I have most of the GUI work done, and I've been attempting to integrate it with the syth engine. This has meant basically copying relevant MFC files over to my synth dll project. I've made sure that I've set up the project so that it links to MFC in a shared library.

The idea is that when the host asks me for an synth editor, I pass it a class encapsulating an MFC dialog. The dialog displays all of the synth controls.

So for so good, but I've run into a problem in that I get this compile error:

Linking...
mfcs42d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in vstplugmain.obj


There's a conflict between the main function that is implemented in vstplugmain.cpp and the main function implemented some where in the bowels of the MFC library. I've been googling like crazy, but have not found a solution to resolve the conflict.

vstplugmain.cpp is the file that exports the main function. It's the function that the host interacts with when it loads the dll.

Is there something fundamentally wrong with this approach in that I won't be able to use MFC in a dll that exports its own main function?

[EDIT]
Hmm, the error goes away when I statically link to MFC.
[/EDIT]


-- modified at 16:30 Wednesday 3rd October, 2007
AnswerRe: Linking to MFC in a non-MFC dll Pin
Nathan Holt at EMOM3-Oct-07 10:49
Nathan Holt at EMOM3-Oct-07 10:49 
AnswerRe: Linking to MFC in a non-MFC dll Pin
Mark Salsbery3-Oct-07 11:31
Mark Salsbery3-Oct-07 11:31 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Leslie Sanford3-Oct-07 13:59
Leslie Sanford3-Oct-07 13:59 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Mark Salsbery4-Oct-07 5:40
Mark Salsbery4-Oct-07 5:40 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Leslie Sanford4-Oct-07 6:25
Leslie Sanford4-Oct-07 6:25 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Mark Salsbery4-Oct-07 6:43
Mark Salsbery4-Oct-07 6:43 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Leslie Sanford4-Oct-07 6:56
Leslie Sanford4-Oct-07 6:56 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Mark Salsbery4-Oct-07 7:11
Mark Salsbery4-Oct-07 7:11 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Leslie Sanford4-Oct-07 7:48
Leslie Sanford4-Oct-07 7:48 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Mark Salsbery4-Oct-07 7:54
Mark Salsbery4-Oct-07 7:54 
GeneralRe: Linking to MFC in a non-MFC dll Pin
Mark Salsbery4-Oct-07 6:48
Mark Salsbery4-Oct-07 6:48 
QuestionJump from one Dialog to other in a Dialog MFC application Pin
TomWizard3-Oct-07 7:59
TomWizard3-Oct-07 7:59 
AnswerRe: Jump from one Dialog to other in a Dialog MFC application Pin
Maximilien3-Oct-07 9:13
Maximilien3-Oct-07 9:13 
Questiontokenizer help Pin
dellthinker3-Oct-07 7:14
dellthinker3-Oct-07 7:14 
AnswerRe: tokenizer help Pin
Nemanja Trifunovic3-Oct-07 7:44
Nemanja Trifunovic3-Oct-07 7:44 
GeneralRe: tokenizer help Pin
dellthinker3-Oct-07 9:37
dellthinker3-Oct-07 9:37 
AnswerRe: tokenizer help Pin
Stephen Hewitt3-Oct-07 14:23
Stephen Hewitt3-Oct-07 14:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.