|
thanx CBoland
Its great and working as per my expectation.
Thanx a lot
Pradipta
|
|
|
|
|
This will work for detecting an instance of the application already running.
If (UBound(Diagnostics.Process.GetProcessesByName(Diagnostics.Process.GetCurrentProcess.ProcessName)) > 0) Then<br />
'//End The App Or Whatever You Want To Do Here<br />
End If<br />
|
|
|
|
|
Hello all,
How can I retreive the long file name form a short file name in VB6 in WinNT 4.0. Using GetLongPathName won't do as this is Win2000 and above API.
Thanks in advance
Alberto Gattegno
Software Engineer
http://www.itgil.com
|
|
|
|
|
Good people,
How do I set the “Comment” attribute of a file or folder using VB script ?
For example, the following code lists “Comment” attributes for files under C:\ directory:
set shell = CreateObject("Shell.Application")
set folder = shell.namespace("C:\")
for each folderitem in folder.items
list = list & _
folder.GetDetailsOf(folderitem , 0) & ", " & _
folder.GetDetailsOf(0, 5) & ": " & _
folder.GetDetailsOf(folderitem, 5) & vbCr
next
MsgBox list
Thanks,
Serge
|
|
|
|
|
Hello!
I'm have an Access database (mdb) with table 'Table' with 2 columns (fields): 'fieldA' and 'fieldB' (for example).
The question is how to add new column (field) 'fieldC' progamatically (when my program is running).
I'm use OleDB to open this database.
If you know how to do this - please answer (please with example). May be I'm must use AboDB (not good for me) or AdoDX or something else.
Thank you!
Code
|
|
|
|
|
I have a .NET DLL that contains two forms. This DLL works great from windows applications. But when I make a windows service that references the DLL the forms do not show, the form code executes without any errors but no forms are displayed. Does anyone know how to get this to work?
|
|
|
|
|
I could be mistaken on this, but normally a service does not have any user interface, and the service framework may, in fact, prohibit any UI from displaying properly... though I would expect it throw an error in that case. If you want to run the code as a service, separate the UI and the logic into separate assemblies, then use the UI as an observer of the state of the service?
|
|
|
|
|
OK. In general:
Windows Services run in their own Windows sessions. What does this mean? Well, when you login to Windows, you start your own session. Services do the same thing. They get their own Window Station, Desktop, Environment, and such. This means that the user interface your app is putting is showing up, but it's on a desktop that you can't see.
There is no way to view the session of a service! Services cannot interact with the user session directly (or easily.) But, it IS possible to write a service that interacts with the users desktop. Your going to have to supply the service with the logged on users security context, station handle, and desktop handle, at a minimum. Hint: Your going to have to write a seperate app that runs on the user side and communicates with the service via RPC to do this.
Information on how this works (and why) can be found in the Platform SDK documentation. Just search for "Window Stations" (no S on the end of Window) on MSDN for a good starting point.
RageInTheMachine9532
|
|
|
|
|
Thanks for the info. I am going to check out Remoting via RPC and see how this works.
|
|
|
|
|
I want to know when I use the IE to open the url,some pop window run at once! I hope to close them. i want close it before showing!
please give some info about the IE process ,How can i get the command about "Open.window"!
|
|
|
|
|
please give me more information about it! thank you!
|
|
|
|
|
I would set my ActiveX class as SafeForScripting and SafeForInitializing.
Thank you very much!
|
|
|
|
|
how can i use a varible in a shell command; so the shell executes net send dell (my input)?
dim message as string
message = txtMsg.text
Shell ("net send dell" message)
HELP
|
|
|
|
|
Something like this maybe?
Dim sendString As String
Dim varData As String
varData = "Hello world!"
sendString = "net send dell" & varData
Shell(sendString)
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
Ray Cassick wrote:
sendString = "net send dell" & varData
You need to specify a space here
"dell "
Your friendly neighbourhood typo police!
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
Hi,
I need to have an owner-drawn linklabel on my form. For that i set size of the control equal to the size of my graphical object which i draw inside linklabel.
My question is: How do i tell the linklabel control to set its "Link Activation Area" to spread over the entire size of the linklabel control, and not just over some text within the control (after all, i don't even use any text).
Regards,
Vitaly
|
|
|
|
|
Why are you using the linklable then? Sounds to me like what you want can be done using a picture box or something like that.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
Hi,
What i need is a hyperlink object, only custom drawn. I know the size of the rectangle that i'm drawing, so i want to set the hyperlink's Activation Area to match its size. Any idea how to do that?
Regards,
Vitaly
|
|
|
|
|
Hi,
I have tried to convert an C# sample program to VB.Net but was confronted with one problem. This sample describes adding controls dynamically to a placeholder and reading back their values after user clicks a button. You can see the whole C# source here.
I think I have managed to do all the other conversion but following snippet of C# code is problem.
(I have removed the comments)
XPathDocument surveyDoc = new XPathDocument(Server.MapPath("ExSurvey.xml"));
XPathNodeIterator itr = surveyDoc.CreateNavigator().Select("//question");
System.Text.StringBuilder sb;
sb = new System.Text.StringBuilder();
sb.Append("Survey submitted on " + DateTime.Now + Environment.NewLine);
while (itr.MoveNext()) {
string controlName = itr.Current.GetAttribute("name", "");
sb.Append(controlName);
sb.Append(" : ");
object ctrl = FindControl(controlName);
if (ctrl is TextBox) {
sb.Append(((TextBox)ctrl).Text);
}
if (ctrl is RadioButtonList) {
if (((RadioButtonList)ctrl).SelectedItem != null) {
sb.Append(((RadioButtonList)ctrl).SelectedItem.Value);
}
}
sb.Append(Environment.NewLine);
}
string body = sb.ToString();
This code returns the ID of the control and it's value in body . That's what I'm after.
My effort in translating this snippet was as follows:
Dim surveyDoc As XPathDocument = New XPathDocument(Server.MapPath("ExSurvey.xml"))
Dim itr As XPathNodeIterator = surveyDoc.CreateNavigator().Select("//question")
Dim sb As System.Text.StringBuilder
sb = New System.Text.StringBuilder()
sb.Append("Survey submitted on " + DateTime.Now + "<br>")
While (itr.MoveNext())
Dim controlName As String = itr.Current.GetAttribute("name", "")
sb.Append(controlName)
sb.Append(" : ")
Dim ctrl As Object = FindControl(controlName)
If (TypeOf ctrl Is TextBox) Then
Dim myTextBox As New TextBox()
myTextBox = ctrl
sb.Append(myTextBox.Text + "<br>")
End If
If (TypeOf ctrl Is RadioButtonList) Then
Dim myRadioButtonList As New TextBox()
myRadioButtonList = ctrl
If (Not myRadioButtonList.SelectedItem Is Nothing) Then
sb.Append(myRadioButtonList.SelectedItem.Value.ToString + "<br>")
End If
End If
sb.Append("<br>")
End While
Dim body As String = sb.ToString()
To my disappointment my body contains only the ID and the semicolon, not the value of the control.
If somebody is kind enough and tells to me what is wrong in my code, I would be ever grateful to that person. I know that is not much in this cyberworld but anyway...
Lasse Rantanen
|
|
|
|
|
It looks like where you are creating a new TextBox() which does not appear to be needed.
If TypeOf ctrl Is TextBox Then
sb.Append(CType(ctrl, TextBox).Text)
End If
If TypeOf ctrl Is RadioButtonList Then
If Not (CType(ctrl, RadioButtonList).SelectedItem Is Nothing) Then
sb.Append(CType(ctrl, RadioButtonList).SelectedItem.Value)
End If
End If
This should work
|
|
|
|
|
i am attempting to read in a byte stream which contains what used to be VB6 currency values, .NET does not have a currency type anymore, so im trying to figure out the easiest way to convert to the new decimal format.. anyone got any pointers they could throw my way?
thanks in advance for any suggestions
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
The VB6 Currency is a 64-bit data type. Read it into a 64-bit integer (int64) and multiply it by 10,000. Let us know how this works for you.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
|
What are the best online C++ tutorials for experienced VB developers who need to learn C++ fast? In other words, they need one that is both clear and concise. Yes, I know that may be a tall order!
Kevin
|
|
|
|
|
You might get better results in the C++ forums since I don't think many VB programmers know C++!
OTH, I did it the hard way, through books
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|