|
Anoop Brijmohun wrote: I have an application running which has a global variable "User" Declared.
i want to retrieve the value stored in "User" from another application.
how can this be done?
You cannot just reference it like any other variable. You actually have to have some kind of communication mechanism in place that both applications support. Though, for the value of a single variable, it sounds like some bad design choices were made designing these apps and setting up communication just to transfer a single value is overkill.
Another possibility, though not available until .NET 4.0, would be a memory-mapped file. Both applications basically "share" a common file that exists in memory and can read/write to that file. Though, if sychronization is needed, you'll also need some kind of mechanism in place, depending on your requirements.
I would think you need to go back as see if the value can be stored in a well-known place and retrieved by both apps as needed.
|
|
|
|
|
Hi
Thanks For You Response.
The App 1 is not my application, its part of an ERP System created by someone else.
Within the App1,there are variables that can be called by built in script editors.
mmmm... just thought there might be a simple way to access that specific variable.
The whole idea behind was that i was building an app [2] to run automated task
and instead of the user logging in again, i would be able to get the logged in user from app1 and process.
thanks.
Anoop
|
|
|
|
|
If you have no control over App1, you've pretty much out of luck. Unless that app exposes some kind of COM interface that you can use to get at the variable.
|
|
|
|
|
Supose I have default windows printer always in Pause because I want to control jobs send by users.
Using system.printing I detect jobs and I want to decide if this may be printed or not.
If I decide to print I want to send the job to another on-line printer.
Is possible to change a job in default printer queue to another printer queue ?
The job depends on printer and the on-line printer must use the same driver or the printer may be different ?
|
|
|
|
|
edmonson wrote: Is possible to change a job in default printer queue to another printer queue
No. Once the job is created, it cannot be changed. You'd have to kill the job and have the application that generated it send it again using the new printer (good luck with that part, you'll need it!)
|
|
|
|
|
|
|
This sounds like a horrifying user interface design. but, whatever, it's your customer...
Ask this in the ASP.NET forum. What you're asking really has nothing to do with the language you're writing this in, but the web technology you're using.
|
|
|
|
|
Dear all,
I want to know about the Local Language Settings in VB 6 application.
I have one application in VB6 which i need to interpret with My Local Language in to my application Front Screen. Can anybody having the info please let me also know.
Thanks in advance.
Jay
|
|
|
|
|
|
It's called "localization". All you have to do is Google for "vb6 localization" and you'll come up with an ever-dwindling list of articles to read.
VB6 is dead and has been for quite some time now. I strongly suggest downloading VB.NET 2008 Express Edition, since it's free.
|
|
|
|
|
Good Time for U all,
I am working on an application, I want to read data from excel based on conditions like for example "select somecolumns from [excelsheet$] where acolumnname="somevalue". Is that possible to do so. Can anyone help me in do so or give me other clues for my purpose.
With regards,
|
|
|
|
|
|
Hi,
i have below short code in C#
public delegate void MsgEventHandler(object sender, ChatEventArgs e);
public static event MsgEventHandler ChatEvent;
private void Message(ChatEventArgs e)
{
MsgEventHandler temp = ChatEvent;
if (temp != null)
{
foreach (MsgEventHandler handler in temp.GetInvocationList())
{
handler.BeginInvoke(this, e, new AsyncCallback(EndAsync), null);
}
}
}
and when we translate in vb.NET
Public Delegate Sub MsgEventHandler(ByVal sender As Object, ByVal e As ChatEventArgs)
Public Shared Event ChatEvent As MsgEventHandler
Private Sub EmergencyMessage(ByVal e As ChatEventArgs)
Dim temp As MsgEventHandler = ChatEvent
If temp <> Nothing Then
For Each handler As MsgEventHandler In temp.GetInvocationList()
handler.BeginInvoke(Me, e, New AsyncCallback(AddressOf EndAsync), Nothing)
Next
End If
End Sub
but i have error, Saying ChatEvent is an event and can not be called directly.Use a 'Raise Event' statement to raise an event.
can u help me to figure it out from c# to vb.net?
thank you
regards
Sri
|
|
|
|
|
I think if you google Raise Event, you'll see the correct syntax.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Two ways to get the correct syntax.
1 - Read the documentation or search with the error message.
2 - Compile your C# application, open the assembly using reflector and change language to VB.NET.
|
|
|
|
|
Thanks Navneeth,
Can you please expline how to do this. I am new to vb.net. Please.
|
|
|
|
|
Hi whats the equivalent to below code in vb.net
string culture = ((((Range)_ws.Cells[2, (int)ExcelColumnIndexEnum.CultureColumn]).Value2 != null) ?
((Range)_ws.Cells[2, (int)ExcelColumnIndexEnum.CultureColumn]).Value2.ToString().Trim() : string.Empty);
I tried to convert using a tool available in developerfusion that gives me
Dim culture As String = (If((DirectCast(_ws.Cells(2, CInt(ExcelColumnIndexEnum.CultureColumn)), Range).Value2 IsNot Nothing), DirectCast(_ws.Cells(2, CInt(ExcelColumnIndexEnum.CultureColumn)), Range).Value2.ToString().Trim(), String.Empty))
but when i paste in vb editor it shows error.
ExcelColumnIndexEnum is an enum and codes are as.
Imports System
Imports System.Collections.Generic
Imports System.Text
Public Enum ExcelColumnIndexEnum As Integer
CultureColumn = 1
OtherColumn=2
...
End Enum
please help
|
|
|
|
|
This is horrible code, why would you want to convert it ? What error does it show ? I think the If should be Iif, then I think it might work.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I think the error is he is posting C# code into a Visual Basic .Net project...
and yeah, that should be IIF as well.
|
|
|
|
|
Hi,
I'm developing a cybercafe app. and i need to detect printing process from other aplications(Word,Acrobat,...)
I need to send the job to any printer and select if it may be in color or BW.
User doesn't use printer properties directly from its application(word,excel,...). He clicks on printing button directly.
My trouble is catch this action to force him to show the destination printer and job color mode.
I've been working with system.printing namespace to control the spooler:
- When a new job arrives, I stop it. I obtain information about pages, printer,... but if I change any parameters like coloroutput property, it has no efect on the job when I resume it to finish the printing process (restart the job fails too)
Any Idea ?
Regards
|
|
|
|
|
Once you start a print job, it cannot be changed. The spooling data is specifically for the target printer and is written with the parameters chosen in mind. Once the job starts, it's too late to make any changes. The only thing you can do is pause or cancel the job.
|
|
|
|
|
After reading Dave's reply, it has occurred to me that you might be able to create a new print job using those parts from the original that you want to retain and the new ones that you want to use then deleting the original.
I have no idea how you would do that but if it were me, that is what I would explore.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
You could create a Virtual Printer (like those that create PDF file), and set it as the default printer. The virtual printer could then decide how to handle the print job.
I am intending to write a similar Virtual Printer, but for processing emails. I cannot tell you how to start, because I am that stage myself.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Hello,
I have binded a textbox to a field inside a table in the dataset in design time. Does it mean that whenever a validation or a property change occurs on this textbox, The field in the table also gets updated? How to add a new row inside a table and also update the changes in database. If you give me a brief sample code, I would really appreciate it.
I am asking it to you because It has been quite long time I quit working on development and I forgot the methods.
Thanks.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|