|
Best Regards,
Apurva Kaushal
|
|
|
|
|
Can any body please tell me difference in early and late binding (in VB6) along with example or link.
|
|
|
|
|
Basically: with early binding the compiler knows the type of object at compile time. With late binding, the type of object is only known at runtime.
There are cases for using one or the other but my preference would be for early binding where possible because many problems and type-related issues can be sorted out during development. If you late bind, some problems may not be evident until your application is live!
There are many samples of this on the web - including The Code Project. Simply search for them.
In the meantime, very brief samples are shown below...
' Early Binding
' Compiler knows what type x is.
Dim x As Word.Application
Set x = New Word.Application
' Late Binding:
' Only know what type x is at runtime.
Dim x As Object
Set x = CreateObject("Word.Application")
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
In addition to what Steve said, I should add that early-binding is much much faster than late-binding and is the only case to select (unless you HAVE TO use late-binding) for example when you don't have compile-time access to the COM...
|
|
|
|
|
I ve added skin in my dotnetnuke project it is uploading correctly but when i want to view that in my site under portal sin and admin skin i am not able to see it.
I need urgent help.
aashutosh tiwari(aashutosh.tiwari@sakasolutions.com)
|
|
|
|
|
I have the below source code:
<webservice(namespace:="http: tempuri.org="" ")=""> _
<webservicebinding(conformsto:=wsiprofiles.basicprofile1_1)> _
<global.microsoft.visualbasic.compilerservices.designergenerated()> _
<policy("servicepolicy")> _ '(or <policy(gettype(usernamepolicy))> _ )
Public Class Service
Inherits System.Web.Services.WebService
<webmethod()> _
Public Function test1() As String
Return "Test1 Function Called"
End Function
<webmethod()> _
Public Function test2() As String
Return "Test2 Function Called"
End Function
End Class 'Service
Now I want to do 2 things:
1. The policy will be only applied for test1 Function, not Function test2()
( some things like that:
<webservice(namespace:="http: tempuri.org="" ")=""> _
<webservicebinding(conformsto:=wsiprofiles.basicprofile1_1)> _
<global.microsoft.visualbasic.compilerservices.designergenerated()> _
Public Class Service
Inherits System.Web.Services.WebService
'The policy will be applied for test1 function
<policy("servicepolicy")> _
<webmethod()> _
Public Function test1() As String
Return "Test1 Function Called"
End Function
'and the policy will not be applied for test2 function
<webmethod()> _
Public Function test2() As String
Return "Test2 Function Called"
End Function
)
2. By using an application the Admin can configure what policy will apply on the web service without rebuild (recompile) the web service.
( The service is deployed on IIS server, and then the admin will use another application to configure that web service)
Thanks in advance!
Hung.
Hung
|
|
|
|
|
I'm a senior student. I'm making graduation report so I need your help!
I have MDI application with MainMenu on FormMain. When runtime i opened a childform,i do something on it and i want to control(enable/disable) some of MenuItem on MainMenu. This is my code:
//////Module/////
Module class......
public sub ControlMenu(Byval mnu as system.windows.forms.form.MenuItem,Byval bool as boolean)
mnu.enable=bool
end sub
........
End class
////////FormMain////
Class FormMain
..declare some var
...
private child as ChildForm
.....
//event MenuItem childform.click()
private sub childform_click(byval sender as object, byval e as ...)Handle childform.click
child =new childform
child.MdiParent=Me
child.show()
end sub
....
End Class
/////ChildForm//////
Class ChildForm
..do something
//set a MenuItem
Me.parent.ControlMenu(NameOfmnuItem,fasle)
//Close child form
Me.close (or Me.hide)
End Class
But I get an error or ControlMenu not declare this show up whenever i move mouse on Me.parent.ControlMenu(NameOfmnuItem,fasle). Everybody help me Plz. Thanks
|
|
|
|
|
Seems like the documentation says that the API call to Logonuser does
not work under the Windows 2000 platform. If I have a username, domain, and password
how do I get a token for impersonation?
Better yet how do I impersonate this username and password if I don't use Logonuser
Thanks
|
|
|
|
|
|
I think I am on the right track. Where do I get a list of what all of these codes mean. I am geeting a failure code of 1314 when I run LogonUser.
Thanks
|
|
|
|
|
|
I figured this out. Whom ever the authenicated user running the application is must have
the "Act on behalf of operating system set" under the local security policy settings. If this
privledge is not set then LOGONUSER Fauls.
|
|
|
|
|
I was wondering if it's possible to embed VB.NET class libaries into Internet Explorer. I'm not using ASP.NET. I've been trying to create a cab file and deploy it that way but the control never seems to register. It works fine on my local machine but when I upload it to a server and try to initiate the object I get the ugly X. Thanks for the help.
|
|
|
|
|
Hi!,
I want to store and build a tree (using the control treeview of windows forms) from database table.
Some people say to me that the table structure is like:
Table Name : TUserStruct
Table Fields of TUserStruct : iNodeParent, vcNodeText
And the functions are recursive.
Please some body do this?, is possible send the code...
Thank you.
gangeles
|
|
|
|
|
Hi everyone,
I'm debugging some code that we just migrated from 1.1 to 2.0 net. I'm running into some .vb code that was working before.
Dim oParamMod As New Reflection.ParameterModifier(2)
oParamMod(0) = True
oParamMod(1) = True
Dim aParamMod() As Reflection.ParameterModifier = {oParamMod}
After I "dim" the oParamMod, I can hover over it and I get the message:
"In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user."
Similar code is running fine in c# but no vb. Anyone else run into this issue? It's like vb doesn't like the ParameterModifier anymore.
Thanks, Jessica
|
|
|
|
|
I have been trying for couple of days now to send 1 byte of data through the serial port to a processor. I have tried multiple different coding schemes I see the com port. It seems to send it but as far as I can tell nothing.... I am using a usb to serial converter... My system sees it as COM1 no problem I detect when I tell the program to find serial ports. finds it...
This is the code in question
using com1 as io.ports .serialport=
my.computer.ports.openserialport("COM1")
com1.writeline(hex(data1)
end using
This is just a byte of data that I need to send. Then I need to receive the data on the same port.... I am at my wits end.... I have put textboxes in place to monitor portions of the code and set breakpoints and it walking through the code.. no problem... so I am not sure what is going on...
Any ideas....
Scott
|
|
|
|
|
It's possible that your code may be fine.
Try communicating via Windows HyperTerminal first. That way you can verify that your cabling and serial port settings are correct.
|
|
|
|
|
okay.. my hardware through hyperterminal works just fine.... I get a my led to flash... using com1 as my port....
Scott
|
|
|
|
|
If all I am sending is a byte would it be correct to use serialport.write.method (byte[],int32,int32) where it only one byte....
Scott
|
|
|
|
|
wtfskh wrote: If all I am sending is a byte would it be correct to use serialport.write.method (byte[],int32,int32) where it only one byte.
Yes, that'll work fine. Are you sure you don't have to send an end character to it too? Like an ETX or CR/LF?
Also, are you setting up the Serial Port settings such as baud rate, data bits, stop bits, parity, etc.? I didn't see that code in your original post.
Here's a reference to the SerialPort[^] class documentation on MSDN in case you weren't aware of it. There's a VB.NET example in that doc.
|
|
|
|
|
All I am a sending is one byte of data to another processor that does something and in return I get data from another processor in a different location. The byte of data is an address to a remote station which will use that to send data back after an a/d conversion which will get displayed. It is dedicated system. The programmer for the processor is driving the baud rate I think a bit too slow but he won't speed it up and won't let any one see his actual code.
I have to thank you.. I have been looking for that documentation for about 2 days now. I didn't put that up but yes I have set baudrate, databits, stop bits = 1200, 8, 1. No parity, no handshaking.. I realized tonight that I wasn't opening up the com port as part of my code about 615. I went on a mad search to find the correct syntax.. very hard to find. The class documentation shows me the correct the syntax. This is for a senior project that is due by the end of next week for senior design show.
I was using vb6 but after I realized that some of the code I was trying to write didn't have documentation behind it so I (within the last 2 weeks) upgraded to vb 2005 express.... most of the code imported pretty good there were only a few minor changes that needed to made to get the rest of it work correctly..
Scott
|
|
|
|
|
Sounds like a good project. A very realistic experience.
If it works with HyperTerminal, then there's no reason why it shouldn't work with your app. There must be a bug somewhere.
We need to verify that your app is actually sending a byte out of the serial port. An easy way to do this is to connect your COM1 to your PC's COM2 if you have one. If you don't have another COM port, then connect it to another PC's COM port. Next, launch HyperTerminal that's setup for that other COM port. Then you should launch your app and verify that its bytes are appearing in HyperTerminal. If the bytes are showing up, then your transmission is working fine.
|
|
|
|
|
wtfskh wrote: The programmer for the processor is driving the baud rate I think a bit too slow but he won't speed it up and won't let any one see his actual code.
Hmmm... are you then sure that the 1200/8/1/n setting is correct? Another possibility is the cable you are using to connect to the device is either faulty, incorrectly connected wrt: pinouts or electrically incompatible. (If you are using ribbon cable then you could get all sorts of RFI and wierd signals interfering with the comms. Are the RTS and CTS signals latched to the correct levels?
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
Yes I am sure it is correct because I argued with the firmware programmer to up to speed to at least 19.6k and he won't says it is too fast... We are not using rts and cts... not practicable in the application as it stands. Yes it does work with a small app that the firmware programmer found in VB6, I think, but only sends one byte of data then you have to do to conversion. We are using a standard rs-232 cable the only difference is that I have use a usb to 232 because my laptop didn't come with a straight 232 connection. I did have to update my driver for it it was 3 yrs old and a newer one was available which is two yrs newer than the one I got with the device.
Scott
|
|
|
|
|
I am looking at the code online and all it does is frustrate me... what the hell is instance stand for in a term like this...
Dim instance As SerialPort
Dim buffer As Byte()
Dim offset As Integer
Dim count As Integer
instance.Write(buffer, offset, count)
I would write
dim port as serialport
dim buffer as byte()
dim offset as integer =0
dim count as integer =1
port.write(byte(), offset, count)
|
|
|
|