For Programmers: Free Programming Magazines  


Home > Archive > Cobol > January 2007 > Re: Fujitsu NetCOBOL for .NET v2.1 MessageBox question









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Fujitsu NetCOBOL for .NET v2.1 MessageBox question
wesley_3@hotmail.com

2007-01-08, 6:55 pm


Pete Dashwood wrote:
> <wesley_3@hotmail.com> wrote in message
> news:1168033938.313462.16260@s80g2000cwa.googlegroups.com...
>
> The third parameter should be a DotNet MessageBoxButtons constant....
>
> try...
>
> invoke objMyMsgBx "Show"
> using by value "This is my text"
> "This is the caption"
> MessageBoxButtons.YesNo
> end-invoke
>
> Or something similar... I don't have NetCOBOL for DotNET so I can't give you
> the exact syntax...
>
> In C# it is...
>
> DialogResult reponse = MessageBox.Show("this is text", "this is a caption",
> MessageBoxButtons.YesNo);
>
> if (response = "Yes") ...
>
> Both 'DialogResult' and 'MessageBoxButtons' are types. I'm not sure how
> DotNET COBOL will deal with these...
>
> I would expect your environment to know about the MessageBoxButtons
> constants, but maybe it doesn't. Pass the ButtonType by value even if the
> other 2 are passed by reference.
>
> You could try getting the response so you can see which button was
> pressed...
>
> invoke objMyMsgBx "Show"
> using ws-text
> ws-caption
> by value
> YesNo of MessageBoxButtons *> not sure of exact
> syntax here - possible alternatives...
> *>
> YesNo
> *>
> <some Fujitsu reserved prefix> -YesNo
> *>
> 36
>
> ...
> returning response
> end-invoke
>
> If the 36 value works, response will be 6 if the user clicks Yes. (I based
> this on some Windows Script Hosting I just tested, but it is using VB
> MsgBox, not Windows Forms. I believe DotNET uses Forms...)
>
> As noted above, "response" is of type DialogResult which can't be defined in
> normal COBOL (maybe it can in DotNET?) I tried to get C# to cast it to
> string but it wouldn't... Probably the DotNET compiler deals with it; I
> can't experiment but you may have to. Depending on what the compiler does,
> you may not need the type ("MessageBoxButtons") in the parameter.
> If all else fails, try Fujitsu support.
>
> Please post the successful code here; I'll be very interested to see how it
> is resolved.
>
> Pete.


I can't seem to get anything to work for the 'MessageBoxButtons' and
'DialogResult' types. Fujitsu NetCOBOL doesn't seem to recognize these
types. I guess I'll have to figure something else out.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com