Solved

Controlling a MSHFlexGrid using a DLL

Posted on 2001-09-14
3
322 Views
Last Modified: 2006-11-17
I am writing an app that uses ActiveX documents. One of these documents contains a MSHFlexGrid.

I have an XML file which contains parameters to control certain properties of the grid e.g column widths.

Via a dll, containing class modules I need to create a reference to the grid so that from within the ActiveX document I just call a function in the dll which will control properties of this grid.

I have heard this can be done through Property Get, Set statements but have not used these before.

Could anyone point me in the right direction...
0
Comment
Question by:CarlJWhite
  • 2
3 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 100 total points
Comment Utility
In the DLL, add a declaration

Private MyGrid As Object

You can then have a public sub:

Public Property Let GridReference(TheGrid As Object)
  Set MyGrid = TheGrid
End Property

Calling this Property with

MyDll.GridReference = MSHFlexgrid1

Will then set an internal reference to the grid withing the DLL. Any reference to MyGrid then will actually have an effect on the external grid passed in this way.
0
 
LVL 43

Expert Comment

by:TimCottee
Comment Utility
If you have an MSHFlexgrid component in the DLL project somewhere, you can declare and pass it as MSHFlexgrid rather than as object.
0
 

Author Comment

by:CarlJWhite
Comment Utility
Worked a treat.

Cheers....
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

763 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

10 Experts available now in Live!

Get 1:1 Help Now