|
Hi ALL
I want to design a program that compile a project when i run this program.i mean that i want to buld 2 program but the first program should give some parameters from user and then it build the second one base of that parameters. is here anyone to help me??
|
|
|
|
|
In case of writing a compiler, I guess it is much more complicated than to be answered here, and you may read a book on that.
If you had described your problem more clearly, we could possibly provide you with other solutions too.
But personally I guess that what you need is one of my problems long time ago, when I found the best and easiest method to use Microsoft Script Control ActiveX (msscript.ocx) which enables you to run scripts in VBS or JS in your program without any more need of writing a new compiler!
Hope it solves your problem too.
|
|
|
|
|
Hi
i think that i should ask my question clearly. i want to code 2 program. one of this programs are the main program that will run and it will be closed 5min after runing without any other thing. but this program need some parameters to be set for first time. and the user should be set this parameters. so i want the second program for setting this parameters. i want to run the second program to get parameters from user and ther buld the first program.
thanks
|
|
|
|
|
Why do you need a second program to set parameters for the first ?
The obvious way to run a program with parameters from another program is to pass them on the command line.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi
because i want the main program for doing a set of jobs automatically everyday(like backing up, coping some files,executing some batchfiles ...) but there are some parameters that shohld set one time for first time or may be change at sometimes. so i want to set them and put the main program in the scaduled tasks to run everey day. ok?
|
|
|
|
|
Still sounds to me like you want a preferences page in your main program, but either way, your app can manipulate settings that the main app accesses, either by being in the same directory, or by using the registry.
Where we've ended up is a long, long way from your original question. You want to have a program which sets up settings which are then read by your main program. You don't want your program to compile anything.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I have an application that pulls customer data from the database and prints a letter using the pulled data. There are times when there can be several thousand letters printed at a time and I am trying to find a way of doing this without sending several thousand single page jobs to the printer. I cannot set up a regular mailmerge as I have to allow the users to upload letter templates with different formatting, content, etc.
I thought that copying each letter into one larger doc, or a series of larger docs, would satisfy. But I am having trouble copying from my original letters into the merged document. I can copy the text using .Selection.SetText(myDoc) but the text seems only to be in plain text format.
This what I have come up with so far. I would really appreciate any advice.
<br />
Dim ofd As New OpenFileDialog<br />
ofd.ShowDialog()<br />
<br />
doc = CommonWordHelper.OpenDocument(wapp, ofd.FileName, False, False, False, False)<br />
newDoc = wapp.Documents.Add()<br />
<br />
<br />
doc.Activate()<br />
CommonWordHelper.InsertTextInBookmark(wapp, "Bookmark", "First insertion")<br />
<br />
doc.Select()<br />
My.Computer.Clipboard.SetText(wapp.Selection.Text)<br />
<br />
newDoc.Activate()<br />
wapp.Selection.PasteAndFormat(Word.WdRecoveryType.wdFormatOriginalFormatting)<br />
wapp.Selection.InsertBreak(Word.WdBreakType.wdPageBreak)<br />
<br />
<br />
doc.Activate()<br />
CommonWordHelper.InsertTextInBookmark(wapp, "Bookmark", "Second insertion")<br />
doc.Select()<br />
My.Computer.Clipboard.SetText(wapp.Selection.Text)<br />
newDoc.Activate()<br />
wapp.Selection.GoTo(Word.WdSectionStart.wdSectionNewPage)<br />
wapp.Selection.Paste()<br />
Thanks
Jim
|
|
|
|
|
How can i get the drive where the process was executed? :
|
|
|
|
|
Application.ExecutablePath contains the drive name.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i want to know this,through a combo box we select the different departments in a company,when we select the department the employees should be shown those who belong to that department in the datagrid .how can we do that?i need a help plz...
Harshi
|
|
|
|
|
Basically, you store the key for the department in the value of the combo box, and use that to run the SQL you need to get the data in question.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi i am doing a tool in which i have to open some ten to twenty telnet sessions in each seperate users will be sigining on and accssing same area and database.using a telnet component i am creating telnet session and giing som inputs and retriving data to gui. for making the process i am using threading.but it takes more time for a single command thats more tha 2 sec which will be taking less tha a second if we open single telnet session could any one tell me the reason pls?
and help me with some advanced threading concepts and sample codes pls
thanks
with regards
Balagurunathan.B
|
|
|
|
|
Threading does not magically turn your processor into 20 processors. It simply divides a number of tasks to be performed by the one processor. It won't make things faster than if you did them all in the main thread, it's main advantage is in making sure the UI thread remains active so the program does not freeze.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
thanks i am also able to understand wat u r saying but my only concern is it should not reduce the speed and make a which will only take less than a second to more or less three seconds
i tried with less no of sessions also means prviously i said i used 10 sec but later i tried with 5 seconds but there is no change in retrival thats why i am getting confused.
will you please send me some links which can give me a better knowledge abt threading for me in vb.net
thanks
with regards
Balagurunathan.B
|
|
|
|
|
As Mr. Graus pointed out, adding more threads will not speed up a uni-cored machine and has no guarentee of working on more then one core of a multi-cored machine (that's up to the OS).
Adding more threads then cores WILL slow down the machine since each thread's context (the various registers, caches etc) will have to copied to the CPU and then taken from the CPU on each swap. It's called a context switch.
20 threads on 1 core means 20 context switches which adds overhead.
Threads just guarentee that some of your code gets a time-slice and isn't frozen until another thread completes. Such uses are typically for the UI (users hate frozen interfaces) and server apps.
I'm also baffled as to why you're using telnet protocol for data transfers??
Felt the need to post something today
[sorry, mispelled your name!]
|
|
|
|
|
i want to display the name starting with any letter(A-Z,a-z) in textbox from sqldatabase through datagrid using vb.net windows application.
for example,
values are in datagrid like
companyid companyname contactperson city
1 IBM rajesh Bangalore
2 Wipro kannan Chennai
here companyid, companyname, contactperson,city are field name.
companyid is primarykey.
in my form there are 4 label and 4 textbox.
1st label name as Findlabel
2nd label name as companynamelabel
3rd label name as contactpersonlabel
4th label name as citylabel
1st textbox name as findtextbox
2nd textbox name as companytextbox
3rd textbox name as contactpersontextbox
4th textbox name as citytextbox
i want to display company name starting with any letter.if i type wipro in findtextbox,then i click findbutton means the values will automatically diplay in other 3 textbox(ie..wipro in companytextbox,Kannan in contactpersontextbox,chennai in citytextbox).
if i type IBM in findtextbox,then i click findbutton means the values will automatically diplay in other 3 textbox(ie..IBM in companytextbox, rajesh in contactpersontextbox,Bangalore in citytextbox).
so i want to display starting with any letter.i am doing these project in windows application using vb.net.plz help me.
|
|
|
|
|
In the keypress event of findtextbox, search though the dataset using the following SQL command:
"SELECT * FROM yourtable WHERE companyname LIKE '" & findtextbox.text & "%'"
Then check if the found results count is one, you do simply set other textboxes to the fields from the queried row.
This is even more easy-to-use than what you wanted, since the data about IBM would be shown just by typing the letter 'I' and the other just by typing 'W'.
Here this code makes your program case-sensitive; you may change it with a simple 'OR' command.
|
|
|
|
|
In VB6, I have a main form (frmMain) with three subsidary forms. The latter set various properties on frmMain, e.g. frmMain.NoCopies = x
I have a number of procedures that I want to put this in, so I need to pass the name of the form as a variable - otherwise I will end up with three subsidiary forms for each procedure.
Is it possible?
(I am trying to pass the info as public variables, but it seems to be a long way round)
Regards
pitters
|
|
|
|
|
You should pass the form itself rather than just the name of it!
This is how to do it:
<br />
Sub SomeFunction(frm As Form)<br />
<br />
End Sub<br />
.<br />
.<br />
.<br />
Call SomeFunc(frmMain)<br />
|
|
|
|
|
Then wouldn't I have to use the Call SomeFunc(frmMain) in my original form?
I actually need to access the properties in the subsidiary form like so:
e.g. instead of using the code frmMain.NoCopies = 2
I want to be able to use (varaible).NoCopies = 2
|
|
|
|
|
You may call the function anywhere (if it is public).
If I were you, I would declare SomeFunc in a public module and call it anywhere that is needed.
I guess that it will satisfy what you want.
|
|
|
|
|
Hi,
I am binding my DataGrid control to an arrayList that contains strings as
datagrid1.datasource = str
where str is the ArrayList.
On executing the code, the datagrid displays the length of the strings instead of the strings themseleves.
How do i make the datagrid display the strings contained in the arraylist and not the length.
Thanks!
|
|
|
|
|
This is actually by design that this happens. An array doesn't implement the databinding interfaces, so the DGV looks at the only property that it can find on each element, Length.
You'd have to expose the array in a wrapper class that exposes the text of the string as a property. You cannot bind to the string text without it being exposed by a property.
|
|
|
|
|
Thanks a lot! It works now.
|
|
|
|
|
Hi,
In VB.net how do I uplaod files to server path (http://<servername>/Uploadedfiles/<filename>).
I have an desktop application in VB.net, I need some files to be needed for online. So that I need those files to by uploaded to server using http upload method.
Any luck.
Rams.
Be simple and Be sample.
|
|
|
|