Passing Arguments in Windows Application [closed] - windows

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am making a application(desktop app), and need to fetch ids from DB and pass these ids to another desktop application.
How to achieve this?

Your question is your answer. You can use command line argument passing in windows application. As to how to do this is written below.
You can Create a process and call the application to start and pass those arguments:
Process pro=new Process();
pro.StartInfo.FileName = #"ApplicationName.exe";
pro.StartInfo.Arguments = arg1 + " " + arg2;
pro.Start();
pro.WaitForExit();
in the second application get these values by following the below code:
var arguments = Environment.GetCommandLineArgs();
if (arguments.Length > 1)
{
productIdFirst = Convert.ToInt32(arguments[1]);
productIdSecond = Convert.ToInt32(arguments[2]);
}

If I understand you correctly then you're talking about a website and you could pass it a query string. If that is the case then you should check out http://msdn.microsoft.com/en-us/library/system.web.httprequest.querystring.aspx :)

I agree to Martim, that it is no clear if your tags "Windows" not perhaps mean "Website". But if you really mean "Windows" like you've tagged, you can use COM as Middleware. A german article already has great explanation with code samples. Languages can be translated.
http://www.activevb.de/tutorials/tut_middleware/middleware.html
Download Source Code
http://www.activevb.de/tutorials/tut_middleware/downloads/Middleware.zip

Related

LogMessage in VB6 [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
this might seem a very very foolish question ..but the fact is i am totally new to VB and got least knowledge of it. i have to make some changes in a code . i need to know that is LogMessage an in-built or predefined function(or method or class) like print f in C. if so.. then why is it inherently been defined in a code ....like this:
Sub LogMessage(From As String, Msg As String)
txtLog.Text = txtLog.Text & From & ": " & Msg & CRLF
txtLog.SelectionStart = txtLog.Text.Length
End Sub
it is not a pre-defined function/method.
when you see it defined with only a 'Sub' or 'Function' word in front of it it means that is is user-written code.
bon chance

Regular expression required for string [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I am trying to solve below problem using regular expression. My input string is something like this
"MTSGNN0002( 1), MTSGNN0028( 645), MTSGNN0050( 10)"
and I want output like this
"MTSGNN0002,MTSGNN0028,MTSGNN0050"
It should delete all charecter which comes between brackets. Kindly help me out in solving this.
Sometimes it's simpler to find what you want than delete what you don't:
s = "MTSGNN0002( 1), MTSGNN0028( 645), MTSGNN0050( 10)"
s.scan(/MT\w+/).join(',') # Change MT to whatever suits your data.
Look at this regexp:
([a-zA-Z0-9]*)\(.*\)
http://rubular.com/r/maZNs0mDkv
From there on it's easy ;-)
Here you go..
\([^\)]*\)|\s
As per your question.. The above replaces the brackets and the text inside and remove the spaces.
Example and Source Demo:
Here i have got one more solution
([(\b]\s.[0-9]*\b\))
http://rubular.com/r/9NyoU3RKUT
replace mathes of this regex \([ \d]+\) with empty string

Codeigniter Comment Reply System [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am new to CI.
Now i am try to develop the comment system with reply option.
So far i have developed the insert comment and reply comment.
But i don't know how to fetch reply comments under the main comment.
Please help me.
Thanks to all
Use a recursive function! For that you will need to do something like this:
Get the first comment.
Call the recursive function. The ID of the comment must be passed as an argument.
The function must get the comments & call itself in order to get all the comments.
A pseudo-code of this schema will be:
myComment = getComment();
recursiveComments(myComment);
function recursiveComments(currentComment){
print(currentComment);
replies = getReplies(currentComment['idComment']);
foreach(replies as reply){
recursiveComments(reply);
}
}
In the pseudo-code, I'm assuming that you get a row_array with the getComment() function & that this comment is the "head" of all the comments, like the initial post.
After that, I call the recursive function which gets all the replies & sub-replies for each comment. Note the I fetch a single reply in each call to the function.
Hope this gives you an idea! (=

Insert a text in to a file from command prompt windows 7 [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I want to edit a text file from command prompt in Windows 7. I have a text file, i want to search for particular String in that file. then I need to append some more string to string.
Then, I need to save or over write it.
The batch command language is not well-suited to this sort of task. You would be much better served using some other scripting language, like js or vbs or (if you are targeting Windows 7) powershell. If you really want to do it in the batch command language, you can sort of cobble something together with for /f to read from the input file and echo to write to the output file. Mind you, it won't be fun.

Need some explanations on this Delphi code [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I have this code and need some explanation on these questions:
What is that trailing "_TLB" after "ShellExecHookXample" in first uses section?
How should I use this code in Delphi 7 and make stand-alone exe file? (I don't know what's the proper place to put codes and call its method. Since it seems to be a unit or what?)
if possible please describe the code for me.
Thanks in Advance.
The _TLB is stands for type library. It looks like you are trying to implement IShellExecuteHook.Execute and have so far found some code here. However, I'm guessing because you didn't tell us. You are likely to get better answers if you are able to to spend more effort describing what it is you are trying to achieve.
If my guess is correct you should take a look at this question: IShellExecuteHook.Execute which I believe will explain how to solve your actual problem.
ShellExecHookXample_tlb means that this unit was imported from com (activex) object with an internal delphi tool (Project->Import type library...)
it reads public methods,events, properties of com (activex) object and generates pas unit with appropriate classes/interfaces. Usually you can find it in delphi folders.

Resources