|
Uhhh... WHAT??
|
|
|
|
|
I love these forums. Sorry Dave, but I have to say, the VB one is the worst. People with no idea trying to answer questions, I assume b/c they think a CP MVP would help them get a job.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian Graus wrote: I love these forums. Sorry Dave, but I have to say, the VB one is the worst. People with no idea trying to answer questions,
No kidding. Over the last 5 years, I've watched the quality of questions just plummet, most likely due to the outsourcing boom. Now, those same people think less than a years experience makes them qualified to write articles and answer questions.
This is why I don't trust anything I read on the web any more!
|
|
|
|
|
Yeah, I am sure that outsourcing is the problem. I am sure people are hired in parts of the world and given a desk, a PC, and the URL to our forums.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian Graus wrote: I am sure people are hired in parts of the world and given a desk, a PC, and the URL to our forums.
After dealing with a few of these companies, I <seriously>wouldn't be surprised!</seriously>
|
|
|
|
|
|
Would you ever come up with a crack-smoking answer as the one that started this part of of the thread?
|
|
|
|
|
No
Or as a joke wich would be clearly marked with the joke icon (and perhaps even stated in the message and only if the question really warented it).
Have to admit my first reaction when I read his answer was the same as yours. And I do agree with your statement that the level of questions asked here has decreased exponentially.
But I guess this all comes down to that age old argument of generalization. Just because there are a few (ok I admit alot) off bad ones doesn't mean they all are. (I'v had my share of encounters with some of that kind aswell)
|
|
|
|
|
Dave Kreskowiak wrote: Would you ever come up with a crack-smoking answer as the one that started this part of of the thread?
Pass what he was smoking.........time to take a trip to la-la land.
Agreed on outsourcing and given a direct link to this and other forums.
This may sound awful, but I have a list of four “special” users I will never respond to because the questions they post are entirely to basic and never provide any specific work (IE: "I need to create a contact database using VB, how do I do that?"), or when you do give the OP the correct answer or links to suitable examples (often line by line nonetheless) - they always bash you on the score.
In all seriousness, I hope that my orig. question wasn’t too basic in nature. I tried to Google the answer, but kept finding the assembly.load examples which didn’t apply. If you find that one of my questions isn’t up to snuff, just let me know so that I can correct myself in the future.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Your question was actually a good one. It's just that first answer you got what a " " moment.
If the question is good and the poster has added enough detail to prove some research effort, I don't have a problem with answering those "basic" questions at all. It's the ones who don't know how to, or don't want to, do any research that really irks me. Then to have someone follow up with a wild, off-the-wall, totally stupid and unresearched answer like that ... wow. It doesn't do anyone any good if the answer is just a wild guess.
|
|
|
|
|
The question -
"Is it possible to create and instantiate a VB6 .dll in VB .Net without having a reference to the VB6 .dll? I tried to use the Assembly.LoadFrom method, which doesn't seem to work (and probably isn't intended for ActiveX .dlls). "
My answer -
"Can you just create an assembly with the name VB6.dll?"
Perhaps I should have said...
"Yes. Create a .NET assembly called VB6.dll and use that if you need an instance of the assembly by that name."
He never said he needed the functionality of the VB6.dll (why would he even want it?), and the question was so odd that I could not help myself with a minimalist effort and a bit of infamous NJ sarcasm.
So... now you can get the hell off me. Just because I don't have the MicrosoftsValuablePenis award in my sig doesn't mean I am any less capable or competent than any of you.
|
|
|
|
|
astanton1978 wrote: He never said he needed the functionality of the VB6.dll (why would he even want it?), and the question was so odd that I could not help myself with a minimalist effort and a bit of infamous NJ sarcasm.
Not sure I am following you.......why wouldn't you want to use custom working .dlls (even if they were not created solely in .Net)? We have several large custom .dlls and others that we rely on which control manufacturing devices; so converting everything at once is not viable. Normally, we would add a reference and use it like normal.
We have a 'object checker' utility (created in vb6) which basically just uses CreateObject and attempts to instantiate an object for each .dll used by any one of our apps (helps figure out possible registration or missing files on the clients). Since there is interop going on, I modified this app to test all .Net and VB6 interop .dlls.... so I just need to be able to create an obj variable for each type of .dll without having any actual references.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
astanton1978 wrote: He never said he needed the functionality of the VB6.dll (why would he even want it?), and the question was so odd
His question was perfectly understandable. It's your answer that threw me for loop. And you still persist with the "VB6.dll" name, when that wasn't even part of the question. The name of the assembly doesn't matter.
astanton1978 wrote: So... now you can get the hell off me. Just because I don't have the MicrosoftsValuablePenis award in my sig doesn't mean I am any less capable or competent than any of you.
All you had to do was ask for clarification of what his intent was. Now, this remark, ... really??
|
|
|
|
|
Look at the question. "How to create a VB6 .dll object without having the .dll added as a reference?"
That remark was just for you , since you decided to rip on me for reading his question differently.
|
|
|
|
|
Note the space between VB6 and .DLL. Allow me to rephrase:
How to [instantiate] an object [from a class] in a .DLL created with VB6.
|
|
|
|
|
Howabout that. See, now that makes perfect sense.
You are hereby nominated as official question translator for literal readers.
|
|
|
|
|
It's possible using Reflection, but I highly recommend against it. Since you'll have no early binding, just writing the code will consists of constantly using Reflection to discover and call all the methods in the thing. You also lose all type checking at compile and runtime, and no Intellisense while in the IDE. A nightmare to say the least.
As for actually instantiating a COM-based object, you can do something like this:
Dim comType As Type = Type.GetTypeFromProgID("Scripting.FileSystemObject")
Dim comObject As Object = Activator.CreateInstance(comType)
This does not work unless the .DLL is regsitered properly. You cannot load it directly from the .DLL.
|
|
|
|
|
That's exactly what I was looking for Dave and your warning is duly noted.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
I have been trying unsuccessfully to get serialization to work over a network stream. I can get serialization to work when using a Filestream, so I think this means I am doing the serialization/deserialization part correct. I have gone so far as to just serialize a 16 bit integer, and still I get the IO Exception on deserialization:
End of Stream encountered before parsing was completed.
I have checked the lengths of the Filestream and the Networkstream and they both are identical. I have printed byte by byte the data sent through the Networkstream, and the data Recieved from the client Networkstream. Here are examples of how I serialize then send, and read data and then deserialize.
**************************Send Code*************************************************
Dim Test As Int16 = 88
'This Is Just A Compare For The FileStream To The Networkstream, and servers no other puprose
Dim DataFile As New System.IO.FileStream("c:\del1.bin", System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.None)
Serializer.Serialize(DataFile, Test)
DataFile.Close()
'Note The Length Of The DataFile Stream Is 52
Dim memStream As New System.IO.MemoryStream()
Serializer.Serialize(memStream, Test)
Dim buffer As Byte() = memStream.GetBuffer()
Debug.Print("Send Length = " + memStream.Length.ToString)
'Displays: Send Length = 52
Dim tt As String = ""
For i As Int16 = 0 To memStream.Length - 1
tt = tt + buffer(i).ToString + ","
Next
Debug.Print(tt)
'Displays: 0,1,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,4,1,0,0,0,12,83,121,115,116,101,109,46,73,110,116,49,54,1,0,0,0,7,109,95,118,97,108,117,101,0,7,88,0,11,
********************************************END SEND CODE**********************************************************************
********************************************Begin Receive Code*****************************************************************
Dim TCPClientsBytes(aryClients(intIndex).ReceiveBufferSize) As Byte
If aryClients(intIndex).GetStream.CanRead = True Then
intBytesRead = aryClients(intIndex).GetStream.Read(TCPClientsBytes, 0, CInt(aryClients(intIndex).ReceiveBufferSize))
End If
Dim Data As Int16 = 0
Dim Deserializer As New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
Dim mem As New System.IO.MemoryStream
mem.Write(TCPClientsBytes, 0, returndata.Length.ToString)
Debug.Print("Receive Length = " + mem.Length.ToString)
'Displays: Receive Length = 52
Dim tt As String = ""
For i As Int16 = 0 To mem.Length - 1
tt = tt + TCPClientsBytes(i).ToString + ","
Next
Debug.Print(tt)
'Displays: 0,1,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,4,1,0,0,0,12,83,121,115,116,101,109,46,73,110,116,49,54,1,0,0,0,7,109,95,118,97,108,117,101,0,7,88,0,11,
Try
'The statement below will throw an exception.....
Data = CType(Deserializer.Deserialize(mem), Int16)
Catch ex As Exception
Debug.Print(ex.Message)
'The exception text is below......
'A first chance exception of type 'System.Runtime.Serialization.SerializationException' occurred in mscorlib.dll
'End of Stream encountered before parsing was completed.
End Try
********************************************EndReceive Code*****************************************************************
Any help would be greatly appreciated!!!!!
|
|
|
|
|
|
Hello all
I need help to count node and their respective id.
<People>
<Person ID="001"> 1 </Person>
<Person ID="002"> 2 </Person>
</People>
how can i count person node..?? and Person Id = 001 & 002
Thanx in advance..
Shazz here to help you...
|
|
|
|
|
Assuming that People is the root of the document, you can iterate the nodes like this.
- Assumes the ID's are integers, you can change it to String if you want.
- written without syntax checking. Sorry if its a bit off, but you can get the idea.
Imports System.Xml
Private Sub CountNodes(xmlDoc as XmlDocument)
Dim xNode as XmlNode
Dim nodeName as String
Dim nodeCount as Integer
Dim listOfIDs as New List(Of Integer)
For Each xNode in xmlDoc.DocumentElement.ChildNodes
If String.IsNullOrEmpty(xNode.Name) = False Then
nodeName = xNode.Name.Trim().ToLower()
If nodeName = "person" Then
nodeCount++
If node.Attributes("ID") IsNot Nothing Then
listOfIDs.Add(Convert.ToInt32(node.GetAttributeValue("ID")))
End If 'node attr
End If 'node name
End If 'node has name
Next 'xNode
End Sub
You can also use Xpath Query to do the same, or if the nodes can be nested you will need a recursive function.
|
|
|
|
|
Thanx for your refernce code.
Partially its working fine though I am using VB6.0 application and your mention code belong to vb.net.
I am slight confuse for declaration of `Node` because non of IXMLDom related datatype have properties of GetAtttributeValues("ID").
Please guide me how can I proceed. I had search and i tried many things help.
Refernece as I had used "Microsoft XML v6.0"
Thanx in advance. Awaiting for your reply.
Shazz here to help you...
|
|
|
|
|
Sorry, I no longer have VB6 available to help you with this exactly.
The GetAttributeValues() method will get the value of an XMLNode (element)'s attribute. I cant find any IXMLDom documentation to look for a similar function, but if you can post a link I can try to find it.
|
|
|
|
|
Hello guys!!!!
I want more information about API call any articles and notes is there plzz send that link.
Ananda
|
|
|
|
|