|
|
I want undo a text in richtextbox suchas in notepad.exe
How create new form effect richtextbox of previous form (such as form find&replace in notepad.exe)
|
|
|
|
|
Hi,
I am upgrading an application from Vb6 to Vb.net. I am facing a problem in converting Propertybag object. Like it is storing some value with .WriteProperty and then for retrieving .ReadProperty.
Can any one tell me Vb.Net equivalent for that?
thanks
Het Waghela
Be Humble in Victory and Strong in Defeat.
Het Waghela, Blog|Het Waghela DotNet Questions Link|More Links
|
|
|
|
|
NET does not support the PropertyBag object. You have to use NET Serialization instead. Do a MSDN search on Serialization to see simple implementations.
Robert
|
|
|
|
|
|
hello friends,
i want to know about the thread start in the VB.
how can i start the thread using ThreadStart in visual basic.
i use the CreateThread, CloseHandle, TerminateThread etc. but all these are not fulfilling my requirement.
i want when my task is over, the thread is terminated.
how it is possible?
please help me? here is a question of my job...
thanks
Gagan Deep Singla
Chandigarh - INDIA
|
|
|
|
|
Dim t As System.Threading.Thread
t = new Threading.Thread(AddressOf MySub)
t.Start()
The thread will terminate when the code reaches the end. A good way to do tasks in a thread is to encapsulate the thread and task in a class:
Public Class MyTaskClass
Private MyThread As Thread
Public Sub New
Me.MyThread = New Thread(AddressOf Me.MyTask)
End Sub
Public Sub Start
Me.MyThread.Start()
End Sub
Private Sub MyTask
'Start processing here
End Sub
End Class
You can add properties to the class which can be read after the thread has stopped. You can also raise events when something important happens in the thread, maybe telling you that there is important information available through the properties.
When the thread reaches the end of code, it stops. You can't restart it, so if you want to perform the task again, you have to create a new instance of the calss.
|
|
|
|
|
thanx for responsing sir,
i am not talking about the VB.net.
i am talking about vb6.0
if you can help me in that then this is benifial for me.
thank you
Gagan Deep Singla
Chandigarh - INDIA
|
|
|
|
|
Sorry, I do not remember any details of mutithreading in vb6. I played with it about 6 or 7 years ago and decided not to use vb6 for multithreading. Here is a link explaining some of the reasons not to do multithreading in vb6 (it also will point you towards a solution if you must persue multithreading in vb6):
http://www.freevbcode.com/ShowCode.Asp?ID=1287[^]
|
|
|
|
|
Thanx Sir,
i have already study that page completly but not satisfactory answer there.
i searh the google alot but proper use of the functions has not been explained anywhere...
actually i want the threads for copying large file..
i find a dll which is performing the task but author copy the data to the specified location not on mine....
now i am thinking to create a dll file using C# and then use that dll in the VB 6.0
so hopes for the best!
thanx for communicating me....
Bye
Gagan Deep Singla
Chandigarh - INDIA
|
|
|
|
|
There are many reasons why you won't find any answers for VB6, but the most common reason is because you can't debug the code you write. If you start a new thread while your application is running under the IDE debugger, you'll crash the IDE immediately. It wasn't written to handle multi-threaded code.
Now, if you have access to Visual Studio.NET and C#, why are you even wasting your time with VB6 in the first place? C# and VB.NET both make launching new threads and debugging them a trivial process.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanx for responding me sir,
you are right that i should use the C# except the VB6.
but my whole application is in VB6.
i am planning to make a DLL in C# and use that in VB6 after converting it into VB6 compatible.
can you tell me how can a C# DLL converted to VB6 compatible.
thanx again...
bye..
Gagan Deep Singla
Chandigarh - INDIA
|
|
|
|
|
It's not exactly an easy thing to do and understand if you don't already know the in's and out's of COM. You'll have to read up on COM Interop to find out, it's just way too much information to post here. You can start by looking at this[^] page. You've got a bunch of reading to do...
But, keep in mind that your C# .DLL won't work without the .NET Framework installed on the machines that are going to be running your application, even if it's written in VB6.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
sir, there is some command in the C# which converts the C# code to the VB6 compatible code. there is no need of .net framework for that. i am not dead sure about that but whenever i implement that then i will let you know.
we can convert the VB code to C# compatible and vice versa also. then it is totally become the VB6 code after converting it from C#.
command is related to tlbimp. this is just like that or need some R&D for that.
thanx for responsing me...
Gagan Deep Singla
Chandigarh - INDIA
|
|
|
|
|
Here we go again...
Gagan Deep Singla wrote:
there is some command in the C# which converts the C# code to the VB6 compatible code.
If your talking about NGen, you have a problem. NGen will generate a processor specific native version of the code. But, it will generate a version that only works on that processor. If you NGen an assembly on a Pentium 4, the code it can generate will NOT work on a Pentium III. There are even issues with the same processor, but different steppings (versions) of it! You can't tell it to generate code for a specific processor either. It's either the one that it's running on, or you don't run it.
Gagan Deep Singla wrote:
there is no need of .net framework for that. i am not dead sure about that but whenever i implement that then i will let you know.
If you write the thing in C#, you will need the .NET Framework to run it, period. End of story.
Gagan Deep Singla wrote:
we can convert the VB code to C# compatible and vice versa also. then it is totally become the VB6 code after converting it from C#.
No you're not. When you use a VB6 .DLL in a C# app, you're not converting the code to C#. You're actually creating a Runtime Callable Wrapper around the .DLL. This wrapper is an interface between the .NET world and the COM world that the .DLL runs in. It marshals calls and data back and forth between the two. It does NOT convert the code!
When you write a .NET Framework .DLL, the same thing happens when you need to run it in a COM application. This time, it's a COM Callable Wrapper that you have to generate for the .DLL to do the marshalling.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
Is there a way to read only the last 3 lines of a text file. Everything before the last 3 lines is not needed. The last 3 lines do change for each text file.
If any could help it would be great.
|
|
|
|
|
Try this:
OpenFile(1,filename,openmode.input)
Do until EOF(1)
i=+1
loop
For j=i-3 to i
read lines of text
next
FileClose(1)
There's just one thing I gotta say.."It's better to burn out than to fade away"
|
|
|
|
|
thanks for your help. how do i output this to a list box.
|
|
|
|
|
with a list box named data
lstdata.items.add("text")
There's just one thing I gotta say.."It's better to burn out than to fade away"
|
|
|
|
|
sorry, to make it more understandable just do:
listbox.items.add("text")
There's just one thing I gotta say.."It's better to burn out than to fade away"
|
|
|
|
|
hi guys,,
i'm working on an application which recieves a string value (in english or arabic), and i need to convert it into it hexadecimal value..!!
do any body knows how to do this in VB.Net..!??!
please help me in this as soon as possible..
any simple code will be helpfull..
thx for ur coorprate guys..
regards
Hani Aql
|
|
|
|
|
|
thx man for ur reply, i'v already seen and used this link, but this 1 always gives the same hexadecimal value for any string..!!! especially the arabic strings..!!! (
thx again..
|
|
|
|
|
Does it need to be in hex. You could calculate the crc32 of the string which is in hex format. I came across the code on the net before. If you can't find it you could use the MD5 hash of a string using the system.cryptography namespace. If I come across the crc32 code I will send it to you.
|
|
|
|
|
it seems that i need to encode the string using UCS2..!!
do u have any idea abt this..?!
sorry for my many queations, but i'm new to the encoding techniques and its my first time to need them in my application..!!!
any idea guys..??
|
|
|
|