Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Hosting ActiveX Control (Read 7706 times)
andrewsando1973
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Feb 14th, 2010
Hosting ActiveX Control
Feb 14th, 2010 at 8:56pm
Print Post  
I'm trying to host a grid control in flowchartx box,
but when i pass the AxControl to class event wrapper (in the boxcreated event) i recieve the err msg Type mismatch.

'example code:
Set sec = new cGridEventWrapper
Set sec.Control = box.AxControl

Can anybody help me please?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Hosting ActiveX Control
Reply #1 - Feb 15th, 2010 at 8:19am
Print Post  
If you comment this assignment out, can you see any grid actually created inside the box?
  
Back to top
 
IP Logged
 
andrewsando1973
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Feb 14th, 2010
Re: Hosting ActiveX Control
Reply #2 - Feb 15th, 2010 at 10:40am
Print Post  
Thank you for the fast reply.

Yes, the grid control is perfectly added to the FlowChartX (i mean it is perfectly created in the box), but the problem is to pass that object to a class for event wrapping.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Hosting ActiveX Control
Reply #3 - Feb 15th, 2010 at 11:08am
Print Post  
Are you sure the ProgID assigned to AxControlId represents the same type as the sec.Control reference?
  
Back to top
 
IP Logged
 
andrewsando1973
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Feb 14th, 2010
Re: Hosting ActiveX Control
Reply #4 - Feb 15th, 2010 at 12:03pm
Print Post  
The ProgId is for the same control declared in the class "but not the same words"
the Control is farPoint spread "fpSpread", its ProgID which i get from the windows registry is something like"FarpointADO.fpSpread.6" while the declared control is "fpSpreadADO.fpSpread".

example:
box.AxControlId = "FarpointADO.fpSpread.6"

while the declaration in the cGridEventWrapper class is
Public withevents Control As fpSpreadADO.fpSpread


Also when i get  the error message and i move the mouse pointer over box.AxControl it gives me  (box.AxControl = "") !!!!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Hosting ActiveX Control
Reply #5 - Feb 15th, 2010 at 1:23pm
Print Post  
I have downloaded a FarPoint Spread 8 trial and replaced the "SampleAx.AxNode" assignments in the ActiveX sample project with:

fcx.AxControlId = "FPSpreadADO.fpSpread.6"

and also changed the event wrapper with the following:

Public WithEvents Control As FPSpreadADO.fpSpread
Public Parent As Form1

Private Sub Control_Click(ByVal Col As Long, ByVal Row As Long)
    Parent.sax_Start
End Sub

It works fine and successfully shows the message box when a cell is clicked. Could you try that ProgID in your project?
  
Back to top
 
IP Logged
 
andrewsando1973
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Feb 14th, 2010
Re: Hosting ActiveX Control
Reply #6 - Feb 15th, 2010 at 1:32pm
Print Post  
Thank you so much
i will try it again although i did the same before, but i will try to reinstall farpoint spread and try it again as you mentioned.

Thanks again
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Hosting ActiveX Control
Reply #7 - Feb 15th, 2010 at 1:37pm
Print Post  
I mean you have used a different ProgID "FarpointADO.fpSpread.6" than the one I've found in the registry after installing FarPoint - "FPSpreadADO.fpSpread.6". Do you perhaps have two different versions of the spread control?
  
Back to top
 
IP Logged
 
andrewsando1973
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Feb 14th, 2010
Re: Hosting ActiveX Control
Reply #8 - Feb 15th, 2010 at 2:42pm
Print Post  
Yes, i have two versions of the control, but i was using the ProgID you mentioned. i just didn't remember how to write it in the post.
so i'll try everything again from the beginning then i will let you know.
  
Back to top
 
IP Logged
 
andrewsando1973
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Feb 14th, 2010
Re: Hosting ActiveX Control
Reply #9 - Feb 15th, 2010 at 8:13pm
Print Post  
i have tried everything several times, even i downloaded the trial version you used and make all the trials on different machine but the results are the same. (err msg Type mismatch)

i looked in the Locale window in vb 6 and i found the box.AxControl type is Object/fpSpread so everything seems great. but when i try to set the variable to the box.AxControl i got type mismatch error.

Also, i tried completely new projects and always that error.

do you think the error is in certain settings or declaration or something?

or can you send me the project that you did yourself?

Thank you alot for you support.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Hosting ActiveX Control
Reply #10 - Feb 16th, 2010 at 8:32am
Print Post  
You can find it here:
https://mindfusion.eu/_samples/axhosting_test_VB.zip

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
andrewsando1973
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Feb 14th, 2010
Re: Hosting ActiveX Control
Reply #11 - Feb 16th, 2010 at 9:03am
Print Post  
Greaaaaaaaaaaaaaaat !!!

Your project works perfectly. Thank you a lot.

But i have may be a silly question, In your project Although i don't see that you added the fpSpread as component (i don't find it in the ToolBox) but i can still find the reference library in the Event Wrapper Class.

1) When i tried to add the Component from (Project> Components) i received the err msg "Name Conflict with existing module", so how can this happen and where is that module?

2) How did you add the fpSpread to the project?

3) when i made a completely new project but added the fpSpread normally from the components dialogue, the type mismatch error appears as usual, so i think the trick was in adding the fpSpread to the project, do you have an explanation for this?

This will really help me in adding other controls.

Thank you alot for the great support.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Hosting ActiveX Control
Reply #12 - Feb 16th, 2010 at 9:18am
Print Post  
Smiley All clear now. In this project the reference has been added through the Project / References command. If you add it through the toolbox, the form object is actually a so called ActiveX Extender object, and not the ActiveX control itself.

However we are not aware of any way to assign the ActiveX reference returned by the box.Control property to a form's ActiveX extender variable. If you need to use both type of references, you might have to move some part of your code to a separate project.

Stoyan
  
Back to top
 
IP Logged
 
andrewsando1973
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Feb 14th, 2010
Re: Hosting ActiveX Control
Reply #13 - Feb 16th, 2010 at 10:02am
Print Post  
Really, Thank you so much for your support
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint