473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Loading dynamic code into C++?

BCC
Hi,

Is there any way in c++ to load and execute code from a file,
integrating it into the original application?

I suppose this might be like dynamic classes, except that I would want
to be able to load in flow control statements, commands, variables, etc.

Thanks,
B
Jul 23 '05 #1
9 2218
[answering in comp.lang.c++]

BCC wrote:
Is there any way in c++ to load and execute code from a file,
integrating it into the original application?
No, not portably. However, if you are asking, you must have heard of it,
so there is probably a way on your platform. You need to ask in
a newsgroup for your OS or compiler.
I suppose this might be like dynamic classes, except that I would want
to be able to load in flow control statements, commands, variables, etc.


Are you talking about *interpreters*? Then there are those on the market.
Just google for them.

V
Jul 23 '05 #2
BCC
Victor Bazarov wrote:
I suppose this might be like dynamic classes, except that I would want
to be able to load in flow control statements, commands, variables, etc.

Are you talking about *interpreters*? Then there are those on the market.
Just google for them.

V


Hmm, possibly, if such an interpreter could be bundled into an existing
application. The goal would be for my app to interpret (so interpreter
sounds good) c++ code from a flat file and execute it.

Maybe there are some interpreters that can be loaded via static libs or
dlls? Ill take a look, thanks for the tip.

B
Jul 23 '05 #3
BCC
Victor Bazarov wrote:
I suppose this might be like dynamic classes, except that I would want
to be able to load in flow control statements, commands, variables, etc.

Are you talking about *interpreters*? Then there are those on the market.
Just google for them.

V


Hmm, possibly, if such an interpreter could be bundled into an existing
application. The goal would be for my app to interpret (so interpreter
sounds good) c++ code from a flat file and execute it.

Maybe there are some interpreters that can be loaded via static libs or
dlls? Ill take a look, thanks for the tip.

B
Jul 23 '05 #4
BCC
Victor Bazarov wrote:
I suppose this might be like dynamic classes, except that I would want
to be able to load in flow control statements, commands, variables, etc.

Are you talking about *interpreters*? Then there are those on the market.
Just google for them.

V


Hmm, possibly, if such an interpreter could be bundled into an existing
application. The goal would be for my app to interpret (so interpreter
sounds good) c++ code from a flat file and execute it.

Maybe there are some interpreters that can be loaded via static libs or
dlls? Ill take a look, thanks for the tip.

B
Jul 23 '05 #5
BCC
BCC wrote:
Victor Bazarov wrote:
I suppose this might be like dynamic classes, except that I would
want to be able to load in flow control statements, commands,
variables, etc.


Are you talking about *interpreters*? Then there are those on the
market.
Just google for them.

V

Hmm, possibly, if such an interpreter could be bundled into an existing
application. The goal would be for my app to interpret (so interpreter
sounds good) c++ code from a flat file and execute it.

Maybe there are some interpreters that can be loaded via static libs or
dlls? Ill take a look, thanks for the tip.

B


Lame. Sorry about the multi reply...
Jul 23 '05 #6
BCC wrote:
Hi,

Is there any way in c++ to load and execute code from a file,
integrating it into the original application?

I suppose this might be like dynamic classes, except that I would want
to be able to load in flow control statements, commands, variables, etc.

Are you asking about something like Windows dlls?

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #7
"BCC" <bc*@abcz.com> wrote in message
news:Dz******************@newssvr13.news.prodigy.c om...
BCC wrote:
Victor Bazarov wrote:

I suppose this might be like dynamic classes, except that I would want
to be able to load in flow control statements, commands, variables,
etc.

Are you talking about *interpreters*? Then there are those on the
market.
Just google for them.

V

Hmm, possibly, if such an interpreter could be bundled into an existing
application. The goal would be for my app to interpret (so interpreter
sounds good) c++ code from a flat file and execute it.

Maybe there are some interpreters that can be loaded via static libs or
dlls? Ill take a look, thanks for the tip.

B


Lame. Sorry about the multi reply...


I know this suggestion doesn't quite meet your stated requirements, but
Python can be embedded in a C++ program. Of course then you would be
interpreting Python rather than C++ but they are at least superficially
similar and Python was made to be interpreted.

--
Cy
http://home.rochester.rr.com/cyhome/
Jul 23 '05 #8
BCC wrote:
Victor Bazarov wrote:
I suppose this might be like dynamic classes, except that I would
want to be able to load in flow control statements, commands,
variables, etc.
Are you talking about *interpreters*? Then there are those on the
market.
Just google for them.

V

Hmm, possibly, if such an interpreter could be bundled into an existing
application. The goal would be for my app to interpret (so interpreter
sounds good) c++ code from a flat file and execute it.

Maybe there are some interpreters that can be loaded via static libs or
dlls? Ill take a look, thanks for the tip.


There is a C/C++ interperter Ch, it is embeddable. You can load C/C++
code/scripts dynamically.

You can check it at:

http://www.softintegration.com/support/faq/embed.html


B

Jul 23 '05 #9
BCC a écrit :
Hi,

Is there any way in c++ to load and execute code from a file,
integrating it into the original application?

I suppose this might be like dynamic classes, except that I would want
to be able to load in flow control statements, commands, variables, etc.

Thanks,
B


You need to make a dynamically loaded library (dl). Here is the link you
can browse in order to do the following :
http://www.faqs.org/docs/Linux-HOWTO...ary-HOWTO.html

--
Salutations,

Joachim Naulet

06 14 90 06 21
http://jnaulet.no-ip.com
Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Parag Joshi | last post by:
hi, I am facing a wierd problem with dyanamic class loading. I have a namespace called ETS.DAO which contains my Data Access Object classes. All these classes implement a common interface which...
9
by: Ender | last post by:
I have an application that I would like third party developers to be able to create Plug-ins that will be dynamically loaded into our application to extend functionality. I have utilized the...
0
by: Parag Joshi | last post by:
hi, I am facing a wierd problem with dyanamic class loading. I have a namespace called ETS.DAO which contains my Data Access Object classes. All these classes implement a common interface which...
1
by: Robert McLay | last post by:
I have been trying to build python on Cray X1. As far as I can tell it does not support dynamic loading. So the question is: How to build 2.4 without dynamic loading? That is: can I build...
20
by: Nickolai Leschov | last post by:
Hello all, I am programming an embedded controller that has a 'C' library for using its system functions (I/O, timers, all the specific devices). The supplied library has .LIB and .H files. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.