Click here to Skip to main content
15,910,234 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionget and give data from my programe to another applications? Pin
medlteam8-Oct-04 7:06
medlteam8-Oct-04 7:06 
Generaldialog question Pin
m668-Oct-04 6:18
m668-Oct-04 6:18 
GeneralRe: dialog question Pin
Bob Stanneveld8-Oct-04 8:08
Bob Stanneveld8-Oct-04 8:08 
GeneralRe: dialog question Pin
m668-Oct-04 8:57
m668-Oct-04 8:57 
GeneralFirewire etc.... Pin
Tommy2k8-Oct-04 5:48
Tommy2k8-Oct-04 5:48 
QuestionPlace transparent gif or jpg on CButton? Pin
Fantmx8-Oct-04 4:42
Fantmx8-Oct-04 4:42 
AnswerRe: Place transparent gif or jpg on CButton? Pin
digwizfox8-Oct-04 7:28
digwizfox8-Oct-04 7:28 
GeneralRe: Place transparent gif or jpg on CButton? Pin
Fantmx8-Oct-04 17:14
Fantmx8-Oct-04 17:14 
Questionhow do i do a convertion from binary to xml using mfc? Pin
sv428-Oct-04 4:30
sv428-Oct-04 4:30 
AnswerRe: how do i do a convertion from binary to xml using mfc? Pin
Iain Clarke, Warrior Programmer8-Oct-04 5:13
Iain Clarke, Warrior Programmer8-Oct-04 5:13 
GeneralRe: how do i do a convertion from binary to xml using mfc? Pin
sv4212-Oct-04 4:01
sv4212-Oct-04 4:01 
GeneralMix VC++ and Delphi Pin
NMiceli8-Oct-04 3:50
NMiceli8-Oct-04 3:50 
GeneralRe: Mix VC++ and Delphi Pin
Bob Stanneveld8-Oct-04 8:18
Bob Stanneveld8-Oct-04 8:18 
Questionwhere can i find win98 source code ??? Pin
the_death8-Oct-04 3:35
the_death8-Oct-04 3:35 
AnswerRe: where can i find win98 source code ??? Pin
Wes Aday8-Oct-04 3:49
professionalWes Aday8-Oct-04 3:49 
AnswerRe: where can i find win98 source code ??? Pin
Robert A. T. Káldy8-Oct-04 3:58
Robert A. T. Káldy8-Oct-04 3:58 
AnswerRe: where can i find win98 source code ??? Pin
Ryan Binns8-Oct-04 4:35
Ryan Binns8-Oct-04 4:35 
AnswerRe: where can i find win98 source code ??? Pin
Ravi Bhavnani8-Oct-04 15:29
professionalRavi Bhavnani8-Oct-04 15:29 
QuestionHow to handle/manage dangling references of DLL Pin
prakash_bhurke8-Oct-04 3:08
prakash_bhurke8-Oct-04 3:08 
AnswerRe: How to handle/manage dangling references of DLL Pin
digwizfox8-Oct-04 7:32
digwizfox8-Oct-04 7:32 
GeneralRe: How to handle/manage dangling references of DLL Pin
prakash_bhurke8-Oct-04 18:52
prakash_bhurke8-Oct-04 18:52 
GeneralRe: How to handle/manage dangling references of DLL Pin
digwizfox12-Oct-04 6:56
digwizfox12-Oct-04 6:56 
The concept of what you are doing is fine. I'm a little perplexed. I can't find anything on "segmentation fault" in the MSDN library. Here are some tips in case you haven't thought to try this.

I assume dp_dll is a pointer to a data structure or object. I assume you are using visual studio to setup your projects and Dlls. We do something very similar in our application here at work. We have one main MFC application which contains the GUI and many DLLs that contain some other levels of functionality. one of our Dlls, we call CommonDll and this is where set setup any global pointers that need to be available to all. So common utility functions are exported, the same way you have done so. Of course there are other interface functions that allow other Dlls to get a copy of the pointer. If your app is multithreaded, don't forget to use a CriticalSection or mutex to prevent threads from getting the pointer while it is being initialized.

First, check your project properties. Ensure that C/C++ / Code Generation / Struct member alignment is the same for all of your projects. We ran into major run time problems with this.

What kind of DLL have you setup? We seem to be able to do what you are doing (initialize a global pointer with an exported func within a Dll), very easily with an MFC extension Dll. Regular Dlls are different and have some special requirements for setting up your functions. You're function appears to be setup for an extension Dll so hopefully that is how you have set up your Dll. If not, recreate the Dll project as an MFC extension dll. By default, my visual studio .net selects regular dll and then I have to specifically remember to change this while walking through the project creation wizard.

There is plenty of documentation on dlls within the MSDN library if you need more to read. Just search on regular dll or extension dll.

Hope some of that points you in the right direction.
GeneralStandBy Computer Pin
Rajesh_K_Sharma8-Oct-04 0:50
Rajesh_K_Sharma8-Oct-04 0:50 
GeneralRe: StandBy Computer Pin
Blake Miller8-Oct-04 5:03
Blake Miller8-Oct-04 5:03 
QuestionHow to handle Mouse movements on Status Area Icon that i created using Shell_NotifyIcon Pin
Seejoy Jose8-Oct-04 0:44
Seejoy Jose8-Oct-04 0:44 

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.