|
I don't believe DoEvents is what you will want to call here, I think you are going to want an API call to UpdateWindow(form1.Hwnd).
Nick Parker
So like children pointers should be left to grown ups. - Norm Alomond
|
|
|
|
|
The problem is not with the loop or doevents. When you open a form in vbmodal then the program execution stops till the window is closed. This has to be used for showing some alert or message where user. Either use vbModeless or else use a timer control to increment progress bar value.
dsk
|
|
|
|
|
i wanna a feature to catch the keydown in WORD for sometimes some char should be change to other char (don't use autocorrect in WORD).
Can VBA catch this event? I browse the help of VBA in WORD, but don't see anything useful?
May you lend me a hand?
|
|
|
|
|
I have a VB.NET application that runs all the time in a custom Kiosk my company builds. I'd like to be able to shutdown and then restart our application remotely. We use Remote Administrator for this now, but there's a lot of them so when I have a need to do things like this I'd rather not do it manually. So, I wrote a Service that runs in our Kiosks. Since our units are equipped with an FTP server, my service simply looks for an XML file to show up in a certain directory. The XML file contains a list of "commands", one of which is to shut down our software. In looking in how to shut down another process I looked at the System.Diagnostics.Process namespace and wrote this:
from within "Main":
Dim ProcessHandler As New System.Diagnostics.Process()
If (FindRunner(ProcessHandler)) Then
ProcessPath = StopRunner(ProcessHandler)
End If
' Functions
Private Function StopRunner(ByVal Process As System.Diagnostics.Process) As String
Dim ProcessPath As String
ProcessPath = Process.MainModule.FileName
Process.CloseMainWindow()
Process.WaitForExit(3000)
If Not Process.HasExited Then
Process.Kill()
End If
Return ProcessPath
End Function
Private Function FindRunner(ByRef Process As System.Diagnostics.Process) As Boolean
Dim colProcess() As System.Diagnostics.Process
colProcess = Diagnostics.Process.GetProcessesByName("TEC_Runner")
If colProcess.Length > 0 Then
Process = colProcess(0)
Return True
End If
Return False
End Function
The Kill() was added later when I realized that CloseMainWindow() wasn't working for me from within the Service. Debugging a service is kind of a pain, so I first wrote the code as just another VB.NET application and this worked great every time. However, when I moved the same code into the Service, the WaitForExit() never returned (I didn't specify any milliseconds at first which of course meant it locked up). I don't understand why it works every time from within a normal application, but NEVER succeeds from within a Service. Do I need to do this some other way? Any ideas what's going on? Using Kill() works... mostly... but it rips the application down without letting it cleanup (and it does important things when being shut down normally that I need it to do). Please help!
Thanks!
Matt Philmon
|
|
|
|
|
Its necessary for me to launch a form in my COM VB dll. So far all I have in it is a class, and a bas module.Launching the form can be the first thing the dll does - it will be a progressbar indicating the progress of my dlls called function. Then I want to make it vanish when the dll is done with its job. Please help!
Thanks,
ns
|
|
|
|
|
I guess I am not sure where you are stuck.
Nick Parker
If the automobile had followed the same development as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year killing everyone inside.
-Robert Cringely
|
|
|
|
|
Well,
I have a VB class, whose function I call from another app(a VC app). This VB class is in an ActiveX dll. The function does so non gui stuff. The first thing I want to popup when this gfunction runs is a little form with a progressbar, and my Vb function will satrt it off at zero, then as the function progresses, this info is communivcted to the form which advances the progress bar. when the function is done, it notifies the form , which should vanish. SO how exactly does one implement this? The only VB i've done is where you set the form as the stratup object in a standard exe. So I dont know in this dll, do I say, in the class function: (Big guessing here - not familkiar with VB)
Public function myFunction
Form1.show 'form1 has the progressbar on it.
form1.ProgressBar.Position = 0;
'Now get the execution to continue in the class function somehow (how? ARe we still in the class'es code?
'Class function does stuff:
'Job A finishes. Notify progressbar to advance to 30%
Resume with Job2 in class function.
Job B finishes. Notify progressbar to advance to 60%
etc etc
If you can give me a little sample code for a sample function that can do the above I would be very grateful.
Thanks,
ns
Thanks,
ns
|
|
|
|
|
I don't believe that you are going to be able to access your VC++ form from within the VB ActiveX.dll directly. The work around I believe is somewhat circular. Suppose you have a function called UpdateVCScreen(); written in VC++ to update your progress bar. Now you have function called DoVBStuff() inside your VB ActiveX.dll, lets just say that your VB function opens a file and reads it line by line. You can call your VB function from VC++, however to update the progress bar in your VC++ application you are going to need to make a a call to your VC++ UpdateVCScreen(); function from your VB ActiveX.dll that will interface to your application which you have written in VC++. There may be many other ways to do this, however I am not sure of another method. Does this make any sense?
HTH
Nick Parker
If the automobile had followed the same development as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year killing everyone inside.
-Robert Cringely
|
|
|
|
|
yes. Just have tofigure out the mechanism. Also looking at postmessage....between the two.
Thanks,
ns
|
|
|
|
|
I just tried this in a function in my VB dll class:
Public Function CheckingStuff()
MsgBox "a"
Form1.Show
MsgBox "just showed form1"
For i = 0 To 100
i = i + 1
Next
Form1.Text1.Text = "didstuff"
End Function
and called it from VC with:
CoInitialize(NULL);
_Class1Ptr ptr;
ptr.CreateInstance(__uuidof(Class1));
ptr->CheckingStuff();
The first msgbox fires, but then no form shows and the second msgbox never fires..........
Help!
Thanks,
ns
|
|
|
|
|
It had to be shown modally in the VC client (a limitation) and thats brought its own set of problems...my progressbar wont update in it until its dismissed and reshown. No tricks like unload and hide work. the form is modal so sits there. CAn I force it to somehow go away? Then reshow it with newly loaded info?
Thanks,
ns
|
|
|
|
|
ns wrote:
Form1.Show
VC++ doesn't know you want your VC++ form to show, form1. when written within a VB app is inclusive to object bound within that project.
Nick Parker
If the automobile had followed the same development as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year killing everyone inside.
-Robert Cringely
|
|
|
|
|
|
I have only used COM Interop to get access to pre .NET COM servers in C#. What is nice is that you can do this in VB.NET too, I am just not sure of the exact syntax about it.
In C# it might look something like this.
[DllImport("myPrinter.dll", CharSet=CharSet.Ansi)]
private extern static long MyPrinterFunction(long hndlToPrinter);
I believe I have seen this done in VB.NET with the < AND > signs to replace the square brackets around DllImport .
In VB.NET then maybe...
<DllImport("myPrinter.dll", CharSet=CharSet.Ansi)>
private extern static Long MyPrinterFunction(hndlToPrinter As Long)
Hope this helps.
Nick Parker
If the automobile had followed the same development as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year killing everyone inside.
-Robert Cringely
|
|
|
|
|
Hi
I am working on VB.net with ADS.
I want to use the "memberof" function in that to get the user rights.i cound't get the result. But i can get the rest of the results from the ADS like mailid,city, etc.
Can any one help to how can i use "memberof" function in VB.net.I think they return the propertyvaluecollection type.i want to know how to use propertyvalue collection.
Thanks
Dhivakar TE
|
|
|
|
|
does ne one know if there is a list control avaiable for web forms in VB.net?? i want to make an inbox sort of a thing (like the one used in outlook express)...kindly let me know ASAP
|
|
|
|
|
Is there a way to make an install program in VB 6.0? Or is there something that is already pre-built that I can use and just include my .ini files and executable.
Thanks
|
|
|
|
|
|
you can use the package and deployment wizard, if required you can modify setup1.exe for customised setup file creation. The source code for this setup1.exe is available in C:\Program Files\Microsoft Visual Studio\VB98\Wizards\PDWizard\Setup1\Setup1.vbp
|
|
|
|
|
Good day all
I was wondering if someone could help with this. I need to find a way of of checking to see that if my application that I built is currently running? Any information would be a great help.
Thanks.
|
|
|
|
|
If you want to see if there is already a copy of the same application running then you use:
App.PrevInstance
Looking for an instance of ANOTHER application is a bit trickier but you can do it looking for window titles.
|
|
|
|
|
In Vbscript using Ole Automation how to I open a PPT presentation with the main PPT App window in a minimised mode
|
|
|
|
|
when a html file without its accompanying gifs, bmps etc is opened with ms-word
U get a msgbox "Some of the files in this Web page aren't in the
expected
location. Do you want to download them anyway? If you're sure the Web
page
is from a trusted source, click Yes." .
Basically, I want this msgbox to go away and Yes to be chosen by
default.
The reason being that we have automate the process using VB script and
when
this happens, No seems to be chosen by default.
|
|
|
|
|
What are you automating exactly?
Nick Parker
If the automobile had followed the same development as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year killing everyone inside.
-Robert Cringely
|
|
|
|
|
I am using the ADO in VB 6 and I was wondering how I could search the active database for a specific value. If someone could please give me a hand with this, that would be great!
|
|
|
|