Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 115289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:59:44+00:00 2026-05-11T02:59:44+00:00

I’m trying to access an OleVariant in a callback that is coming from an

  • 0

I’m trying to access an OleVariant in a callback that is coming from an ActiveX library.

Here’s what the event handler is defined as in the TLB:

procedure(ASender: TObject; var structQSnap: {??structVTIQSnap}OleVariant) of object; 

Here’s the definition of structVTIQSnap in the TLB:

structVTIQSnap = packed record   bstrSymbol: WideString;   bstrListingExch: WideString;   bstrLastExch: WideString;   fLastPrice: Double;   nLastSize: Integer;   bstrBbo: WideString;   bstrBidExch: WideString;   fBidPrice: Double;   nBidSize: Integer;   bstrAskExch: WideString;   fAskPrice: Double;   nAskSize: Integer;   fHighPrice: Double;   fLowPrice: Double;   fOpenPrice: Double;   fClosePrice: Double;   nCumVolume: Integer;   bstrTradeCondition: WideString;   nQuoteCondition: Integer;   bstrCompanyName: WideString;   f52WeekHigh: Double;   f52WeekLow: Double;   fEps: Double;   nSharesOutstanding: Integer;   nSpCode: Integer;   fBeta: Double;   bstrExDivDate: WideString;   nDivFreq: Integer;   fDivAmt: Double;   nAvgVolume: Integer;   bstrCusip: WideString;   fVwap: Double;   bstrUpdateTime: WideString;   bstrExch: WideString;   nSharesPerContract: Integer; end; 

It compiles fine, but everytime I try to access the bstrSymbol, I get an ‘Invalid Variant Operation’:

 procedure TForm1.HandleVTIQuoteSnap(ASender: TObject; var structQSnap: OleVariant);  var     symbol: WideString;  begin     symbol := structQSnap.bstrSymbol; // this line causes the exception  end; 

How do I access structQSnap and its properties in Delphi?

In C#, this function works fine for the event handler:

    void vtiQ_OnVTIQSnap(ref vtiLib.structVTIQSnap structQSnap)     {         MessageBox.Show('Got qsnap for ' + structQuoteSnap.bstrSymbol);                 } 

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T02:59:45+00:00Added an answer on May 11, 2026 at 2:59 am

    I think that Delphi’s ActiveX import wizard doesn’t know how to handle the structVTIQSnap type (which seems to be a record) properly and just uses the default OleVariant. Is there a type declaration named structVTIQSnap or similar in the generated …_TLB.pas file? Try using that instead of OleVariant, e.g.

    procedure (ASender: TObject; var structQSnap: structVTIQSnap) of object; 

    The type will probably be declared as a ‘packed record’.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.