|
im trying to make a slideshow kind of app in vb6 thats similar to MS powerpoint.
my idea is to use the MDI wizard and make each new child form as a slide.
my prob is , how do i access these children when i click on , say, a button called , run slideshow.
there must be some array of forms like MDI list where all the forms and their info must be stored right?
if i get that , then all i have to do is run a for loop and use form.show() !
any clues??
|
|
|
|
|
VB6 has an intrinsic collection called Forms. Use Forms(index) to index all the forms you have loaded (including the MDI Parent!). Forms.Count() will give you the number of forms in the collection.
RageInTheMachine9532
|
|
|
|
|
I am trying to create the com based add in for office to integrate the program our company has been developing.
I encounter the problem when you save "ActiveDocument.Save"
and "ActiveDocument.Saved" becomes false when activating another dialog or something else.
Does any one meet this problem and managed to solve?
Shi
|
|
|
|
|
There is a dll which I interface with using this code
thedll.SetReceiveCallback(new ApplicationClass.receiveCallback(MessageReceived));
At which point I can then declare a function and recieve info from the dll!
public virtual void MessageReceived(XmlDocument TheXmlMessage)
{
//Information from the dll
}
The problem is that I can't seem to get it to work in VB.Net!
Where am I going wrong please!
|
|
|
|
|
So far, you've posted the C# code, but not the VB code your using. With what you've posted, it should look something like this:
thedll.SetReceiveCallback(New ApplicationClass.receiveCallback(MessageReceived))
.
.
.
Public Overridable Sub MessageReceived(TheXmlMessage As XmlDocument)
' Information from the .dll
End Sub
We'll need to see the C# code your using and the VB code you translated it to so we can see what went wrong.
RageInTheMachine9532
|
|
|
|
|
Cheers for your help!
I have been playing around with it all day (well not all day) and finally got the end result which works so I appreciate the pointers!
Sorry I didn't post any of my VB code in but that was mostly because I didn't really have any!
Basically, I was trying to use the same code in C# but using VB.Net!
Here is my result and you can see that you have indeed helped me!
thedll.SetReceiveCallback(AddressOf MessageReceived)
Public Overridable Sub MessageReceived(ByVal XmlMessage As XmlDocument)
' Information from the .dll
MsgBox("hello")
End Sub
|
|
|
|
|
Hi,
I need to create a small EXE console application (NO USER INTERFACE) it will execute and when it has finish the code it will close.
I need a console app that will OUTPUT a value on a parallel port for 3 seconds, then quit. THAT's it.
Any Idea how to write this simple console APP ?
I'm using WINDOWS 2000 and VISUAL BASIC 6
Thank you.
|
|
|
|
|
VB6 can't build a console application directly. But it can build a normal Windows app that doesn't have an interface. On top of that, your app can't get direct access to the parallel port without a helper .DLL. See http://www.logix4u.net/[^] for a good example.
RageInTheMachine9532
|
|
|
|
|
Hi,
Thank you for your help, I was searching the web for info, and I saw yesterday the http://www.logix4u.net/, but its not working, my VB does'nt see the DLL. Did you try it ?
I have downloaded their test project and I can't make it run properly. Do I have to load in VB the DLL, or how can I access it.
I've only copied the DLL file to my project folder and in the windows system32 folder.
Any help will be appreciated.
Thank you,
Aldrin,
|
|
|
|
|
Yep and it works perfectly. You should post some of your code so we can see what you're doing right/wrong. Also, any error messages that you get should be included.
All you have to do to use it is copy the .dll to the system32 folder and put this code in a module or at the top of a form class:
Public Declare Function Inp Lib "inpout32.dll" Alias "Inp32" (ByVal PortAddress As Integer) As Integer
Public Declare Sub Out Lib "inpout32.dll" Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Integer)
Now, to use the functions:
Dim inFromPort As Long
Dim outToPort As Long
inFromPort = Inp(&H3F8) ' Or whatever port your trying to use.
Out &H3F8, outToPort ' Or whatever port and value your try to output.
RageInTheMachine9532
|
|
|
|
|
Hi,
Thank you very much for the help. I really appreciate.
By the way, is it possible to create a 3 seconds delay in VB ?
Do I need a special DLL for such thing ?
Thank you,
Aldrin,
|
|
|
|
|
Sure! The .DLL you need is already part of Windows so, no, you don't need a special one...
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Then just do this in your code where you need it to pause:
Sleep( 3000 ) ' 3 second delay...
RageInTheMachine9532
|
|
|
|
|
Hi,
Thank you very much, everything is working fine !
thanks to you,
Best regards,
Aldrin,
|
|
|
|
|
Set WshShell = Wscript.CreateObject("Wscript.Shell")
Pingtest = null
pCName = InputBox ("User I Number","Users I number","Btest")
drivelist = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z"
drivearray=Split(drivelist,",")
For I = 0 To UBound(drivearray)
pingtest = WshShell.Run ("cmd /c ping -n 1 "& pCName&Drivearray(I) , 6, True)
if pingtest = 0 Then
S = S & pCName&Drivearray(I) &VBLFCR
Else
End If
Next
MsgBox S
|
|
|
|
|
Ummm... You'll have to explain what you're trying to do a bit more that this.
From your code sample, your sending out 26 pings to 26 different names, all in their own command shells. They will all, of course, return success because the command you launched WILL launch, but the method your using will NOT return any kind of return code from PING itself.
RageInTheMachine9532
|
|
|
|
|
Dave,
Sorry for the confusion...here is what I am trying to do. I need a message box to popup for the actual computer names that I successfully ping, Would you like to continue" Yes or No (vbyesno).
You see the computer names in our environment should be named in succession a, b, c, d, and so on. (For example Britesta, Britestb, britestc.) However, some users on our network do not follow the naming conventions that we have used an name them out of order. (For example billtesta, billtestx, billtestz)
|
|
|
|
|
Sounds like a wacked naming scheme. Completely unenforcable without the special "policing" that your trying to do. Why the naming scheme in the first place and why rely on the users to name their own machines? That's expecting alot from a user...
Pinging names is not a reliable method to determine if a machine exists with that name or not. It can be broken simply by a machine being turned off or rebooting at the time the ping rolls around to it.
RageInTheMachine9532
|
|
|
|
|
Agreed! I did not implement this naming convention nor do I condone it. With the existing code how can I have a message box saying..."Ping successful would you like to continue" Yes or No. I am still sort of new at writing vbscripts, and new some assistance on this one. Thanks!
|
|
|
|
|
Well, you could put up a message box for every machine that comes back , but you would probably be better off just outputting a line for each result that comes back. That way, you can just walk away, let it do it's thing, and come back and look at the result:
Dim WshShell, PingResult, Target, PCName
Set WshShell = Wscript.CreateObject("Wscript.Shell")
PCName = InputBox ("User I Number","Users I number","Btest")
drivelist = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z"
DriveArray=Split(drivelist,",")
For I = 0 To UBound(DriveArray)
Target = PCName & DriveArray(I)
PingResult = WshShell.Run ("cmd /c ping -n 1 " & Target , 6, True)
Select Case PingResult
Case 0:
WScript.Echo "SUCCESS - " & Target
Case 1:
WScript.Echo "FAILURE - " & Target & "<<<"
End Select
Next
Run this using CSCRIPT from a CMD prompt. If you run this using WSCRIPT, the normal default, you'll get a dialog box on every ping, success or fail. But, this also makes it harder to terminate the script. You'll have to go into TaskManager to do it. Running it under CSCRIPT is just WAY more convenient:
C:\Documents and Settings\[userid]\Desktop>CSCRIPT PINGTEST.VBS
RageInTheMachine9532
|
|
|
|
|
Cool...Thanks for the Success Failure ping code! One last thing...Do you know how to use the answer function for the example below? I want to be able to continue or quit the wscript if possible. How would you code this?
Dim WshShell, PingResult, Target, PCName
Set WshShell = Wscript.CreateObject("Wscript.Shell")
PCName = InputBox ("User I Number","Users I number","BTest")
drivelist = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z"
DriveArray=Split(drivelist,",")
For I = 0 To UBound(DriveArray)
Target = PCName & DriveArray(I)
PingResult = WshShell.Run ("cmd /c ping -n 1 " & Target , 6, True)
Select Case PingResult
Case 0: WScript.Echo "SUCCESS - " & Target
MsgBox "Do you want to continue?", vbYesNo
End Select
Next
|
|
|
|
|
B Yac wrote:
Select Case PingResult
Case 0: WScript.Echo "SUCCESS - " & Target
MsgBox "Do you want to continue?", vbYesNo
End Select
The code should be:
.
.
.
For I = 0 To UBound(DriveArray)
Target = PCName & DriveArray(I)
PingResult = WshShell.Run ("cmd /c ping -n 1 " & Target , 6, True)
Select Case PingResult
Case 0: WScript.Echo "SUCCESS - " & Target
mbResult = MsgBox("Do you want to continue?", vbQuestion + vbYesNo)
If mbResult = vbNo Then
Exit For
End If
End Select
Next
RageInTheMachine9532
|
|
|
|
|
Greeetings,
I am attempting in VB.NET to somehow capture the network packet IIS gets before it checks for HTTP headers...
i.e. I wish to use IIS as my socket server(not create my own) and want the network packets it gets at port 80 regardless if it is an http or not.
How may I accomplish this in VB.NET ?
Thanks in advance.
incoming71
|
|
|
|
|
Check into ISAPI Filters. Warning: You'll have to P/Invoke a bunch of API calls to do this and the .NET FCL does not have anything to make this easy.
RageInTheMachine9532
|
|
|
|
|
hiiiii
i m developing an application in which i m picking pixel colors from an image and display these colors in a list box with the help of loop. can any body give me code.its urgent plz.
tc
regarfds
Tahir
|
|
|
|
|
You can use SetPixel and GetPixel its a win32 API
<br />
Public Declare Function SetPixel Lib "gdi32" Alias "SetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long<br />
<br />
Public Declare Function GetPixel Lib "gdi32" Alias "GetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long<br />
|
|
|
|
|