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

  • Home
  • SEARCH
  • 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 7914001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:58:38+00:00 2026-06-03T13:58:38+00:00

I have function getMemory() which returns VARIANT (mfc). It is said that in ulVal

  • 0

I have function getMemory() which returns VARIANT (mfc).
It is said that in ulVal member is pointer to memory i need to access.

int m_memAddr = object.getMemory().ulVal; //get pointer to memory

Then I need to have this pointer into char*
I’ve tried

char* pointer = (char*)m_memAddr;

It compile but I get error when program running.
How to debug it?

Function getMemory:

VARIANT object::getMemory()
{
    VARIANT result;
    InvokeHelper(0x4a, DISPATCH_METHOD, VT_VARIANT, (void*)&result, NULL);
    return result;
}

//edited from documentation of camera lib i use:

VARIANT GetImageMem()
Description

GetImageMem() returns the pointer to the starting adress of the internal image memory where the image is stored. If you use ring buffering, GetImageMem() returns the starting address of the image memory last used for image capturing.

The pointer to the image memory is returned in the element ulVal of the VARIANT data type.
Parameters

Return values

Pointer to the image memory in ulVal of the VARIANT data type.

This is description of functions which returns memory where my camera store image.

I want to process this image with OpenCV so i need char* to set it as IplImage imageData.

Now I hope it’s more clear what is the problem.

  • 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. Editorial Team
    Editorial Team
    2026-06-03T13:58:39+00:00Added an answer on June 3, 2026 at 1:58 pm

    From the documentation

    pbParamInfo – Pointer to a null-terminated string of bytes specifying the types of the parameters following pbParamInfo.

    … – Variable list of parameters, of types specified in pbParamInfo.

    You are passing NULL for pbParamInfo, which I assume means that no data will be stored in the returned variant, so of course the pointer is invalid.

    If you follow the documentation further, you find that passing VTS_BSTR specifies that you can initialize the variant with a pointer-to-char (pass that as the next argument after pbParamInfo).

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

Sidebar

Related Questions

I have function that have been colled in stored procedure. The function returns a
I have function that returns the index of a character GetCharFromPos(Pt: TPoint): Integer; now
I have function which return NSArray, but it's generating memory leak, since i can't
I have function getCartItems in cart.js and I want to call that function in
I have function Start() that is fired on ready. When I click on .ExampleClick
I have function some_func_1 which will create an object of type some_type and will
So I have function that formats a date to coerce to given enum DateType{CURRENT,
i have function which return list as given below. List<User> lstUsers = SearchUsers(searchText); which
i have function, which has to accept two types of data - Observable collection
I have function which takes in an parameter of a class called Triple, and

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.