Click here to Skip to main content
15,921,841 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: interesting question about new and nothrow new Pin
Maxwell Chen28-Jan-08 16:51
Maxwell Chen28-Jan-08 16:51 
GeneralRe: interesting question about new and nothrow new Pin
George_George28-Jan-08 19:21
George_George28-Jan-08 19:21 
GeneralRe: interesting question about new and nothrow new Pin
David Crow29-Jan-08 2:50
David Crow29-Jan-08 2:50 
GeneralRe: interesting question about new and nothrow new Pin
George_George29-Jan-08 13:46
George_George29-Jan-08 13:46 
Generalhelp Pin
gentleguy28-Jan-08 15:57
gentleguy28-Jan-08 15:57 
GeneralRe: help Pin
David Crow28-Jan-08 16:21
David Crow28-Jan-08 16:21 
GeneralRe: help Pin
gentleguy28-Jan-08 20:30
gentleguy28-Jan-08 20:30 
GeneralRe: help Pin
CPallini28-Jan-08 21:47
mveCPallini28-Jan-08 21:47 
QuestionRe: help Pin
David Crow29-Jan-08 2:44
David Crow29-Jan-08 2:44 
GeneralRe: help Pin
KarstenK29-Jan-08 3:06
mveKarstenK29-Jan-08 3:06 
Generalgetchar() help Pin
gentleguy28-Jan-08 15:04
gentleguy28-Jan-08 15:04 
QuestionRe: getchar() help Pin
David Crow28-Jan-08 15:56
David Crow28-Jan-08 15:56 
GeneralGetForegroundWindow() Pin
dellthinker28-Jan-08 8:12
dellthinker28-Jan-08 8:12 
GeneralRe: GetForegroundWindow() Pin
David Crow28-Jan-08 8:20
David Crow28-Jan-08 8:20 
GeneralRe: GetForegroundWindow() Pin
dellthinker28-Jan-08 13:20
dellthinker28-Jan-08 13:20 
GeneralRe: GetForegroundWindow() Pin
Mark Salsbery28-Jan-08 13:47
Mark Salsbery28-Jan-08 13:47 
GeneralRe: GetForegroundWindow() Pin
dellthinker28-Jan-08 14:48
dellthinker28-Jan-08 14:48 
AnswerRe: GetForegroundWindow() Pin
fd012900228-Jan-08 13:51
fd012900228-Jan-08 13:51 
Generaltest Pin
Member 462175228-Jan-08 7:44
Member 462175228-Jan-08 7:44 
GeneralRe: test Pin
CPallini28-Jan-08 7:56
mveCPallini28-Jan-08 7:56 
GeneralRe: test Pin
Hamid_RT28-Jan-08 19:16
Hamid_RT28-Jan-08 19:16 
GeneralGDI+ NOISE problem Pin
followait28-Jan-08 5:32
followait28-Jan-08 5:32 
GeneralRe: GDI+ NOISE problem Pin
Iain Clarke, Warrior Programmer28-Jan-08 5:34
Iain Clarke, Warrior Programmer28-Jan-08 5:34 
GeneralRe: GDI+ NOISE problem Pin
followait28-Jan-08 5:46
followait28-Jan-08 5:46 
GeneralQuestion regarding exported C++ symbols/objects Pin
Lea Hayes28-Jan-08 4:24
Lea Hayes28-Jan-08 4:24 
Hi all!

I am working on a application which is performance intensive. The bulk of the application is spread across several shared DLL modules for reusability. I have used C++ for the benefits of OOP, and the system is functioning well.

I am designing a scripting system to facilitate future expansion with cross-platform support. I have a basic scripting engine working. Scripts are able to link to and call C-style functions from dll modules. I am finding the need to use class within the scripting system, and have found several ways for which I can have a script link to a DLL module and use classes.

The key two constraints here are:
- performance, there are many small methods which will be called upon extremely frequently and so it is very important to minimize overhead here at all other costs.
- Cross-platform compatability at build time only, scripts will be cross-platform compatible already.


Idea #1 - Allocate and release objects from within the DLL using exported C functions. Add additional exported C functions for each class method, and convert all class methods into simple inline wrappers.
Problem: This may cause double function calls when interacting with class objects

Idea #2 - Somehow devise an approach which can link to exported C++ functions where the 'this' value could somehow be provided.
Problem: It is very important that this is compatible with other compilers, unfortunately (as far as I can tell) there is no standard for this.

Link functionality could be specialised for each platform (i.e. Windows, UNIX) simply by using seperate implementation files. Sadly, the same cannot be said for different compilers as there are many different compilers, and there is no way that I could support all of them.


It would be great to hear your ideas and experiences with similar situations. Is there a better way which I haven't yet found?

Many thanks!
Lea Hayes

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.