|
This is amazing! It worked! Many many many thanks!
Thanks,
ns
|
|
|
|
|
Hi,
Is there any plugin already released that allows me to use the VS.NET IDE to program in Pascal?
Thanks
|
|
|
|
|
DOH!
Not as far as I know... there might be a version of Delphi for .NET soon but I don't think that it will use the VS IDE.
|
|
|
|
|
I'm doing the following in a standard VB exe:
Private Sub Command1_Click()
Dim rc As Long
Dim opstr As String
opstr = "kk"
Form2.Show
rc = TextOut(Form2.hdc, 6, 20, opstr, Len(opstr))
End Sub
Nothings on form2!!!! What am I doing wrong?
Thanks,
ns
|
|
|
|
|
I need to dismiss a modal form (HAS to be modal by limitation of my circumstances). Then I want to update progressbar info in it, then reshow it. unload doesnt work. Form sits there stubbornly...ANy way to kill it?
Thanks,
ns
|
|
|
|
|
Have you used the visible , or hide property I think it is? Which way are you referencing your form, are you using Unload me or Unload form1 ?
Nick Parker
So like children pointers should be left to grown ups. - Norm Alomond
|
|
|
|
|
Unload form1 because its being done in a class function, so I didnt think I could use me. Hide and Unload wont work. It needs manual intervention. I abandomned that idea and doing sendmessage instead.
BTW, what is the counterpart of an MFC HWnd? I am sending in a handle to a window from VC to the dll so it can sendmessage back. Whats my VB function parameter to be? MyVBFunc(HandleFromnVc as ?)
Thanks,
ns
|
|
|
|
|
I think you can pass it as a Long .
Nick Parker
So like children pointers should be left to grown ups. - Norm Alomond
|
|
|
|
|
I have the following in vs sp5:
Public Function CheckingStuff()
'MsgBox "a"
Form1.Text1.Text = "didstuff"
Form1.ProgressBar1.Visible = True
Form1.Show vbModal
'MsgBox "just showed form1"
For i = 0 To 100
Form1.ProgressBar1.Value = i
i = i + 1
Next
Form1.ProgressBar1.Visible = False
End Function
the progressbar shows up blank. What am I doing wrong?
Hellpp!!!
Thanks,
ns
|
|
|
|
|
1) Why are you incrimenting 'i' inside the loop that is also incrimenting 'i'?
2) Place a doevents inside the loop to give the screen a chance to update.
|
|
|
|
|
I think the problem is that I show the form as modal. So it doesnt get dismissed automatically and get reloaded with the next update? The VC client can only show the dll form as modal (by design according to MS), so I have no choice. So if I preset the progressbar value to 50% OUTSIDE the loop, it shows , but the updates dont show, even with doEvents. I might have to "force" draw a progressbar (two rectangles) onto the modal form with something akin to textout ?
The other option I have is to send in the callback functionpointer into the VB dll so it can callback the VC app and notify it of its progress. only thing is, how do I call this function from within VB?
eg if my VC app says:
ptr->MyVBFunction(& VCCallBAckFunction)
Then how will VB call this function? I do a #import in my VC side to let VC know I'm using this VB dll. But what should I tell VB about who the calling app is?
Thanks,
ns
|
|
|
|
|
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
|
|
|
|