|
Can someone give a brief explanation / website links that explain the windows message queue and how it works. vb.net examples would be helpfull. Thanks in advance.
Jim
|
|
|
|
|
Hi,
Try following links. I hope you get want you want.
1> http://www.codeproject.com/dialog/queue.asp
2> http://www.pcprogramming.com/DDNUG/VCSHARP/RemotingNotes.htm
3> http://www.openip.org/oa/notes_gem.txt etc.
You can query in google with "Windows Message Queue". You will find number of sites with brief explanation.
Best Regards,
Vilas Shewale
|
|
|
|
|
Thanks Vilas
Jim
|
|
|
|
|
Hello,
I would like to ask a very simple question. How can I open three or so programs using a script. I would like to pause about 30 seconds between them also. I talked to some friends at work and they said to use a vbscript, which is completely forien to me. Any help would be nice. Thanks.
Shades
|
|
|
|
|
Use the ShellExecute and a Timer to control how often the functions are called. To call the ShellExecute API add this to a module:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hWnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
-Nick Parker
|
|
|
|
|
Using VBScript and the Windows Scripting Host, it is possible to control a variety of things through "animation" of standard Windows applications. In your case, you could do something like the following:
' myScript.vbs --
Dim wshell
Set wshell = WScript.CreateObject("WSCript.shell")
wshell.run "calc.exe"
WScript.Sleep 30000
wshell.run "notepad.exe"
Enter the commands into a file using Notepad or your favorite editor and save it with a file extension of ".VBS". Double-click on the VBS file to execute the script. On 99% of desktops equipped with IE5.5+, this will function correctly.
For more information, see MSDN > Platform SDK > Tools and Scripting > Windows Script Host.
|
|
|
|
|
Hi All,
I am a new user to the Business Objects application. I have previously utilized VBA (within Access and Excel) for about a year. Basically, I'm looking for some information regarding integrating VBA into Business Objects. Some tutorials would be great, especially on the syntax aspects of VBA as it pertains to Business Objects.
Any information on the above topics would be very helpful.
Thanks for your time,
Nick
|
|
|
|
|
Hello everybody. I need a little urgent help, i pressed any strange and wronge key combination while triying to delete selected text, and since then (i believe) the text came wrapped and now the horizontal bar has disappeared so i'm limited to the window width for html code editing (ASP.Net projects, in all html-codeedit forms). thanks
|
|
|
|
|
I am trying to call the Windows API function "GetUserName" from VB 6, and it always returns 0 for failure. However, I can call this exact same function from Visual C++ 6.0 and it works just fine...
Here is the code:
Declare Function _
GetUserName Lib "Advapi32.dll" Alias "GetUserNameA" _
(ByRef lpBuffer As String, ByRef nSize As Integer) As Long
Dim strUserName As String
Dim nUserLen As long
Dim nRetVal as long
nUserLen = 32
strUserName = Space(nUserLen)
retVal = GetUserName(strUserName, nUserLen)
There are 10 kinds of people - those that get binary and those that don't.
|
|
|
|
|
What do you mean by "it doesn't work"? What happens?
Also, you are declaring nUserLen as Long and the variable nSize as Integer. They should both be the same type as each other (either type is fine, but you don't really need it to be as big as a Long).
You might consider making the buffer be bigger than 32 characters, because if the UserName happens to be longer than this (but it generally isn't) the function will fail.
When you are done calling this function you should do:
strUserName=Left(strUserName, nUserLen)
This will cut off the unnecessary bytes.
"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
|
|
|
|
|
jdunlap wrote:
What do you mean by "it doesn't work"? What happens?
I mean it just returns 0 for failure, the string contains the 32 spaces that I initilialized it with and nUserLen is still 32.
Oddly enough, when I call "GetLastError" afterwards to find out the exact reason it failed, that too returns 0, for no error!
jdunlap wrote:
Also, you are declaring nUserLen as Long and the variable nSize as Integer
I have tried all combinations of integer/long with the exact same results.
Just above this section of code (in the same sub actually), I am calling another API function, "GetPrivateProfileString", and it works just fine. I can also call "GetUserName" from C++ and it works as expected.
I am wondering if there's some other library or something that I need instead of kernel32, as we are on a Novell network here and not the standard MS networking... It's still strange how it works from C++ though...
jdunlap wrote:
You might consider making the buffer be bigger than 32 characters
Yeah, you're probably right, but since my user name is only 3 characters I figured it would be big enough for testing...
There are 10 kinds of people - those that get binary and those that don't.
|
|
|
|
|
Declare Function _
GetUserName Lib "Advapi32.dll" Alias "GetUserNameA" _
(ByRef ByVal lpBuffer As String, ByRef nSize As Integer) As Long
If you pass it ByVal, then VB does the marshalling for you, and it acts like a ByRef byte array. VB does unicode BSTRs, so if you pass it ByRef, it passes the unicode BSTR, which Windows doesn't understand.
"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
|
|
|
|
|
Thanks! It works fine now
There are 10 kinds of people - those that get binary and those that don't.
|
|
|
|
|
How can you validate a user login to your application against the local machines windows user database? Against a domain?
|
|
|
|
|
|
Thank you for the link. I tried it and it works fine in VB6. Do you know if there is a .net class or anything that will achieve the same thing?
|
|
|
|
|
I have some vb.NET code at home that does htis. I can get it to you latter today.
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.
|
|
|
|
|
Thank you very much! That would be extremly helpful!
|
|
|
|
|
i have server client program working using one of the tutorials but i would like to be able to save the log that the server produces for everytime a client logs on i have managed to save and load from text boxes using:
Dim hFile As Long
Dim sFilename As String
sFilename = "c:\log.txt"
'obtain the next free file handle from the
'system and and save the text box contents
hFile = FreeFile
Open sFilename For Output As #hFile
Print #hFile, txtReceive.Text
Close #hFile
but i was wondering if there was a similar way to save all the items in a list box to a log and a way that it could be called back again! any help would be great!
.: Lister :.
|
|
|
|
|
it looks like you are using VB 6.0, you should try using the FileSystemObject
Steve
|
|
|
|
|
thanx steve but i dont really know much about FileSystemObject i had a look on msdn libraries to find out some stuff and found how to create a file and add text to it but not what ever was in the list box thanx for trying tho!
.: Lister :.
|
|
|
|
|
Any body know how to use (make) a bit array.
Thanks
|
|
|
|
|
What's the question?
BitArray stores as many boolean values as you want, well, up to 2,147,483,647 of them anyway. First you declare a BitArray object with the number of bits you want to store, say, 100 of them:
Dim myBitArray As New BitArray(100)
Then you use the Item Property to get/set individual values:
For Index = 0 to 99<br />
myBitArray.Item(Index) = True<br />
Next Index
RageInTheMachine9532
|
|
|
|
|
OK, thanks for your answer.
specificaly my question is : How construct the "Binary Blob" from this string "1234567-8".
thanks.
|
|
|
|
|
What are you doing with the blob? Are you doing something with a database?
RageInTheMachine9532
|
|
|
|