|
Hi Richard & Steven,
Thanks for your response,
The Framework has already been developed using VB6. Now we are trying to provide a trial licence. The licencing dll is already created using .net
My job is to use this .dll and make the licencing for the VB application.
So I want to know how can i use the public functions of the dll in vb6.
Thanks,
Karthick.M
|
|
|
|
|
Sorry, I misunderstood your original question. If both parts are written in VB6 then just use standard function calls. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
No Richard,
The Appication was developed using VB6 and the DLL using Microsoft .NET
|
|
|
|
|
Your .DLL has to be written so that it is COM exposed. Without that, you cannot use it in your VB6 app.
You've written the apps backwards. Since the .NET .DLL code can be easily examined using .NET Reflector, you just made the most critical part of your licensing code easily readable. It should have been written in something than compiles to native code instead of managed code.
In any case, you have the reference to the .TLB file in your project. Then you just import it's namespace at the top of the code that's going to use the COM objects in it. Then it's just a matter of declaring an instance like any other object.
Dim x As New MyComClass
|
|
|
|
|
Thanks Dave,
I am now checking this in my project,
Dim TestObject As XYZ.VLicense
If TestObject.IsCorrectDate= False Then
MsgBox "Correct Date"
End If
But i am getting run time error '91'
Error :object variable or with block variable not set
What am I doing wrong? Should i also refer the path of the licence file to the created object?
FYI: VLicense is a class in the .dll and IsCorrect daet is the public methos of the calss,which checks if the sytem date is correct or is it back dated.
Thanks,modified on Tuesday, March 2, 2010 1:52 AM
|
|
|
|
|
karthickmani63 wrote: Dim TestObject As XYZ
Dim TestObject As New XYZ
The .IsLicenseValid is a method on the XYZ object, in which case, you can't make an instance of it.
Seriously, this is a VB 101 rookie mistake. How long have you been writing code??
karthickmani63 wrote: Should i also refer the path of the licence file to the created object?
I don't know. I have no idea how that library works. You'll have to read up on the documentation for it.
|
|
|
|
|
Sorry Dave,
I am working on VB only for past 2 weeks.
Also Please check the previous post I made a mistake while posting.
The developer who created the XYZ.dll asked me to refer the path of the .xml licence file while creating the object of VLicence class.
I dont think so this is possible in Vb, as this may require a constructor.
When I checked the XYZ.dll using Microsoft .Net Framework IL Disassembler.
I found that IsCorrectDate and IsLicenceValid are public methods defined in the VLicence class.
Now:
1.
Dim obj as XYZ.VLicence
obj.--- (Doesnt display the public Methods)
2.
Dim obj as new XYZ.Vlicence
(Trying to create a object of the class doesnt work as well)
3.
Dim obj as XYX.VLicenceInterface
obj.IsLicenceValid
.IsCorrectDate (I am getting the public methods displayed)
If obj.IsCorrectDate = True Then
(Here I am getting the Same error mentioned above)MsgBox "Correct Date"
End If
I am unable to use the functions using this XYZ class object. But the same can be accessed using XYZInterface class object.
suggest me a solution to over come this.
Thanks,
Karthick.Mmodified on Tuesday, March 2, 2010 1:54 AM
|
|
|
|
|
#3 seems to be the most appropriate, but I'm not the person to ask. You should be asking the guy who wrote the library.
|
|
|
|
|
Would a team small as mine benefit using Visual Studio ultimate?
We have 2 people at the moment and will probably add another soon.
Very small team but the thing that intrigues about ultimate is intellitrace... and my understanding is that it is only available in ultimate.
We are currently running VS2008Pro.
Also I am wondering if ultimate has built in source control and if so has anyone used it/like it?
Thank you allHumble Programmer
|
|
|
|
|
The Team Foundation Client is available as a separate download, and therefore, I assume, integrateable with all VS2010 editions, though I have not tried it myself. It appears that they are moving to it being an add-on component rather than part of a special team build. If anyone knows more about that side of the component packaging for VS2010 I would like to hear about it as well.
The Team Foundation Client can then access Team Foundation Server 2010 and Team Foundation Server 2008, though not Team Foundation Server 2005.
|
|
|
|
|
Hi CodeProject ,
I wrote a javascript to validate the fields on the contact form . But it is working in my system.
After deploying in Main server . I am getting BLANK fields values .
What is the problem ?
This the code
<%@language = "VBscript"%>
<%
set objMessage = createobject("cdo.message")
set objConfig = createobject("cdo.configuration")
' Setting the SMTP Server
Set Flds = objConfig.Fields
Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "xyz"
Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25
Flds.update
dim b
b= "Name : " & Request.Form("Name") & vbCrLf
b= b & "Organisation : " & Request.Form("Organisation")& vbCrLf
b= b & "Title : " & Request.Form("Title")& vbCrLf
b= b & "Address : " & Request.Form("Address")& vbCrLf
b= b & "City : " & Request.Form("City")& vbCrLf
b= b & "Country : " & Request.Form("Country")& vbCrLf
b= b & "Email : " & Request.Form("Email")& vbCrLf
b= b & "Phone : " & Request.Form("Phone")& vbCrLf
b= b & "Interesed in : " & Request.Form("category")& vbCrLf
b= b & "Description : " & Request.Form("Description")& vbCrLf
Set objMessage.Configuration = objConfig
objMessage.To ="xyz@gmail.com"
'objMessage.CC ="xyz@xyz.in"
objMessage.From = "info@xyz.in"
objMessage.Subject = "Contact Form - " & Request.Form("Organisation") & vbCrLf
objMessage.TextBody = "High priority - See details below. " & vbCrLf & vbCrLf & b
on error resume next
objMessage.Send
if Err.Number <> 0 then
response.Write "Email sending failed: " & Err.Description & ".<br />"&vbcrlf
else
response.redirect("contact_submit.html")
end If
Response.End
set objMessage = nothing
set objConfig = nothing
%>
Regards,For1206
|
|
|
|
|
Looks like VBScript to me not Javascript. Perhaps you might get an answer in the Web forum?
|
|
|
|
|
I like to show my forms with silverlight option, is it possible? This is the first time I am trying...
My idea is while the datas are readonly, then the form opening time if we show the silverlight option then the user can easily identify that it cannot be change...
So, Any better guidences...
Thanks...
|
|
|
|
|
|
Hi mates,
I'm currently working on vb.net with access mdb database, actually this is an access existing application.
Because converting access application to vb.net is not a good result. So, I create forms in vb.net from a scratch
but I just re-used the access tables. Now, the problem is every time I have a query,it will
successfully (insert,update,delete) but when I close the application and run again. The datas that have insert/update/delete
are still their. Why is it that my data are not updated?
Thank is advanceC# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
modified on Thursday, February 25, 2010 9:00 PM
|
|
|
|
|
You need to provide us with source code for your queries, as it is not possible to tell what is wrong from the info you have given us.
|
|
|
|
|
Actually theres no error in my code. Anyway, heres my code snippet.
Private Sub btnUpdate_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnUpdate.Click
sb = New StringBuilder
sb.Append("UPDATE [T_Analysis] SET ")
sb.Append(" [OrderDate]= '" & Me.txtDate.Text & "'")
sb.Append(",[OrderName]= '" & Me.txtOrderName.Text & "'")
sb.Append(" WHERE [OrderNo]= " & Me.txtOrder.Text & "")
ADOExecute(sb.ToString)
End Sub
[Module]
Public Sub ADOExecute(ByVal ssql As String)
Dim sqlexec As Integer
Dim adocmd As ADODB.Command
Dim adocon As New ADODB.Connection
Try
adocon = New ADODB.Connection
adocon.ConnectionString = adoconstr
adocon.CursorLocation = ADODB.CursorLocationEnum.adUseClient
adocon.Open()
adocmd = New ADODB.Command
adocmd.ActiveConnection = adocon
adocmd.CommandText = ssql
adocmd.Execute(sqlexec)
rowsAffected = sqlexec
Catch ex As Exception
log.Debug(ex.ToString)
Throw (ex)
Finally
If adocon.State <> ConnectionState.Closed Then
adocon.Close()
adocon = Nothing
adocmd = Nothing
End If
End Try
End Sub C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
Your Access database is being copied to the bin folder of your app every time you compile and run it. Now you have to two copies of your database. The original one that was added to the project and the copy that is being used by your app every time you run it. So, if it's being copied every time you run the app, all of the changes your code makes to the copy are being overwritten when you start the app again.
|
|
|
|
|
Exactly you are correct. I just check this time and this is the two folder you are saying. Now, I know why they are overwritten every time I start the app again. What can you suggest or I should do so that I can use only the access database inside the project folder not the bin folder.
Heres my config file.
(connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Database\DrinkingWater.mdb;Persist Security Info=True"<br />
providerName="System.Data.OleDb" )
C:..\\Visual Studio 2005\Projects\DrinkingWater\DrinkingWater\bin\Debug\Database<br />
Inside the bin folder<br />
{DrinkingWater.ldb} → lock <br />
{DrinkingWater.mdb} → database<br />
<br />
C:..\\Visual Studio 2005\Projects\DrinkingWater\DrinkingWater\Database<br />
Inside the Project Folder<br />
{DrinkingWater.mdb} C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
That would require you to write your code specifically to handle the case where the database file is sitting X number of folders above where your app is. It's a bad idea to write your application like that. All you do is click on the database file in the Solution Explorer, then look in the Properties window below it (by default!) There is a Copy to Output Directory property there. Change that option to "Copy if newer" and the file will no longer be copied to the bin folder unless you update the database file in the Project folder.
|
|
|
|
|
Hi Dave. This is AWESOME!
A big thanks to you mate. At last, I solve this problem, i did not notice that I should change that output directory to "Copy if newer". Thank you so much.
Whew!!! I can sleep now.C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
I learnt something today too. I was waiting to see what the answer to this was!
|
|
|
|
|
And maybe it will be more interesting on Vista or Win7 if you create a setup ...
|
|
|
|
|
Hello To all,
Actually i want to print the Richtextbox Content. There are a Diffrent Texts(Bold,Italic,Different Size ,Different Fonts ),Image Hyperlink,Icon.
So Please Help me for doing that.
ThanksIf you can think then I Can.
|
|
|
|
|
I think the best way to do that would be to save the contents into a Rich Text Format(.rtf) file and then print that file contents.
|
|
|
|