Visual Basic .NET 2003 Pointer help

kevin97531

New member
Joined
May 1, 2005
Messages
1
Programming Experience
1-3
I am trying to make a charting application in Visual Basic .NET 2003. I have software that allows me to make function calls to retrieve financial quotes. The problem is that I need to use pointers and I'm not sure how to do that in Visual Basic. The maker of the software provides structures to use for Delphi and C++ but not for Visual Basic. They also won't help unless I pay for tech support. Here is the description of the function that I need to use:


Delphi

function GetRealTimeData(Symbol: PChar; SymType: PChar; Expiry: PChar; Right: PChar; Strike: Double; Exchange: PChar; Currency: PChar; var RealTimeRec: PRealTimeRec): BOOL; stdcall external 'hocts.dll' name 'GETREALTIMEDATA';


C++


BOOL __stdcall GetRealTimeData(char* Symbol, char* SymType, char* Expiry, char* Right, double Strike, char* Exchange, char* Currency, LPREALTIMEREC* RealTimeRec);


Visual Basic

Public Declare Function GETREALTIMEDATA Lib "hocts.dll" (Symbol As String, SymType As String, Expiry As String, Right As String, ByVal Strike As Double, Exchange As String, ACurrency As String, RecArray As Long) As Boolean


Parameters
None

Return Values
If the function succeeds, the return value is nonzero.

RecArray
Pointer to array of the specified structures


Delphi Structure:
PRealTimeRec = ^TRealTimeRec;
TRealTimeRec = packed record
SymIdent: array[0..CSL_MAX_SYMBOL_LEN] of Char;
SymExchange: array[0..CSL_MAX_EXCHANGE_LEN] of Char;
SymSecType: array[0..CSL_MAX_SEC_TYPE_LEN] of Char;
SymExpiry: array[0..CSL_MAX_EXPIRY_LEN] of Char;
SymRight: array[0..CSL_MAX_RIGHT_LEN] of Char;
SymCurrency: array[0..CSL_MAX_CURRENCY_LEN] of Char;

Bid: Double;
Ask: Double;
Last: double;
DateTime: TSystemTime;
Volume: Double;
end;




C++ Structure:





typedef struct _REALTIMEREC {


char SymIdent[20];
char SymExchange[15];
char SymSecType[20];
char SymExpiry[30];
char SymRight[30];
char SymCurrency[20];
double Bid;
double Ask;
double Last;
SYSTEMTIME DateTime;
double Volume;
} REALTIMEREC, *LPREALTIMEREC;
;















I'm not sure how to make a pointer to a structure in Visual Basic. All I want to do is retrieve the Bid price. Does anyone know how I could go about doing this?

Thanks,
Kevin
 
Last edited:
Top Bottom