1. How can I set a property in an Activex ?

I'm a beginner in Euphoria, trying to use my favorite activex control
  (MSFlexGrid). I was able to modify the SHEET.EXW example in Eucom and I can see
  the grid, but I dont know how to set a simple property. In VB i use something
  like Grid1.Rows = 10. How can this same thing be done in Euphoria? I suppose that
  the invoke( ) can be used, but in my tests everything fails. I'm testing the
  following line and some variations of it, but nothing works:
void = invoke( Grid1, {MSFlexGrid_p_Rows,DISPID_PROPERTYPUT}, {4}, {VT_I4},
  DISPATCH_PROPERTYPUT )
Can someone help me ? I would like to know, too, how to read the .Rows
  property.
  Thanks in advance.

new topic     » topic index » view message » categorize

2. Re: How can I set a property in an Activex ?

Jucarapato wrote:
> 
>   I'm a beginner in Euphoria, trying to use my favorite activex control
>   (MSFlexGrid).
> I was able to modify the SHEET.EXW example in Eucom and I can see the grid,
> but I dont know how to set a simple property. In VB i use something like
> Grid1.Rows
> = 10. How can this same thing be done in Euphoria? I suppose that the invoke(
> ) can be used, but in my tests everything fails. I'm testing the following
> line
> and some variations of it, but nothing works:
>   void = invoke( Grid1, {MSFlexGrid_p_Rows,DISPID_PROPERTYPUT}, {4}, {VT_I4},
> DISPATCH_PROPERTYPUT )
>   Can someone help me ? I would like to know, too, how to read the .Rows
>   property.
>   Thanks in advance.

I've never worked with MSFlexGrid, but that code looks correct.  What happens
after you call the code?  It might not like the DISPID_PROPERTYPUT.  I've seen
some objects that require it, and others that fail if you don't have it.
Do you get an error message (by using com_err_out)?

Matt

new topic     » goto parent     » topic index » view message » categorize

3. Re: How can I set a property in an Activex ?

I confess: this is my first "real" test with Euphoria - and I'm already very
happy to see the grid in a windows form (I'm still in the "hello world" phase).
However, the grid appears with the default number of rows and columns, exactly
like it would appear if it was dropped in a VB6 form: two rows, with two columns.
With that code I was trying to set the number of rows of the control; in VB it
can be done with something like: Grid1.Rows = 4
I supposed that the "{4}" would do the same thing in Euphoria.
Anyway, I know there's still a lot to learn before I can build something really
useful - for example, you asked me something about using "com_err_out"... and I
just don't know what it is...
There is no error message when I run test. The  modification I've done to
griddemo.exw was in the about procedure, it is now like this:

procedure about(integer self, atom msg, sequence params)
atom void
    void = message_box(
        "My first message box", "Teste 1", 0)
void = invoke ( Grid1, {MSFlexGrid_p_Cols, DISPID_PROPERTYPUT}, {4}, {VT_I4},
DISPID_PROPERTYPUT )
void = message_box("Second message, "Teste 2", 0)
end procedure

I used two messageboxes just to be sure that it was executing the code. I click
the "about" menu item, and the first message appears; clicking the "ok" button
makes the second one appears, as it should. Between the two messages, the call to
invoke() does not change the number of rows of the grid, and there is no error
message.
(And, of course, only today I discovered the Eugrid control. Perhaps I can use
it instead of MSFlexGrid, but for now I would prefer to adapt my VB code to
Euphoria; it would be great to understand how to use the same activex and
properties/methods/events i'm used to in VB)

new topic     » goto parent     » topic index » view message » categorize

4. Re: How can I set a property in an Activex ?

I can't help with the ActiveX control but if you're looking for a grid control
have you considered EuGrid by Phil Russell?  It's an excellent grid control and
doesn't require COM.

Jonas Temple
http://www.yhti.net/~jktemple

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu