G
Guest
I need to make the VB.NET object callable from a program called Trade Station. It is a stock analysis and trading tool that is very importiant to my company. They have a scripting languge called easy language that is built into the system. It is supposed to be capable of extending itself by calling external DLLs. It is very picky about what DLLs it will see though
Others have had success using C++ to write a DLL that will work with Easy Language, but I am hitting a brick wall with VB. I am not a strong C++ programmer, but I am very good at VB. I am hoping to find a way to make interop expose my VB DLL in the same way that the C++ DLL is exposed. Here is a snippet of code that is from a working C++ DLL. I hope it is meaningful. I am not sure :-(
-----------stdafx.h----------
// stdafx.h : include file for standard system include files
// or project specific include files that are used frequently, bu
// are changed infrequentl
/
#pragma onc
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows header
// Windows Header Files
#include <windows.h
// TODO: reference additional headers your program requires her
#define dll_entry( type ) extern"C" type __stdcal
-----------a.cpp----------
// a.cpp : Defines the entry point for the DLL application
/
#include "stdafx.h
#import "c:\Program Files\TradeStation\Program\TSKit.dll" no_namespac
#import "D:\documents\projects\TradeStationInterop\CSharp\bin\Release\CSharp.tlb
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserve
return TRUE
double __stdcall MyTest(IEasyLanguageObject *pEL, int iNBars
CSharp::_Class1 *com_ptr
CoInitialize(NULL)
CSharp::_Class1Ptr p(__uuidof(CSharp::Class1))
com_ptr = p
double d = com_ptr->TestDouble()
return d
-----------stdafx.cpp----------
// stdafx.cpp : source file that includes just the standard include
// a.pch will be the pre-compiled heade
// stdafx.obj will contain the pre-compiled type informatio
#include "stdafx.h
-----------a.def----------
LIBRARY
EXPORT
MyTes
Others have had success using C++ to write a DLL that will work with Easy Language, but I am hitting a brick wall with VB. I am not a strong C++ programmer, but I am very good at VB. I am hoping to find a way to make interop expose my VB DLL in the same way that the C++ DLL is exposed. Here is a snippet of code that is from a working C++ DLL. I hope it is meaningful. I am not sure :-(
-----------stdafx.h----------
// stdafx.h : include file for standard system include files
// or project specific include files that are used frequently, bu
// are changed infrequentl
/
#pragma onc
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows header
// Windows Header Files
#include <windows.h
// TODO: reference additional headers your program requires her
#define dll_entry( type ) extern"C" type __stdcal
-----------a.cpp----------
// a.cpp : Defines the entry point for the DLL application
/
#include "stdafx.h
#import "c:\Program Files\TradeStation\Program\TSKit.dll" no_namespac
#import "D:\documents\projects\TradeStationInterop\CSharp\bin\Release\CSharp.tlb
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserve
return TRUE
double __stdcall MyTest(IEasyLanguageObject *pEL, int iNBars
CSharp::_Class1 *com_ptr
CoInitialize(NULL)
CSharp::_Class1Ptr p(__uuidof(CSharp::Class1))
com_ptr = p
double d = com_ptr->TestDouble()
return d
-----------stdafx.cpp----------
// stdafx.cpp : source file that includes just the standard include
// a.pch will be the pre-compiled heade
// stdafx.obj will contain the pre-compiled type informatio
#include "stdafx.h
-----------a.def----------
LIBRARY
EXPORT
MyTes