loDialog.ShowDialog(false, false); in C#: error


Author
Message
Ralph Rutschmann
Ralph Rutschmann
StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)
Group: Forum Members
Posts: 69, Visits: 1.3K
Hi,



maybe I'm doing something stupid. Following the help files, I tried to include security into my application. This works so far as I don't try to use 'loDialog.ShowDialog(false, false);' which I copied from the help file. That gives me an error message: 'No overload for method 'ShowDialog' takes '2' arguments'. Opposite to that the help file is telling me: 'Showing the SecurityDialog without Permissions or Restriction Sets [C#]'.



I'm using StrataFrame 1.6.1.



Can someone have a look at this?



TIA and friendly greetings,



Ralph
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Ralph,

The SecurityDialog accepts two parms, and the language does not make a difference.  If you open up the Object Browser and look at the SecurityDialog form, do you have a constructor that accepts two boolean parms?  If not, then you may not be running on 1.6.1 and you may need up upgrade to the latest.  Otherwise, please post the stack trace or the error so I know what you are getting.


Ralph Rutschmann
Ralph Rutschmann
StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)
Group: Forum Members
Posts: 69, Visits: 1.3K
Hello Trent,



thank you very much for your help. StrataFrame support is best! :-)



I did what you wrote and there wasn't any "new" constructor. So I opened the source code and there was all what should be there. Removed the reference and added it again, with no success. I did a clean solution and a rebuild solution, did run the afterbuild.bat, removed the reference to the StrataFrame Security from my own solution, added it again with no success again. I did all of that many times, restarted my machine between, restarted VS between, no success.



The dll is there, opened in VS it looks exactly like your screen shot. But as a reference added to my project, it lacks of the new construtors.



I don't know what's going on or what can I do.



Any hint?



TIA and friendly greetings,



Ralph
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Any hint?

It sounds like you have an older set of SF DLLs that are being built or loaded.  If you download the most recent source code from the website, build it.  Get out of Visual Studio, open your project again, remove the SF references, add the newly recompiled references, clean your solution, get out of VS again, then go back in and recompile do they show up?

I know this sounds like a long way around, but you have some old assemblies somewhere that are being loaded instead of the 1.6.1 assemblies.  Also, one other thing you could try it to manually delete the StrataFrame entries in the GAC before you rebuild the StrataFrame solution.   This way you know they are gone before you build them and then after you build the SF code they should be back in there.  You should only need to remove the four highlighted below....and any versions that are older than 1.6.0.  Just FYI, the GAC will show 1.6.0 for the 1.6.1 version of SF.  We did this intentionally to make it easier for developers to move to the 1.6.1 version.


Ralph Rutschmann
Ralph Rutschmann
StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)
Group: Forum Members
Posts: 69, Visits: 1.3K
Hello Trent,



I did all you said, but with no success. :-(



Reinstalled StrataFrame, no success.



Something else I can do?



Thank you very much and friendly greetings,



Ralph
StrataFrame Team
S
StrataFrame Developer (4.3K reputation)StrataFrame Developer (4.3K reputation)StrataFrame Developer (4.3K reputation)StrataFrame Developer (4.3K reputation)StrataFrame Developer (4.3K reputation)StrataFrame Developer (4.3K reputation)StrataFrame Developer (4.3K reputation)StrataFrame Developer (4.3K reputation)StrataFrame Developer (4.3K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Well, the problem is that you're probably using C# and the screenshot that Trent took is from the Object Browser when you have a VB project open.  It changes so that constructors show up as New() instead of [ClassName]() like they do in C#.  I think you're problem is most likely a bug in the help documentation.  Try this snippet and see if it works for you:

using MicroFour.StrataFrame.Security;

...

SecurityDialog dialog = new SecurityDialog(false, false);
dialog.ShowDialog();

I don't think there's an overload for the ShowDialog() method, but there are overloads for the constructor, so you can pass the 2 falses to the dialog's constructor.

Ralph Rutschmann
Ralph Rutschmann
StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)StrataFrame User (131 reputation)
Group: Forum Members
Posts: 69, Visits: 1.3K
Hi Ben,

thank you very much for jumping in. Yes, you're right, I'm using C#. Didn't know that makes any difference. I should mention in future that I use C#.

SecurityDialog loDialog = new SecurityDialog(false, false)

That did the trick! :-)

Thank you again and friendly greetings,

Ralph

 


StrataFrame Team
S
StrataFrame Developer (4.3K reputation)StrataFrame Developer (4.3K reputation)StrataFrame Developer (4.3K reputation)StrataFrame Developer (4.3K reputation)StrataFrame Developer (4.3K reputation)StrataFrame Developer (4.3K reputation)StrataFrame Developer (4.3K reputation)StrataFrame Developer (4.3K reputation)StrataFrame Developer (4.3K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
No problem, Ralph Smile

The differences between C# and VB are generally very minor syntax changes, but VS keeps up with them enough to even change the Object Browser!!  Oh well, I think it took me a while before I figured out that when I had a VB project open, lots of stuff changed in the environment.

Glad you got it working.

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
I've just been bit by this one, the problem is that the topic "Calling the Security Maintenance Dialog" has the code sample wrong like this:

Imports MicroFour.StrataFrame.Security
...
Private Sub ShowSecurityDialog()
    '-- Create the form and show it
    Using loDialog As New SecurityDialog()
        loDialog.ShowDialog(False, False)
    End Using
End Sub

Where the overload parameters should be passed to the New SecurityDialog() like this:

Imports MicroFour.StrataFrame.Security
...
Private Sub ShowSecurityDialog()
    '-- Create the form and show it
    Using loDialog As New SecurityDialog(False, False)
        loDialog.ShowDialog()
    End Using
End Sub


Edhy Rijo

Dustin Taylor
Dustin Taylor
StrataFrame Team Member (652 reputation)
Group: StrataFrame Users
Posts: 364, Visits: 771
Ah, yep, that would explain the confusion. We'll get it fixed for the 1.6.6 release.

Thanks! BigGrin

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search