|
The error you posted is useless. It doesn't provide any details that can be used to diagnose the problem. You need the error from GetLastError to have any meaningful error code.
We'd also need to see your PInvoke headers for these two functions. It's possible the wrong datatypes have been used to declare the parameters passed into the functions.
|
|
|
|
|
Just a thought as I had something similar. Did you compile for 32 bit? I had to specifically compile for 32 bit before an app would run on Windows 7 64 bit.
|
|
|
|
|
Thanks for the help.
I had compiled all the solution for 32 bit. Now it is working great.
Thanks,
Sri
|
|
|
|
|
Hi,
I am new to VB6,
I need to Create a object of VLicense class present in the XYZ namespace in the XYZ.dll. This will take path to license file, So i have to pass the path of the licence file while creating the object of VLicense. Next, I have to call two public methods of this class object - "IsLicenseValid" and "IsCorrectDate" both returning Boolean value.
Progress :
XYZ.dll is created in .net, So I have created XYZ.tlb to use in VB6. I have also added the reference of the .tlb in the project.
Dim myObject As XYZ.VLicense
(XYZ. is displaying all the methods of the dll)
Now how to proceed from here? I need to create a object of the class and set a path.Please help.
Thanks in Advance,modified on Tuesday, March 2, 2010 1:52 AM
|
|
|
|
|
karthickmani63 wrote: I am new to VB6
You should not be using this old technology. I would suggest you move to VB.NET immediately. You can download the free version of the VB.NET IDE from here[^].txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Richard MacCutchan wrote: You should not be using this old technology
What if he is maintaining legacy software? But yes I agree, I would not start a new project in VB6 and would even think hard about writing new modules/DLLs in VB6 when you can write them in VB.NET and make them COM visible.Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Steven J Jowett wrote: What if he is maintaining legacy software?
A fair point which I did not take into account.
[edit]Judging by your avatar your team must take some controlling [/edit]txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
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.
|
|
|
|