473,394 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

user arrays and VARIANT *

Hi all

I've got nearly 2 years experience programming in C and image
processing. Now I have to migrate one of my applications to a MFC
interface. I am having problems with the VARIANT variable. Let's see.

I have been using Matrox Imaging Lybrary (MIL). With this library, I
can load an image and pass this image into a C array using the function
MbufGet() and perform all my calculations using C.

If my image is 256 pixels wide and 192 pixels high, I need to create a
two dimensions array. If my image is 8 bits depth, I have to use an 8
bits variable, that is, I use unsigned char.

So I declare my array:

unsigned char myArray[192][256]

and I have my image loaded: myImageBuffer

So I use the function

MbufGet(myImageBuffer, myArray)

and just it, the value of each pixel is transferred to each element of
myArray.

Now I have to do exactly the same in my MFC interface. I have to use
now ActiveMIL instead of MIL. Now my imageBuffer is an object of the
class CImage1 with a method Get().

So I load my image from a file:

imageBuffer.Load("myfile.tif");

and when I use the Get() method, like:

imageBuffer.Get(myArray, ...)

I get errors like:

CImage1::Get : cannot convert parameter 1 from 'unsigned char
[192][256]' to 'VARIANT *'

I check the declaration of the Get() method and it looks like:

void Get(VARIANT * UserArray, ...

I have spent several days trying to get information about VARIANT but I
haven't got any clue, I still don't know how to transfer my image
from a buffer to an array.

Any hint? Any help of suggestion is welcomed.

Many thanks

Nov 30 '06 #1
1 2238
gilnux wrote:
I've got nearly 2 years experience programming in C and image
processing. Now I have to migrate one of my applications to a MFC
interface. I am having problems with the VARIANT variable. Let's see.
[snip]
Now I have to do exactly the same in my MFC interface. I have to use
now ActiveMIL instead of MIL. Now my imageBuffer is an object of the
class CImage1 with a method Get().

So I load my image from a file:

imageBuffer.Load("myfile.tif");

and when I use the Get() method, like:

imageBuffer.Get(myArray, ...)

I get errors like:

CImage1::Get : cannot convert parameter 1 from 'unsigned char
[192][256]' to 'VARIANT *'

I check the declaration of the Get() method and it looks like:

void Get(VARIANT * UserArray, ...

I have spent several days trying to get information about VARIANT but I
haven't got any clue, I still don't know how to transfer my image
from a buffer to an array.

Any hint? Any help of suggestion is welcomed.
Variants are a common need (Boost has one, too, for instance), but
specific third-party implementations like this are off-topic here. Try
in a Microsoft-specific group. A description of what is on-topic here
and a list of some other groups you might consider can be found here:

http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

Cheers! --M

Nov 30 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Wihlelm Bierbaum | last post by:
I'm trying to make use of a certain method of a COM object that takes a multidimensional array as its sole parameter. Here's an example of the construction of said array: $cA = array(); $cA =...
2
by: Jason | last post by:
I have a number of arrays that are populated with database values. I need to determine which array has the highest ubound out of all the arrays. The array size will always change based on the...
0
by: mb3242 | last post by:
Hello, I'm trying to use win32com to call a method in a COM object. I'm having a problem with Python choosing the wrong type when wrapping up lists into VARIANTs. The function I'm trying to call...
3
by: T | last post by:
Hi all. I have a problem I have not been able to find a reference about. I am using VB6 and am only a hobbyist programmer. I have 7 arrays of type MyData. Type MyData has 23 elements. Which...
14
by: deko | last post by:
Is there a way to check user input for illegal characters? For example, a user enters something into a text box and clicks OK. At that point I'd like to run code such as this: illegal =...
41
by: Mountain Bikn' Guy | last post by:
What is the current preferred way to save user preferences in dotnet? Is the registry the right place to do this? Can anyone recommend a good article (or book) for this topic? Thanks.
0
by: Andrew S. Giles | last post by:
Helo all, I have a standalone unmanaged C++ application that makes a call on another standalone COM server, which raises an event that should be handled in C#. I am trying to send: unsigned...
3
by: Mark | last post by:
Hi From what I understand, you can pass arrays from classic ASP to .NET using interop, but you have to change the type of the.NET parameter to object. This seems to be because classic ASP passes...
12
by: divya | last post by:
1. If The size of the array is unknown during programming time then how is such array declared?? Suppose there is an Array named arrClashname(size unknown at start), Now when the clash occurs...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.