|
Hi All
I have a working code written in VFP http://www.foxite.com/archives/use-notepad-on-a-scx-0000129391.htm[^]
I tried to convert it to Vb.Net but I get stuck in error appearing whatever I do
Declare Function SetParent Lib "user32" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As IntPtr
Declare Function WinExec Lib "kernel32" (ByVal lpCmdLine As String, ByVal nCmdShow As Long) As Long
Declare Function FindWindow Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim nHwnd As Long
' run notepad
WinExec("notepad.exe", 1)
' find its hwnd
nHwnd = FindWindow(Nothing, "Untitled - Notepad") ' <-- Error
' Note you must supply the EXACT Caption of the window)
' force it inside our form
SetParent(nHwnd, Me.Handle.ToInt32)
' size it
Dim nLeft, nTop, nWidth, nHeight As Integer
nLeft = Me.Panel11.Left
nTop = Me.Panel11.Top
nWidth = Me.Panel11.Width
nHeight = Me.Panel11.Height
SetWindowPos(nHwnd, 1, nLeft, nTop, nWidth, nHeight, 64)
End Sub
Error Message : "Arithmetic operation resulted in an overflow"
I tried to add Panel, and command button and picture same result.
Could some one check it please,
And is there is better idea to show external window such as Excel or Word.
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
First, scrap all of this. You don't need most of it. Your biggest problem is that you're using VB.NET and using VB6 code in it. You declared a bunch of stuff as Long, which under VB6, was a 32-bit signed integer and, under VB.NET, is a 64-bit signed integer. You cannot use the two types interchangably.
You can use this instead:
Private Declare Auto Function SetParent Lib "user32" (ByVal hwndChild As IntPtr, ByVal hwndParent As IntPtr) As IntPtr
...
' Launch a Notepad process and wait for it's window to be created.
Dim p As Process = Process.Start("Notepad.exe")
p.WaitForInputIdle()
' Then set it's parent window to a panel on our form.
SetParent(p.MainWindowHandle, Panel1.Handle)
|
|
|
|
|
|
Auto modifier
The Auto modifier instructs the runtime to convert the string based on the method name according to common language runtime rules (or alias name if specified).
|
|
|
|
|
No, it doesn't. When you create a declaration for a Win32 function, or some other external library function, some of these can come in two flavors, Ascii and Unicode (or Wide). For example, say you're digging around the MSDN documentation and find a function you need call SomeFunction. Well, you might see two version of if, one called SomeFunctionA and the other SomeFunctionW. Depending on which version of Windows you were running under, the W version of the function may not exist. So Auto will automcatically pick which function to bind to.
|
|
|
|
|
Dave Kreskowiak wrote: one called SomeFunctionA and the other SomeFunctionW
I have used API calls in VFP and vb6 for over than 5 years, I was able to customize the api to work as needed. I always copy the declaration from site or software.
Now, it is the first time I know why there is "A" or "W" at the end of the end of alias.
Many many thanks for this explanations.
Like car accidents, most hardware problems are due to driver error.
Samir R. Ibrahim
|
|
|
|
|
Hi friends,
I have created find window, which finds out user entered values in the listview and selects that particular listview item. But the problem is, the selected item color turns gray(i.e Main window gets de-activated or no focus).If I activate or focus main window, then find window loses focus...So "Find Next" option can't be used..
So friends,how to tackle this issue.....?
It should work just like "Find window" in MS Word or excel...
Please guide me...
Thanks in advance
|
|
|
|
|
You're showing it modal (ShowDialog() ), whilst you just want to show it (Show() ). Don't forget to set TopMost to true
I are troll
|
|
|
|
|
Thank you, thank you...Eddy
Actually, i had set it to Show()itself,
But TopMost was false
Thanks a lot friend...
|
|
|
|
|
My pleasure
I are troll
|
|
|
|
|
I have a text file that has lines as follows:
thanks in advance
modified 28-Nov-12 4:45am.
|
|
|
|
|
Hi vijay,
is the name list is array or table column?
|
|
|
|
|
Does this compile?
The line i = name.Substring(0, m) implies i is a string.
But in the sw.WriteLine(), name.Substring(0, i) implies i is an integer.
Are the lines in the text file indented by two spaces as in your example?
If so you could just drop lines that start with two spaces (assuming you don't trim them as you read them.)
Regards
David R
|
|
|
|
|
I am not a Programmer in fact i am amedical doctor a pediatrician by profession and do little bits in vb 6 out of my interest
Currently i wanted to create a math Solver in which the user input would as one would write on paper
My PROBLEM
here is the code now what i needed was to
1 get the same as typed in the rich text box into a textbox wich i want use for math parser
2.In the Textbox i wanted to have a caret sign("^")In the position i use the Up Arrow key in the Rich text box
<b>Need help Urgently </b>
Private Sub rtb1_KeyUp(KeyCode As Integer, Shift As Integer)
Me.KeyPreview = True
Dim SupEnt As Integer
Dim temp As Integer
SupEnt = rtb1.SelFontSize
temp = rtb1.SelCharOffset
Dim SelectionStart As String
Dim SelectionEnd As String
Dim selectedExp As String
Select Case KeyCode
Case vbKeyUp
rtb1.SelFontSize = SupEnt / 3 * 2
rtb1.SelCharOffset = temp + 100
rtb1.SelColor = vbRed
KeyCode = 0
Case vbKeyDown
rtb1.SelFontSize = SupEnt / 3 * 2
rtb1.SelCharOffset = temp - 100
rtb1.SelColor = vbGreen
rtb1.SelBold = True
KeyCode = 0
Case vbKeyLeft
'
Case vbKeyRight
rtb1.SelFontSize = 14
rtb1.SelCharOffset = 0
rtb1.SelColor = vbBlue
KeyCode = vbSpace
sText = rtb1.Text
sRight155 = Right$(sText, 1)
LastChar = Right$(sText, 1)
'
Clipboard.SetText rtb1.Text
myString = Clipboard.GetText
Text1.Text = Replace$(myString, LastChar, "^" + LastChar, 1, 1, vbTextCompare)
Clipboard.Clear
Case vbKeyReturn
End Select
End Sub
|
|
|
|
|
Hi .... everyone
I have a test code,I want to jump the check and all check is pass
(IsTrialPeriod,IsRegExpired,IsDoOncePeriod_CheckReg.... ,etc ....these check),so who can help me to modify the return value to pass program check , I don't want this code to make my future program to show register or any alert !
p.s. these is only test code for my homework , I just want to know how to jump the check fuction .
http://rapidshare.com/files/215636655/Program.txt.html[^]
garnett
|
|
|
|
|
You just want to cripple this check, kinda like this?
Private Shared Function IsRegExpired() As Boolean
Return False
End Function
These kinds of tests are usually built in such a way that bypassing them ranges from hard to impossible.
I are troll
|
|
|
|
|
hi,
i am new developer in vb.net.
i know db connect with local machine.
actually my project database is share with multiusers.
so how can set remote(LAN) database connection in vb.net?
please help for me!!!!
|
|
|
|
|
You put the database back end (ie: the file with the tables in it) on a server/shared location, and you address it like this:
\\servername\sharename\databasename.mdb
|
|
|
|
|
You can put your database file to your Server and connectionstring must have the name of Server,database name and database password.
Best Regard
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
Hi there - I am a newbie to the world of programming and have come across a huge stumbling block that is driving me wild.
I am trying to create an application that will get a list of all the xml files in a given directory, read through the contents of the xml files (they are all of identical format in terms of node/element structure) and populate a datagridview with the contents.
I have created an array of xml files and have been successful in binding one of the xml files to the dataset but I cant get it to iterate through the entire array. If I carry out the same task but output the contents of the xml file to a listbox it works successfully.
Can anybody help?
The problem code is:
Public Sub xmlReader2(ByVal dirPath As String)
Dim xmlfile As XmlReader
xmlfile = XmlTextReader.Create(dirPath)
Dim ds As New DataSet
ds.ReadXml(xmlfile)
DataGridView1.DataSource = ds.Tables(0)
End Sub
This sub is called by another sub which is iterating through the array. Like I say, I can output the information to a listbox so I presume the problem must be with the above code.
Hope some clever person can guide me in the right direction.
Thanks
|
|
|
|
|
Jordan1982 wrote: I am a newbie to the world of programming
I would suggest if you want long term success, you should abandon this task and focus on learning some basics first.
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 )
|
|
|
|
|
Hey im in the process of creating a railroute manager with VB as Front End and SQL Server as the Backend. It has a server and 3client layout (LAN). I have programs ready to be deployed asper the privledge levels on the server and the clients
And the doubts is How do I logically connect the systems and make my DBrelations on the server dynamic with client actions? I have heard that Socket Programming is something about it.
Im waiting for a response,......
|
|
|
|
|
Just curious if you were still waiting for a response and still drowning?
snicker, snicker.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
haha! i kinda smelled some humour..
people, im 12grader.. so there is no point in teasing me at the moment.. i know im a newbie at this...
this train is my miniproject... not any BPO assignment..
|
|
|
|
|
Your question is so general that it borders on unanswerable. Noone can give you a clear answer because your asking about how you should design your application, but provided no details about it that would drive an appropriate answer.
Also, the various parts of your question have nothing to do with each other! "Dynmaic relations" does imply any differences between how your data model would react to a users privilege level. On top of that, I fail to see how "Socket Programming" would affect how your data model is designed.
|
|
|
|
|