|
ok well the code in the example was just a quick mock up of the crux of the issue, and i didn't want variable names that implied i had a heap of code elsewhere which may be contributing to the problem that i wasn't showing you guys , so you got "line" lol
I figured out that everything is referenced from the top left but I still thought if you said box.bottom that would return a real screen point ,it still seems strange to me that this isn't the case however
the rubber band thing makes sense now you have put it in some context , i had noticed that the drawings would disappear if you waved another form over the top
because i am working on a graphing control how would i make the the plotted line disappear when i want to change the data being plotted if I use the paint event ,without losing the whole graph as Luc points out graphics are expensive and can take a moment to generate,which is why I swapped from the line shape control as that seemed to take a particularly long time to draw a lot of lines
which prompts the question how do you know when your starting out that your using the right tool for the job , its quite frustrating to write a heap of code only to find that the tool your using doesn't quite do it (line shape!),then you jump on the net and do a bit of homework and start again with a code example that uses create.graphics within a picture box ,and now obviously that wasnt the way forward ,so its time to start again
I see the paint event in the events list I will look into coding within that tomorrow
thank you so much for the advice ,at least I have a place to continue on with (start again)
|
|
|
|
|
Showing fake code when you have a problem does not make sense to me, it just wastes everyone's time.
Wankel Maggot wrote: as Luc points out graphics are expensive
No I said a Graphics is expensive, that is an instance of class Graphics. Not the few tens or hundreds of lines you are probably drawing.
|
|
|
|
|
Wankel Maggot wrote: I still thought if you said box.bottom that would return a real screen point ,it still seems strange to me that this isn't the case however
It is a real point, it's the bottom of the picture box, where-ever that is, in the form.
Wankel Maggot wrote: because i am working on a graphing control how would i make the the plotted line disappear when i want to change the data being plotted
calling Invalidate() on the form causes it to redraw itself. You use variables to get the form to draw the graph inside the paint event however it is meant to be at that point in time.
Wankel Maggot wrote: how do you know when your starting out that your using the right tool for the job
Buy a book, read MSDN, etc. I don't know why so many people use CreateGraphics, it seems to be a point of ignorance that has really taken off, which I assume means that you've googled and found examples of people doing this. A book is your best bet, because unlike a forum post, it's been edited and proof read.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
ok well thanks for your help
also are you serious Luc,it isn't "fake code" it is exactly my problem without the other several blocks of code that you would have had to trawl through looking for the problem ,i would have thought thats wasting your time
however in future i will post "real" code , if thats the way things are done
sorry for the noob posting errors
also one last question which line drawing tool would you use within the paint event
or do i use the same drawing tool as in the code example ,but use the paint event as the constructor
sorry if my terminology is not correct
modified on Monday, May 4, 2009 6:36 AM
|
|
|
|
|
You use the same "drawing tool". The system is just passing you the Graphics object you should use.
|
|
|
|
|
Hi,
Kindly let me know that, which library/refrence will be used to use filestream and
streamReader ?
because when i use following command so "StreamReader" is not appearing after typing "New" !
Dim sr As New StreamReader
Thank you
(Riaz)
modified on Monday, May 4, 2009 2:19 AM
|
|
|
|
|
VB6 is out of date, and was always rubbish. You'll find it very hard to get much support if you choose not to use a real language. Even MS has not supported it for quite some time.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
you could try to first put the import statement that will bring forward the attributes of the stream reader
|
|
|
|
|
Christian is right, forget about VB6.
Please download Visual Studio 2008 (it is free), and start using .net
After that use System.IO (System.IO.StreamReader, etc.). It has everything you need to manipulate files.
My advice is free, and you may get what you paid for.
|
|
|
|
|
if you want to manipulate, read, and create ASCII and Unicode text files use FileSystemObject. For this we need to add the file reference,
Microsoft Scripting Runtime library.
There is no FileStream or StreamReader as such, you can use FileStreamObject, TextStream instead.
|
|
|
|
|
That code will not work in VB6. You'll need to use VB.NET to use that code. You can get the Express Edition for free from here[^].
|
|
|
|
|
I have to writen the XML file in VB 6.0
<Globus xmlns:xsi = 'http://www.w3.org/2001/XMLSchema-instance'
xmlns = 'http://www.temenos.com/GLOBUS/OFSML/120'
xsi:schemaLocation = 'http://www.temenos.com/GLOBUS/OFSML/120 ../../xsd/ofsml.xsd'>
<ofsmlHeader xsi:nil="true" />
<serviceRequest >
<securityContext>
<userName>INPUTT</userName>
<password>123456</password>
<company>VN0010001</company>
</securityContext>
<ofsStandardEnquiry name = 'ACCOUNT-IBS'>
<selectionCriteria operand = "EQ">
<fieldName>ACCOUNT.NUMBER</fieldName>
<value>002100000415<</value>
</selectionCriteria>
</ofsStandardEnquiry>
</serviceRequest>
</Globus>
So i have written as
Dim objDOM As New MSXML2.DOMDocument30
Dim objnode As MSXML2.IXMLDOMNode
Dim objChildNode As MSXML2.IXMLDOMNode
Dim ObjServicereq As MSXML2.IXMLDOMNode
Dim objserviceCon As MSXML2.IXMLDOMNode
Dim ofsStandardEnquiry As MSXML2.IXMLDOMNode
Dim objattribute As MSXML2.IXMLDOMAttribute
Dim objattribute1 As MSXML2.IXMLDOMAttribute
Dim objattribute2 As MSXML2.IXMLDOMAttribute
Dim objelement As MSXML2.IXMLDOMElement
Dim objelement1 As MSXML2.IXMLDOMElement
Dim objattribute3 As MSXML2.IXMLDOMAttribute
Dim objattribute4 As MSXML2.IXMLDOMAttribute
Dim objattribute5 As MSXML2.IXMLDOMAttribute
' Set objNode = objDOM.createNode(NODE_PROCESSING_INSTRUCTION, "xml", "")
' objDOM.appendChild objNode
'
Set objnode = objDOM.createNode(NODE_ELEMENT, "GLOBUS", "")
Set objelement = objnode
'
Set objattribute = objDOM.createAttribute("xmlns:xsi")
objattribute.Text = "http://www.w3.org/2001/XMLSchema-instance"
objelement.setAttributeNode objattribute
'
Set objattribute1 = objDOM.createAttribute("xmlns")
objattribute1.Text = "http://www.temenos.com/GLOBUS/OFSML/120"
objelement.setAttributeNode objattribute1
Set objattribute2 = objDOM.createAttribute("xsi:schemaLocation")
objattribute2.Text = "http://www.temenos.com/GLOBUS/OFSML/120 ../../xsd/ofsml.xsd"
objelement.setAttributeNode objattribute2
'
Set objattribute = Nothing
Set objattribute1 = Nothing
Set objattribute2 = Nothing
Set objChildNode = objDOM.createNode(NODE_ELEMENT, "ofsmlHeader", "")
Set objattribute3 = objDOM.createAttribute("xsi:nil")
objattribute3.Text = "true"
Set objelement1 = objChildNode
objnode.appendChild objChildNode
objelement1.setAttributeNode objattribute3
Set objelement1 = Nothing
Set ObjServicereq = objDOM.createNode(NODE_ELEMENT, "serviceRequest", "")
objChildNode.appendChild ObjServicereq
Set objserviceCon = objDOM.createNode(NODE_ELEMENT, "securityContext", "")
Dim xmlElmName As MSXML2.IXMLDOMElement
Set xmlElmName = objDOM.createElement("userName")
objserviceCon.appendChild xmlElmName
xmlElmName.Text = "INPUTT"
Dim xmlElmPASSWORD As MSXML2.IXMLDOMElement
Set xmlElmPASSWORD = objDOM.createElement("password")
objserviceCon.appendChild xmlElmPASSWORD
xmlElmPASSWORD.Text = "123456"
Dim xmlElmcompany As MSXML2.IXMLDOMElement
Set xmlElmcompany = objDOM.createElement("company")
objserviceCon.appendChild xmlElmcompany
xmlElmcompany.Text = "VN0010001"
objnode.appendChild ObjServicereq
ObjServicereq.appendChild objserviceCon
Set objserviceCon = Nothing
Set ofsStandardEnquiry = objDOM.createNode(NODE_ELEMENT, "ofsStandardEnquiry", "")
Set objattribute4 = objDOM.createAttribute("NAME")
objattribute4.Text = "ACCOUNT-IBS"
Set objelement = ofsStandardEnquiry
objnode.appendChild ofsStandardEnquiry
objelement.setAttributeNode objattribute4
ObjServicereq.appendChild ofsStandardEnquiry
Dim objselectioncriteria As MSXML2.IXMLDOMNode
Set objselectioncriteria = objDOM.createNode(NODE_ELEMENT, "selectionCriteria", "")
Set objattribute5 = objDOM.createAttribute("Operand")
objattribute5.Text = "EQ"
Set objelement = objselectioncriteria
ObjServicereq.appendChild objselectioncriteria
objelement.setAttributeNode objattribute5
Set objelement = Nothing
Dim xmlElmfieldName As MSXML2.IXMLDOMElement
Set xmlElmfieldName = objDOM.createElement("fieldName")
objselectioncriteria.appendChild xmlElmfieldName
xmlElmfieldName.Text = "CUSTOMER.CODE"
Dim xmlElmvalue As MSXML2.IXMLDOMElement
Set xmlElmvalue = objDOM.createElement("value")
objselectioncriteria.appendChild xmlElmvalue
xmlElmvalue.Text = "100297"
objnode.appendChild ObjServicereq
objDOM.appendChild objnode
Set objelement = Nothing
Set objChildNode = Nothing
Set objselectioncriteria = Nothing
Set ofsStandardEnquiry = Nothing
Set ObjServicereq = Nothing
Set objnode = Nothing
MsgBox objDOM.xml
objDOM.save ("C:\SCBDATA\Request\Request_ACC.XML")
Debug.Print objDOM.xml
Set objDOM = Nothing
' Call GENCUST
End Sub
but i get output as
<Globus xmlns:xsi = 'http://www.w3.org/2001/XMLSchema-instance'
xmlns = 'http://www.temenos.com/GLOBUS/OFSML/120'
xsi:schemaLocation = 'http://www.temenos.com/GLOBUS/OFSML/120 ../../xsd/ofsml.xsd'>;
<ofsmlHeader xmlns = "" xsi:nil="true" />;
<serviceRequest xmlns = "" >
<securityContext>
<userName>INPUTT</userName>
<password>123456</password>;
<company>VN0010001</company>;
</securityContext>;
<ofsStandardEnquiry name = 'ACCOUNT-IBS'>
<selectionCriteria operand = "EQ">
<fieldName>ACCOUNT.NUMBER<</fieldName>
<value>002100000415</value>
</selectionCriteria>
</ofsStandardEnquiry>
</serviceRequest>
</Globus>
xmlns = "" is repeating at ofsmlheaser and service request ,.. please help me like how to write it by getting it correctly .
So please suggest me any way in VB 6.o to make the xmlns="" no get repeated for child nodes ...
|
|
|
|
|
Member 6161367 wrote: in VB 6.o
VB6 had terrible XML support, which follows, because it was a terrible joke of a language. Why are you using it ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
hi christian,
I was given this task in vb 6.0 only,So i suggest any one to tell me like what can be apossible way to stop that xmlns="" not to get repeated in other child nodes ..
Can u please suggest me some way .As we r forced to genearte a n XML file in vb 6.0 we require ur help in thsi context ...
Thanks,
Pallavi.
|
|
|
|
|
Hello Experts.
I am try to create Employee Payroll in Excel Sheet using VB.Net.
using Excel.Application, Excel.Workbook, Excel.Worksheet insert data and formatting data.
After the save this Excel Workbook.
I try to display this excel sheet in VB.NET Form.
Now my problem is I m using Web browser it is working properly.
But When i open this program other excel Book(Opened Book) is not working in Excel 2003/ not displaying and I can't open new Excel sheet using Excel 2003 Until closing my Programming.
Please Help me.
Thanks in advance.
|
|
|
|
|
I want to write an application to read data from a specific IP address and Port. I have been searching for solutions on internet and understand that I need to use TCPlistener.
- My PC will act as server or client? does it matter when i write the application?
- how can I test my Tcplistener application? I would like to send data to a port and read it using my application and send data back. Please let me know if i need to edit any setting on router as well.
thanks
chun
|
|
|
|
|
Chun2 wrote: I want to write an application to read data from a specific IP address and Port
Are you says that you want to monitor the traffic going to/from that IP?? Is that IP on your machine or another, remote, machine??
|
|
|
|
|
hello everyone,
I would like to know how can i read the IP address!can anyone help me?
Thank you !
|
|
|
|
|
Start
run
cmd.exe
ipconfig
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
You not help me!in vb i mean!
|
|
|
|
|
|
|
You can use VB.Net class to get the local IP or by using Winsock Object
I don't know if they are both the same (Winsock is included in vb.net class)
#1
Dim _WinSock As Object
Dim _LocalIP As String
_WinSock = CreateObject("mswinsock.winsock")
_LocalIP = Trim(_WinSock.LocalIP)
Debug.print(_LocalIP)
#2
Dim _HostName = System.Net.Dns.GetHostName()
Dim _IPAdress = System.Net.Dns.GetHostAddresses(_HostName)(0).ToString
Debug.Print(_IPAdress)
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
Hi,
your computer does not know what its public IP address is, since that depends on how you connect to the internet; intervening devices (your DSL modem, your provider, ..) can alter your public IP address. The only way to get it, is by getting it returned from some web site.
I have a page that does exactly that: http://www.perceler.com/getipadr1.php[^]. Send a WebRequest for it, and get the Response.
|
|
|
|
|
Nice Site
And here is the code to do it.
Dim _xmlHTTP
Dim _URL As String
_xmlHTTP = CreateObject("MSXML2.XMLHTTP")
_URL = "http://www.perceler.com/getipadr1.php"
_xmlHTTP.Open("GET", _URL, False)
_xmlHTTP.Send()
Debug.Print(_xmlHTTP.responseText)
Is that what you mean by WebRequest ?
I am asking to learn more feature. Thanks.
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|