|
Hi friends.. again with a short question.. here i am ... Well I placed a tool bat at my MDI form... but as soon as i place a background image at that main MDI form.. that also starts behaving as a background image to that toolbar too... I dunno why is soo.. it went ok a few days earlier..
but now i deleted the tool bar.. placed it again.. still the same problem..and this problem occurs when i put buttons on the toolbar...???
how is it happening...? how to prevent that image to be displayed on toolbar...???
tahir
|
|
|
|
|
Printing in VB is a mess.
I'm trying to print 2 sides of the paper in stead of one (I now use printform)
With this function it is not possible to do so....
I need to send more than one form at once to the printer (as one Printjob), but i have no clue how to do this, without the loss of quality.
Can anyone help me?
thnx
Maverick
|
|
|
|
|
I have created a secure shell in VB that sits in place of the desktop. In this shell there are a number of icons, which when clicked on run up the specified application. This then logs time spent in the application. When it finishes I then just note the time down and work out the elapsed time. However to find when the application finishes I have created a loop that checks whether the application has terminated. So far so good. But now the problem I have is that every 15 minutes I want to create a file of the time spent in each of the applications and send it off to another machine. The timer control in VB will only go on for 1 minute before having to reset it, so thats not really good. I could implement a C++ program to run a timer but then I have the problem in intergrating the two codes together, as the C++ will not know the contents of the variables in the VB application. I had thought about writing the data out to a file as I go (created and opened in the VB code), but then the C++ timer could cause problems in trying to close the file down, and also I would not be able to rest the variables in the VB code easily. Obviously I would like to keep all the code in VB if I could. Also does the timer allow you to come out of the loop that I may be in whilst waiting for a currently running application to finish, and then go back into the loop.
Any help would be great. Thanks
Simon Kearn (simon.kearn@lmco.com or simon.kearn@ntlworld.com)
|
|
|
|
|
Why now just write your reporting app (in VB of course) without any timer support, then just have the Windows Scheduler Service (Scheduled Tasks) kick off the app every 15 minutes. You could even schedule it to run between the hours of whatever to whatever and on what days.
This would, of course, require that you keep your information in a file as it's being created...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dim i as Integer 'In your init routine
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e _
As System.EventArgs) Handles Timer1.Tick
i += 1 'Increment for each minute - Interval set to 60,000
If i > 14 Then
'Do your file stuff here as 15 minutes have elapsed
i=0
End If
End Sub
If "to err is human", programmers must be superhuman...
|
|
|
|
|
Thanks for that.
On the other issue; if I am in a loop at the time of the timer Interval expiring. Will I get returned back into the loop once the timer procedure has been completed. Can't seem to find any info on whether this will happen or not.
Ta, Simes
|
|
|
|
|
You'll never actually leave the loop. You MUST put a Application.DoEvents in the loop, somewhere where it will execute fairly often, so your app will get the Timer Tick events and be able to process them. As a general rule, without the DoEvents, your app will stay in the loop and only execute the stacked up events when the loop terminates and the function that it's in gives up control to the GUI again.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Has anyone ever used IDispatch in one of their .NET apps? I'm trying to progmatically naviate to a website using the AxWebBrowser1 and download images that are on the page. I can get to the page and acquire the paths to the images but I can't save them. They are either tif images or pdf images depending on the site. I tried using the SAVEAS in the ExecWeb method. It saves the file but I can't open the image. Plus, even though I have the DONTPROMPTUSER settiing, it still prompts. So, I've been reading that you can create your own interfaces with IDispatch and IUnknown but I have no clue as to how to even start or if I'm going down the wrong path.
Please help
|
|
|
|
|
IDispatch is a little extreme for what you want to do.
You were on the right path with SAVEAS, but as you've found out, the WebControl will ask the user to pick the filename not matter what you try and save. This is, of course, a security reason. We don't want an app just saving thousands of copies of image to your machine without you knowing, do we?
You can use the URLDownloadToFile function, found in URLMON.DLL, to get around this:
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Integer, ByVal szURL As String, ByVal _
szFileName As String, ByVal dwReserved As Integer, ByVal lpfnCB As Integer) As Integer
The docs on URLDownloadToFile are here[^].
There is a good example of it here[^], and the short KB Article on it here[^].
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank you. I'll take a look at your examples that you attached. I can't seem to get it to pull the image so I'm wondering if it has something to do with how the image is on the server. Does it have anything to do with converting the path to an absolute address? If so, what is that and why would you need to resolve a URL to an absolute path?
|
|
|
|
|
I tried using this code again and this is the error that I'm getting. The return value is
6473926612615181. Which, since I'm new I don't really know what that means other than it tells me it didn't work. Any ideas? This is the type of path as an example that I'm trying to download
www.URL/imagescans/62/2002-1842262-2-255520-U-20030505-PU.tif.
Any suggestions? I have previously done this using the HTTP50.ocx in VB6. Should I maybe use the Http that comes with VB.Net to do this instead?
|
|
|
|
|
CreativeCat wrote:
this is the error that I'm getting. The return value is
6473926612615181.
That's not an error. It's just a garbage value that was returned. Was there are actual error or just nothing useful returned? The .NET BCL doesn't have an equivelent function.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
No, I didn't have an error returned. But the image doesn't save to my hard drive either. Would it be because it's a tiff file?
|
|
|
|
|
I would like to know if they're an easy way to get the name of the mdichildren in an mdiparent. Because i want to display their name in a label.
Can someone help me ?
I am NOT a newbie
|
|
|
|
|
XGaMeS wrote:
I am NOT a newbie
You risk alot putting this on the table!
You can enumerate through the MDIChildren collection in your parent form:
Dim strName As String
Dim frmChild As Form
Dim x As Integer
For x = 0 To Me.MdiChildren.Length - 1
frmChild = CType(Me.MdiChildren(x), Form)
strName = frmChild.Name
Next
RageInTheMachine9532
|
|
|
|
|
Greet! thanks you
And I found another way to do exactly what I was looking for.
<br />
If Not IsNothing(ActiveMdiChild) Then<br />
Select Case ActiveMdiChild.Name<br />
Case "name"<br />
lblnameform.Text = "[text]"<br />
End Select<br />
I am a newbie
|
|
|
|
|
Hi,
I'd like to know how to incorporate the ActiveDesktop in my VB.NET project.
Can some point me to a how-to guide or a FAQ on this topic?
T.I.A.
Emdek
Happy coding....
>Colt 45: The Perfect Point'n'Click Interface <
|
|
|
|
|
Your going to have to describe what you mean by "incorporate". ActiveDesktop is a variation of the desktop, where you can have it display a working web page or image or whatever. It's like having a web browser for a desktop.
So what do you mean by incorporating this into your app?
RageInTheMachine9532
|
|
|
|
|
Hi Dave,
Thanks for the reply. "incorporate" was rather a poor choice of words. "Get access to" is more in the line of desires
And maybe ActiveDesktop is the wrong place to look for, but it seem to me the logical place to start.
What I'd like to build is an opaque form, containing an analogue clock. No big Deal...butI want it permanenlty on top /allways visible (full-screen) and really transparant, i.e. without interfering with other programs/user-interaction, etc.
So, am I looking in the correct direction ?
|
|
|
|
|
Not exactly. Having your clock app on top of everything will essentially stop the user from clicking on anything on the desktop, or even right-clicking the desktop. Your purpose is better servered by a Java applet running in an HTML page. That way, the desktop sits on top of your clock and you won't prevent the user from getting to their desktop.
RageInTheMachine9532
|
|
|
|
|
Hi Dave,
Dave Kreskowiak wrote:
will essentially stop the user from clicking on anything
that's exactly what I'm trying to solve here. I have to figure out how to pass all user-interaction through my form without distortion. In effect I want my form to act as a layer between the user and the desktop a.k.a Windows. I'd like to be able to 'project' a clock (and/or statusmessages) on screen in a transparent fashion without interfering the user in his/her work. Like the H.U.D.S. you see in fighterplanes ?
|
|
|
|
|
I can't think of a way your going to accomplish this. Just repeating mouse clicks isn't as easy as it sounds. Your form, literally, has to minimize before the mouse clicks are going to go their destination, then your form can come back and repaint.
Also, having your clock on top of the desktop icons will alter the coloring of the icons themselves. Icons under your clock are going to be colored funny and possibly even greyed out. This is a violation of the GUI design guidlines that describe a consistant user experience.
I don't see how your going to pull this off without a near impossible implementation of your clock app. You can map mouse click to the Desktop window and send the desktop the mouse click messages, but I just don't see how your going to get past context menus and icon manipulation since those will require you forwarding all mouse actions to various windows.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Nome
|
|
|
|
|
Hi Dave,
I'm aware I've pulled a 'verry tough cookie' out of the jar, but I'd like to explore this path a little further.. It probably will set your mind at peace that I'm not an overenthousiastic newbie, but a weather-worn veteran with more than 25 years in the trenches So I kinda know where I'm going...
This is in my opinion the a feassable concept:
Draw a borderless full screen form with an transparant background and pipe all WinProc messages received by this form to the next form/object in Z-order. This way it should not interfere with the GUI guidelines ?
The analog clock idea I was writing about was primarely for my own use, but I can forsee the use of a non-intrusive way of displaying data like background-processtatus or CPU temperature or whatever one deems interesting ?
Your feedback on this is highly apreciated!
|
|
|
|
|
Sounds good, ... can apply to a bunch idea's like you've got. I was thinking more of an ActiveX solution, running in an HTML page. But with stuff like CPU temp and fan speed, an ActiveX control would get the data from a dedicated app running as a service, then rendering on the page. This kind of thinking is a bit deprecated in the .NET world and forthcomming Longhorn.
Ummmm...I have heard of apps that'll play a DVD movie on the desktop, behind all the icons and everything. Your desktop is still usable too! You might want to try checking into the technique's used there to paint the background image. I don't know that names of any packages, but you might want to check SourceForge.
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Nome
|
|
|
|
|
okay i recently made a VB program to allow a user to select a file and open it.. but the thing is..the openfile dialog box opens, it lets user chose a file to open..then wen u click open, nuthin opens! no error message comes but nothing gets opened...do i hav to maybe provide a data grid on the form to open the file? why cant it just open the file in its default environment? say u want to open a .txt file..why wont it open the .txt file in notepad? or do i NEED to provide a data grid on the form? does anyone know how it works? do i need to bind the file to a datagrid?!...Any comments are welcome!!!
rubdub
|
|
|
|