|
Is your licensed control in the GAC or in a normal directory?
Do you use your control in an application or a DLL (class library, wrapping control)?
|
|
|
|
|
Its not in the GAC. It is also a web control Library Assembly specifically for Internet apps. Inside of the library I have a standard web control and a second class inherited from the base control class which has no interface. Neither of the controls can be licensed.
I wrote a real basic test server control added licensing LicFileLicenseProvider, Validate, Dispose, [namespace].[class].lic, Compiled it. Created Host Web app, added the control and a license file in the bin same as the lic file in the component, added licenses.licx. Compiled and run,
Got the error "A license could not be found...", take out the validate method call control works fine in design and runtime.
Tried it in C# and VBNet both the same.
Thnx for your help
|
|
|
|
|
In your first message, you asked if anyone had any problems with the licensing. I have the following problem:
- I create a basic Windows Forms Control with a basic licensing (LicFileLicenseProvider). Let us call it Dummy.dll.
- If I use it in a windows application (DummyTest.exe), the licensing is working correctly
- If I wrap dummy in a another unlicensed control (DummyWrap.dll) and if I use DummyWrap in a windows application (DummyWrapTest.exe), the licensing does not work anymore (Notice that DummyWrap has a licenses.licx file since it uses Dummy.)
- Then if I add a licenses.licx file to DummyWrapTest itself, the licensing is working again. (I thought initially that the licenses.licx file was not necessary because DummyWrapTest is only using DummyWrap. It does not see Dummy.
- However there are cases where I cannot add the licenses.licx file to the application, for instance if this application is ASP.NET (I have not its source code!). I don't know what to do here to avoid the "license not found" message.
|
|
|
|
|
In your case I can see whay the licenses.licx is required. Even although you have wrapped the original control in a dummyshell it is probable that the dummyshell actualy creates an instance of the control anyway, which causes the licensing to kick in. The licensing is in the constructor.
The theory I have in my case is something to do with the path of the lic file being in a web. The License provider seems not to deal with this situation. Originally I wrote new license providers assuming that the implementation would be a walk in the park. Just to get it right I decided to do a quick test using the basic license provider and it didn't work!!. I am probable wasting time trying to get the basic license provider working and should just launch straight into implementing my custom provider.
Hope my comments helped in your case.
Thansk for your efforts anyway.
|
|
|
|
|
I'm just a web designer/scripter, not a coder, and don't like dead links. This requires VB: I want to put a hyperlink on my desktop html page and have it link to an offline page when offline, and to an online page when online...that way the link will always call an available page.
can ne1 pls tell me the exact code I can paste into my page?
Your help most appreciated....
Cheers!
|
|
|
|
|
Hi,
I want to check whether a COM object or activeX, implements my new version of an interface or the old one, I know the GUID of my new interface, is there any way to check that using Visual Basic ?
Thanks in advance, greetings
Braulio
|
|
|
|
|
|
Hi Daniel,
Thanks, but... what I have it's a GUID ( and I cannot import the TLB in order to have Interface...), it's possible to get the Interface from the GUID ?, or is there a TypeOf that works only with the GUID ?
|
|
|
|
|
Braulio Díez wrote:
Thanks, but... what I have it's a GUID ( and I cannot import the TLB in order to have Interface...), it's possible to get the Interface from the GUID ?, or is there a TypeOf that works only with the GUID ?
Oh, I see... Well, VB6 do not have any feature like that. The way to go would be calling the QueryInterface method on the IUnknown (all COM interfaces have this method). Doing this in VB6 is cumbersome and involves some coding I would not show to children. The way to go would be coding this in a small C++ component.
My latest article: GBVB - Converting VB.NET code to C#
|
|
|
|
|
Thanks for the Info,
Yes, I've seen some examples of that QueryInterface and I didn't believe it could be so difficult.... what a pity..., well let's hope that VBasic .net it's completly different that 6.0
|
|
|
|
|
I put nothing like a paramter, I all the time have an error..
****************************
InsertFunction(1, Nothing)
Public Shared Function InsertFunction(ByVal i as Integer, ByVal m as String)
****************************
How can I do to put nothing and have a NULL value in the database ?
Thanks for the help.
Julien
|
|
|
|
|
|
Hi,
When i use this code :
Printer.ScaleMode = vbMillimeters<br />
Printer.Orientation = vbPRORPortrait<br />
Printer.PaperSize = vbPRPSA4<br />
Printer.CurrentX =100<br />
Printer.CurrentY =100<br />
Printer.Print "."<br />
Printer.EndDoc
if i check the result, this "." is printed at position X=103 and Y=106
I dont understand why i obtain X+3 and Y+6
Thanks in advance for any help
|
|
|
|
|
I created a vb6 activex control which I'm using in Word.
I call it from word and it does its thing.
But the control remains on the document.
How can I code (with vb) a command button on the control
so that the control is 'terminated?"
|
|
|
|
|
Why do you want to destroy it before the document closes?
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
How to determine a UserID (in Windows) is a member of a certain UserGroup (like SalesManagers) in VB.Net?
I tried DirectoryEntry and DirectorySearcher in the System.DirectoryServices name spaces, but I cannot get it to work. I also tried WindowsIdentity and WindowsPrincipal.IsInRole but with no correct result. I cannot find any sample codes.
Any suggestion?
Thanks
|
|
|
|
|
Here is the function that I have for a project that I was working on.
Good luck...
Imports System.DirectoryServices
Friend Function VerifyUser(ByVal Username As String, ByVal Password As String, ByVal groupType As EGroupType) As Boolean
Dim RootDomain As New DirectoryEntry("LDAP://rootDSE")
Dim strDNC As String = RootDomain.Properties("DefaultNamingContext")(0)
Dim UserEntry As New DirectoryEntry("LDAP://" & strDNC, Username, Password)
Dim Searcher As DirectorySearcher = New DirectorySearcher(UserEntry)
Dim SearchResults As SearchResultCollection
Dim SearchResult As SearchResult
Dim GroupPresentFlag As Boolean
Dim Data As String
Dim Cnt As Integer
Dim ResultCollection As ResultPropertyCollection
Dim ValueCollection As ResultPropertyValueCollection
Dim m_configSettings As New GlobalData()
Username = Username.Trim(" ")
Password = Password.Trim(" ")
Searcher.Filter = ("(samaccountname= " & Username & ")")
Searcher.PropertiesToLoad.Add("memberOf")
GroupPresentFlag = False
Try
SearchResults = Searcher.FindAll
Catch Ex As Exception
End Try
For Each SearchResult In SearchResults
ResultCollection = SearchResult.Properties
Next
ValueCollection = ResultCollection.Item("memberOf")
For Cnt = 0 To ValueCollection.Count - 1
Data = CType(ValueCollection(Cnt), String)
Select Case groupType
Case EGroupType.Users
If InStr(Data, m_configSettings.ADUserGroupName, CompareMethod.Text) Then
GroupPresentFlag = True
End If
Case EGroupType.Poweruser
If InStr(Data, m_configSettings.ADPoweruserGroupName, CompareMethod.Text) Then
GroupPresentFlag = True
End If
Case EGroupType.EarlyAdopter
If InStr(Data, m_configSettings.ADEarlyadopterGroupName, CompareMethod.Text) Then
GroupPresentFlag = True
End If
Case EGroupType.Admin
If InStr(Data, m_configSettings.ADAdminGroupName, CompareMethod.Text) Then
GroupPresentFlag = True
End If
End Select
Next
If (Not m_configSettings Is Nothing) Then
m_configSettings = Nothing
End If
Return GroupPresentFlag
End Function
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
Thanks Ray for your sample. I just found out that my company does not have LDAP yet. Only Windows 2000. So, I guess I cannot use the DirectorySearcher in this case. What is your comment on this? Am I out of luck?
Thanks.
|
|
|
|
|
Are they using Active Directory? That is all that I am using.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
Yes. But the path would be like this "WinNT://DomainName/GroupName". I tried the following codes and I can see the GroupName there but I cannot see the members contain inside the group.
Dim DEntry As New DirectoryServices.DirectoryEntry("WinNT://DomainName")
Dim UserGrp As DirectoryServices.DirectoryEntry
For Each UserGrp In DEntry.Children
If UserGrp.Path = "WinNT://DomainName/GroupName" Then
MessageBox.Show(UserGrp.Path)
End If
Next
There, you can try it out. Again, many thanks, Ray.
|
|
|
|
|
I have created a windows service but how do you run the code in the IDE so you can step through and debug it?
|
|
|
|
|
You have to install it, start it then attach to it in the debugger. This will cause you to miss being able to really debug any code in the starting events.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
What a pain! Do you know if you can have a System Tray Icon with a menu Associated with your service. I tried setting up a NotifyIcon, it runs through the code to set it up fine but it never appears in the system tray.
|
|
|
|
|
One trick I've been using is to put most of the initialization code in a one-shot timer (.AutoReset=False) and set the interval on that timer for something like 30-45 seconds. That gives you the time to connect the debugger to your service before that code starts.
Since my service is based around another timer, I just leave my main timer disabled until the initialization timer fires. Put your first breakpoint in the initialization timer and you can then debug that code.
Once you are happy with your initialization code, you can speed things up by changing the initialization timer's interval to something much shorter. Don't change the structure for production, just shorten the interval. If you need to re-debug something in the init code, you only have to change your interval again.
|
|
|
|
|
Two more questions.
1. How can I make my service handle the Pause and Continue events? I have the code for these events in my service (OnPause and OnContinue) but these selections are not available to me in the Service Manager. Also I wrote a custom app to control services, when I call the pause method against my service I get an exception because the service does not handle these events. (System.InvalidOperationException: Cannot pause Esanti_Core service on computer '.'. ---> System.ComponentModel.Win32Exception: The requested control is not valid for this service)
2. How can I write a service install function from a custom app?
|
|
|
|