Solved

ActiveX control passing structure/object

Posted on 2002-04-25
15
394 Views
Last Modified: 2013-11-20
Hi,

I've written an activeX control which basically draws a grid, each cell within the grid has about 20 properties, i.e. borderwidth/textsize/colour etc...

At the moment I have each property as a property of the control, and whatever is changed applies to the currently selected cell.

I use this control in VB.

What I want to do is either one of the following...

Create a 'type' in VB and pass it in as a paramemer along with the x and y coordinates of the cell, this will then be received in c++ as a struct, and I can update the properties of the appropriate cell.

or

Create an additional class in the activex control, which is called 'cell' or something. And pass this object between the calling application and the control. (just like the way a treeview does with nodes, or a listview does with listitems)

I've tried doing both of these, but with no luck. Can someone give me some pointers please.
0
Comment
Question by:smegghead
  • 7
  • 4
  • 3
  • +1
15 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 6969032
Check

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q154172 ("How To Pass Binary Data Between an ActiveX Control and VB (Q154172)")

and

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q122289 ("Passing Structures in OLE Automation (Q122289)")

The latter one comes with a sample that is pretty close to what you want to do...
0
 
LVL 10

Author Comment

by:smegghead
ID: 6969056
Thanks for the links... that is one solution, but I really want this control to be very user friendly, and I prefer the option of using a separate class/object to pass the details back and forth.
0
 
LVL 10

Author Comment

by:smegghead
ID: 6970792
I had previsouly written this control in VB and it was a simple as creating a new ActiveX control and adding a 'global' class to it.

Surely there must be a simple way of doing this in VC++ ??

Help...
0
 
LVL 10

Author Comment

by:smegghead
ID: 6970793
PS. I've upped the points to 200 as I really need a solution to this.
0
 
LVL 16

Expert Comment

by:AlexNek
ID: 6971201
2 smegghead
why you don't want to use ready solution: Stingray Grid ActiveX for VB6? We already used this product for VC++.

http://www.roguewave.com/products/stingray/screenshots.cfm
New site design is not so good because first you must create Guest account:
http://www.roguewave.com/products/stingray/whitepaper.cfm?Guest=Yes
0
 
LVL 10

Author Comment

by:smegghead
ID: 6998740
Alex,

I'm sure the grid is very good, but we're just after a relatively simple and cheap control (which we can author in-house).

I've got the functionality exactly as we want it, but I just wanted to tidy up the interface to allow a class to be passed back and forth containing the cell properties.

jkr,

Thanks for the links, but I'm still no closer to achieving my goal.

Do you mind if I delete this q and re-post it again in a few months... when I'll probably want to do the same thing again.
0
 
LVL 16

Expert Comment

by:AlexNek
ID: 6999393
2 smegghead
I think your second method is a good choice.
Dim Cell as object
Set Cell = gridocx.CreateCellObject
Cell.SetText "Sample"
SetCells 1,1,1,10, Cell

But realization is not very easy.

If you want to recreate this topic later you can create new topic with the link to the old one.
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 10

Author Comment

by:smegghead
ID: 6999981
Yeah, that's exactly what I want to do... but... :-(
0
 
LVL 16

Expert Comment

by:AlexNek
ID: 7000062
2 smegghead
Do you use ATL? Which kind of help do you need?
0
 
LVL 16

Expert Comment

by:AlexNek
ID: 7000065
2 smegghead
Do you use ATL? Which kind of help do you need?
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7017249
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101, Netminder or Mindphaser will return to finalize these if they are still open in 7 days.  Experts, please post closing recommendations before that time.

Below are your open questions as of today.  Questions which have been inactive for 21 days or longer are considered to be abandoned and for those, your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.20293057.html
http://www.experts-exchange.com/questions/Q.20296993.html
http://www.experts-exchange.com/questions/Q.20298711.html
http://www.experts-exchange.com/questions/Q.20293571.html
http://www.experts-exchange.com/questions/Q.20301082.html



*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations.
If you are interested in the cleanup effort, please click this link
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643
POINTS FOR EXPERTS awaiting comments are listed in the link below
http://www.experts-exchange.com/commspt/Q.20277028.html
 
Moderators will finalize this question if in @7 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
 
Thanks everyone.
Moondancer
Moderator @ Experts Exchange
0
 
LVL 10

Author Comment

by:smegghead
ID: 7018152
Sorry, would have come back to this question if I'd received email notifications for the comments added...

I want to delete this question, as I didn't get this solved.
0
 
LVL 10

Author Comment

by:smegghead
ID: 7018168
AlexNek,

I do use ATL.

However, I'm in the process of moving across to VB.NET which is raising different issues.

Any objections to me deleting this question ?
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7019070
Thanks for responding, let's give this a few days so all participating experts can be advised of your deletion request.  Perhaps others will have some additional thoughts to help you.

Moondancer - EE Moderator
0
 
LVL 1

Accepted Solution

by:
Moondancer earned 0 total points
ID: 7022711
I have refunded your 200 points to you and closed this item; nothing has transpired from prior request.
Moondancer - EE Moderator
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now