HOME FORUMS BROKERS SOFTWARE BOOKS CONTACT US
Elite Trader Your Account  •  Become a Member  •  Help  •  Search    
    Forums ›› Technically Speaking ›› Programming ›› C++ use in Excel - best option?  


Post A Reply
    Page 1 of 2:   1  2  
bluematrix
 

Registered: Jan 2012
Posts: 114

 

07-15-12 12:44 AM

Hi

I want some expert/experienced advice on the best approach/method of using C++ code in Excel. For example building some pricing models in C++ and using them in Excel.

I know there are various ways so I want your opinion.

It seems there are lot of pages on using COM. but I personally think COM is OLD, and UGLY! am I wrong? or is it really still the best option?

I know of Excel-DNA and it really is perfect for use with C#, but there really is no similar option for C++ - although I've seen some commercial options, for example:

1 http://www.stochastix.com/solutions...latest/features
2. http://www.planatechsolutions.com/xllplus/default.htm


Really appreciate your toughts.

thanks

    Edit/Delete Quote Complain
sma202
 

Registered: Jun 2010
Posts: 41

 

07-15-12 01:21 AM


Quote from bluematrix:

Hi

I want some expert/experienced advice on the best approach/method of using C++ code in Excel. For example building some pricing models in C++ and using them in Excel.

I know there are various ways so I want your opinion.

It seems there are lot of pages on using COM. but I personally think COM is OLD, and UGLY! am I wrong? or is it really still the best option?

I know of Excel-DNA and it really is perfect for use with C#, but there really is no similar option for C++ - although I've seen some commercial options, for example:

1 http://www.stochastix.com/solutions...latest/features
2. http://www.planatechsolutions.com/xllplus/default.htm


Really appreciate your toughts.

thanks



write a dll and call it in vba using the win32 api.

    Edit/Delete Quote Complain
clearinghouse
 

Registered: Aug 2010
Posts: 572

 

07-15-12 01:25 AM


Quote from bluematrix:

Hi

I want some expert/experienced advice on the best approach/method of using C++ code in Excel. For example building some pricing models in C++ and using them in Excel.

I know there are various ways so I want your opinion.

It seems there are lot of pages on using COM. but I personally think COM is OLD, and UGLY! am I wrong? or is it really still the best option?

I know of Excel-DNA and it really is perfect for use with C#, but there really is no similar option for C++ - although I've seen some commercial options, for example:

1 http://www.stochastix.com/solutions...latest/features
2. http://www.planatechsolutions.com/xllplus/default.htm


Really appreciate your toughts.

thanks



Use C++/CLI, and recompile your libraries in that, then connect to whatever .NET bindings that Excel-DNA thing is supporting. And if that's not possible, create an assembly with C++/CLI, wrap it in a C# interface and then connect /that/ to Excel-DNA.

    Edit/Delete Quote Complain
bluematrix
 

Registered: Jan 2012
Posts: 114

 

07-15-12 01:29 AM

ok - saw I have two different options offered already - but which is better?

also have you actually experience doing this? are there any limitations using a dll or going through c# excel-dna? can you use objects exactly the same way etc?

ALSO - what if you have lot of code in non-CLI that might be difficult to recompile..

thanks

    Edit/Delete Quote Complain
clearinghouse
 

Registered: Aug 2010
Posts: 572

 

07-15-12 01:39 AM


Quote from bluematrix:

ok - saw I have two different options offered already - but which is better?

also have you actually experience doing this? are there any limitations using a dll or going through c# excel-dna? can you use objects exactly the same way etc?

ALSO - what if you have lot of code in non-CLI that might be difficult to recompile..

thanks



I've never had any difficulties recompiling native code in C++/CLI, and C++/CLI seems to link in native libraries and automatically generate the wrapper/transition code to get information out of the native libraries properly.

I use C++/CLI quite a bit, mostly because using COM libraries or various broker interfaces and changing from broker to broker on all the various prop front-ends always involves some random new hodge-podge of Windows-related technology. C++/CLI is somewhat of a god-send because it serves as a sort of glue for connecting old/native code with systems that use .NET.

The added benefit is that you can still write solid, re-usable C++, and not feel bound to .NET forever.

I can't comment on Excel-DNA; I've never used it. I was just proposing an alternative if you didn't want to be forced into C#.

    Edit/Delete Quote Complain
sma202
 

Registered: Jun 2010
Posts: 41

 

07-15-12 01:47 AM


Quote from bluematrix:

ok - saw I have two different options offered already - but which is better?

also have you actually experience doing this? are there any limitations using a dll or going through c# excel-dna? can you use objects exactly the same way etc?

ALSO - what if you have lot of code in non-CLI that might be difficult to recompile..

thanks



if you have c++ dlls already, making a call via win32 is straightforward and would be the fastest way.

If you want to abstract things in a pretty manner and don't mind learning cli...go with that route.

    Edit/Delete Quote Complain
    Page 1 of 2:   1  2  
Post A Reply


Receive an email whenever a new post is added to this thread by subscribing to it.
 
Rate This Thread:

Forum Jump:
 

 

   Conduct Rules  -  Privacy Policy  -  Day Trader -  Day Trader Forum -  Best Trading Software -  Sitemap Copyright © 2013, Elite Trader. All rights reserved.    
 
WHILE YOU'RE HERE, TAKE A MINUTE TO VISIT SOME OF OUR SPONSORS:
Advantage Futures
Futures Brokerage & Clearing
AMP Global Clearing
Futures and FX Trading
Bright Trading
Professional Equities Trading
CTS
Futures Trading Software
DaytradingBias.com
Professional Trading Analytics
ECHOtrade
Professional Trading Firm
eSignal
Trading Software Provider
FXCM
Forex Trading Services
Global Futures
Futures, Options & FX Trading
Interactive Brokers
Pro Gateway to World Markets
JC Trading Group
Direct Access Trading
MB Trading
Direct Access Trading
MultiCharts
Trading Software Provider
NinjaTrader
Trading Software Provider
OANDA
Currency Trading
optionshouse
Option Trading & Education
Rithmic
Futures Trade Execution Platform
SpeedTrader
Direct Access Trading
SpreadProfessor
Spread Trading Instruction
thinkorswim by TD Ameritrade
Direct Access TradingAdvertisement
TradersStudio
System Building & Backtesting
Trading Technologies
Trading Software Provider
Trend Following
Trading Systems Provider