| Collect Item Return in diffrent order. |
|
 |
Index ‹ Visual Studio ‹ VB Scripts
|
- Previous
- 1
- MFC >> bug in Screen Saver Sample included in Visual C 6.0I'm trying to fix a bug in the Screen Saver sample in the Visual
Studio 6.0 suite. The following is a brief description of the bug:
When the program terminates CDrawWnd remains open. There remains
an empty window box in the task bar, for every instance of the terminated
program. The OnDestroy event occurs, even though the window doesn't
actually get destroyed. I have tried every way I can think of to
destroy the window manually, but to no avail.
Is there some special way to terminate a screen saver application that
I need to take into consideration?
Please try to e-mail me your replies, if you can.
Thanks,
Mikko Antero Gustafsson
mikko_gustafsson@hotmail.com
- 2
- Visual Basic [VB] >> printing a text file, printdocument1_printpage gets called TWICE for each page?!Ok, so this is driving me mad. For some reason, regardless of the
value of ev.hasmorepages, the printoducment1_printpage gets called
twice for every page. So, I print 2 pages of data on one page, with
the second overlaying the original data. If i set ev.hasmorepages to
false, essentially telling the printdocument to only print one page,
it prints one page, with two pages of data, because at the end of the
_printpage subroutine, even when ev.hasmorepages is false, it runs the
sub once more. Any help on this would be fantastic, below is my code:
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object,
ByVal ev As System.Drawing.Printing.PrintPageEventArgs) Handles
PrintDocument1.PrintPage
Dim linesPerPage As Single = 0
Dim yPos As Single = 0
Dim count As Integer = 0
Dim leftMargin As Single = ev.MarginBounds.Left
Dim topMargin As Single = ev.MarginBounds.Top
Dim line As String = Nothing
'ev.HasMorePages = True
' Calculate the number of lines per page.
linesPerPage = (ev.MarginBounds.Height /
printFont.GetHeight(ev.Graphics)) - 1
' Print each line of the file.
'If counterx = False Then
While count < linesPerPage
line = streamtoprint.ReadLine()
If line Is Nothing Then
Exit While
End If
yPos = topMargin + count *
printFont.GetHeight(ev.Graphics)
ev.Graphics.DrawString(line, printFont, Brushes.Black,
leftMargin, yPos, New StringFormat())
count += 1
End While
'End If
'If counterx = False Then
'counterx = True
'ElseIf counterx = True Then
'counterx = False
'End If
' If more lines exist, print another page.
If (line IsNot Nothing) Then
ev.HasMorePages = True
Else
ev.HasMorePages = False
End If
End Sub
..........THIS IS WHAT CALLS THE PRINTPAGE....
streamtoprint = New IO.StreamReader("C:\temp.dat")
Try
printFont = New Font("Times New Roman", 10)
AddHandler PrintDocument1.PrintPage, AddressOf
Me.PrintDocument1_PrintPage
PrintDocument1.Print()
Finally
streamtoprint.Close()
IO.File.Delete("C:\temp.dat")
End Try
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Thanks everyone!
- 3
- 4
- Visual Basic >> Getting SSID with WMI in VB6 - NewbI was looking for ways to get the SSID of an active Wireless Connection.
I've seen no other ways except to access it through WMI.
I know nothing of WMI & I'm having little luck getting documentation or
finding out how to get at WMI in VB6.
I found this link: http://www.furrygoat.com/PermaLink.aspx?guid=000993
It supposedly is how to get the SSID with WMI in .NET.
Can any kind soul direct me on how to acheive this goal in VB6? All
machines will be XP if that helps at all.
Thanx in Advance
Snuffy2
- 5
- 6
- Visual Basic >> Permission denied when trying to create Word objectHello,
I have some code that was running fine on NT, but I have since upgraded
(ie clean install) the machine to 2003 and am getting a permission
denied error when it hits the line ...
Set objWord = CreateObject("Word.Application")
I am running this from the VB IDe logged in as Administrator, so I'm not
sure what permissions I need to set. I thought I had permission to do
anything I liked !!
Using Word97 if that helps. TIA
--
Alan Silver
(anything added below this line is nothing to do with me)
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
- 7
- MFC >> opening a .pdf file...I have a dialog box with a button. In my button click handler I want
to open a .pdf file. What code would I write inside my handler
function to accomplish this?
Thanks,
RABMissouri2006
- 8
- Visual Studio C++ >> wsprintf?Having revisited some old code I am reminded of the existence of
wsprintf().
I vaguely remember from the old 16bit days that there was some
reason to prefer it over the standard C-library function sprintf(),
but I can't for the life of me remember what it was.
Does it have any advantages these days or is it just there for
legacy code?
Dave
--
David Webber
Author MOZART the music processor for Windows -
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mzusers/mailinglist.htm
- 9
- Visual Basic [VB] >> Looking for an intermediate/advanced VB .NET book that covers multithreadingGreetings. I received 4 VB .NET books and looking through the indices and
tables of contents, I see that none of them addresses multithreading in VB
.NET. I just bought a bunch of books because they were so cheap.
Does anyone have any suggestions for books that cover multithreading? I
have enough beginners books. I don't need any more. Need a good treatment
of multithreading. I've never used it in VB 6. I want to learn about it
in .NET.
I suppose I'd need something at the intermediate/advanced level.
I quickly looked at MSDN library for info. There's some in there. But
from my work with VS 6, I've learned that MSDN is good for reference, but
not for learning or tutorial purposes.
Thanks
- 10
- 11
- Mcse >> Re: Friday sweetnessMitchS <networkyoda@nospam.gmail.com> rambled:
>
> Congratulations, salutations, and emancipations. Does this mean you
> have control over the webblocker service now?
Webblocker? I know not of what you speak.
--
KB
MCNGP #26
www.mcngp.com owes me 35 bucks.
- 12
- Visual Basic [VB] >> How to get control identification from (Sender as Object)Hi,
I have this event that is performed by three different controls, how can
I know (from sender object) wich control is used to trigger the event?
Private Sub HighlightSelectedRow(ByVal sender As Object, ByVal e As
System.EventArgs) Handles tbxAmount.Click, lblID.Click, lblExpense.Click
Dim ctlControl As System.Type
ctlControl = sender.GetType
'???
Select Case ctlControl
'???
End Select
End Sub
Thanks
Marty
- 13
- MFC >> CDC::TextOut (or ExtTextOut) background colour troublesHi. I'm displaying some text on a dialog.
CPaintDC dc(this);
dc.TextOut(rect.left,rect.top,"HELLO");
On initial drawing of the dialog, the text background is white. As soon as a
control is used, the text background goes grey. Any way to make this not
change (or set to one colour)?
- 14
- Visual Basic [VB] >> mailer questionHello,
I made a mailer program from instructions I found on the web in vb2005.
It works, but doesn't seem to send the mail until I end the program.
Maybe there is some other command I need to get it to send?
Any help appreciated.
I know this is true, because my outgoing mail virus scan pops up when I
close the program, showing its scanning an outgoing email.
This doesn't happen till I end the program.
After that I get the message in my in box. Not while the program is up,
even though it says it sent.
Thanks.
Scott
Dim msg As New MailMessage("info@mysite.com", "scott@mysite.com")
msg.Subject = "My Email Subject"
msg.IsBodyHtml = True
msg.Body = "This is <i>the body</i> of the email message, it can also
contain HTML code in it"
Dim credential As Net.NetworkCredential = New Net.NetworkCredential
credential.UserName = "info@mysite.com"
credential.Password = "forward"
'Now we 've got everything we need to send the email except an SMTP server.
To create that just create a new instance of SmtpClient.
Dim client As New Net.Mail.SmtpClient()
'First we need to set up which SMTP server that the SMTP Client needs to use
client.Host = "mail.mysite.com"
client.UseDefaultCredentials = False
client.Credentials = credential
'client.EnableSsl = True
'The first line tells the SMTP client that we are supplying our own
credentials. The second line sets those credentials to the
NetworkCredentials we set up earlier. The third line tells the SmtpClient
that gmail uses SSL for authentication.
'Everything is ready to go now, all that is needed is to send the message.
Just call the send method supplying the MailMessage we created earlier.
client.Send(msg)
'client.SendAsync("scott@tryols.com", "scott@tyrols.com", "hi", "hi more",
"")
- 15
- MFC >> Alternative to 'AfxSetResourceHandle'Hi.
I am localizing my application, and using 'AfxSetResourceHandle'
function in this way, to load the appropriate resource:
CMyApp::CMyApp()
{
switch (GetUserDefaultLangID())
{
case MAKELANGID(LANG_ARMENIAN, SUBLANG_DEFAULT):
ASSERT((m_hResLibrary =
LoadLibraryEx(TEXT("MyApphye.dll"), NULL,
LOAD_LIBRARY_AS_DATAFILE)) != NULL);
break;
case MAKELANGID(LANG_RUSSIAN, SUBLANG_DEFAULT):
ASSERT((m_hResLibrary =
LoadLibraryEx(TEXT("MyApprus.dll"), NULL,
LOAD_LIBRARY_AS_DATAFILE)) != NULL);
break;
}
}
BOOL CMyApp::InitInstance()
{
// Set the resource handle to the appropriate resource DLL
if (m_hResLibrary)
AfxSetResourceHandle(m_hResLibrary);
return CWinApp::InitInstance();
}
The problem is that most MFC member functions use
'AfxGetResourceHandle' function, to obtain the default resource
library. For example, 'CBitmap::LoadBitmap' doesn't have a parameter
for instance handle, it uses 'AfxFindResourceHandle'. So do most
members of other classes. It means, I must create the same bitmap in
any resource DLL I use, but I don't want to do that. I want to
translate only localizable resources, the rest ones must reside in the
EXE. Is it possible to do?
Thanks in advance
Martin
|
| Author |
Message |
JamesCool

|
Posted: Tue Jan 18 14:23:04 CST 2005 |
Top |
VB Scripts >> Collect Item Return in diffrent order.
Hello all,
I'm not the best programer in the world so I was wondering if I could get a
little help from you all. I'm using VBScript to make a WMI call to the event
viewer on a 2003 server. The return for the query is great... Code snip.
et colEvents = objWMIService.ExecQuery ("Select * from Win32_NTLogEvent
WHERE (Logfile = 'System') AND (EventCode = '6005'or EventCode = '6008' or
EventCode = '1074' or EventCode = '1076') AND (SourceName <> 'W3SVC')")
intCount = 0
For Each objService in ColEvents
if objService.EventCode = "6005" THEN
strboottime = objService.Timewritten
end if
if objService.EventCode = "1074" THEN
intCount = intCount + 1
strstoptime = objService.Timewritten
strdiff = ( DateDiff("s", WMIDateStringToDate(strstoptime),
WMIDateStringToDate(strboottime)) )
intdiff = intdiff + strdiff
WScript.Echo "Down For: " & SecondsToText(strdiff)
This returns....
Down For: 1 Minute, 7 Seconds
Down For: 1 Minute, 24 Seconds
Uptime Report For: CSCS-IT-007C
Microsoft Windows XP Professional 5.1.2600
Install Date: 12/06/2004 11:28:17
Last Reboot: 01/11/2005 18:03:23
Up For: 6 Days, 17 Hours, 45 Minutes, 9 Seconds
Total Reboots: 2
Total Down Time: 2 Minutes, 31 Seconds
So far so good, now I want to change how far back data is collection so I
mode the query to look for timewritten... code snip...
Set dtmStartDate = CreateObject("WbemScripting.SWbemDateTime")
DateToCheck = Date - 365
dtmStartDate.SetVarDate DateToCheck, True
Set dtmEndDate = CreateObject("WbemScripting.SWbemDateTime")
dtmEndDate.SetVarDate Date, True
WScript.Echo "Start Date: " & dtmStartDate & " End Date: " & dtmEndDate
Set colEvents = objWMIService.ExecQuery ("Select * from Win32_NTLogEvent
WHERE TimeWritten >= '"&dtmStartDate&"' AND Logfile = 'System' AND (EventCode
= '6005'or EventCode = '6008' or EventCode = '1074') AND SourceName <>
'W3SVC'")
The problem I have is the output order is diffrent. Instead of DESC it now
AESC. I have tried to add ORDER BY TimeWritten but I get an error. Any
insite on how to change the order would be very helpfull.
Thanks
David.
Visual Studio162
|
| |
|
| |
 |
FreRange

|
Posted: Tue Jan 18 14:23:04 CST 2005 |
Top |
VB Scripts >> Collect Item Return in diffrent order.
Anothe note on this script.. I also tried to change this bit of code for the
date.... But it still returns events that are older the 365 days.
For Each objService in ColEvents
if objService.EventCode = "6005" [new here] AND objservice.TimeWritten >=
dtmStartDate THEN
strboottime = objService.Timewritten
strlastboot = WMIDateStringToDate(strboottime)
end if
if objService.EventCode = "1074" THEN
intCount = intCount + 1
strstoptime = objService.Timewritten
strdiff = ( DateDiff("s", WMIDateStringToDate(strstoptime),
WMIDateStringToDate(strboottime)) )
intdiff = intdiff + strdiff
WScript.Echo "Down For: " & SecondsToText(strdiff) & " On " &
WMIDateStringToDate(strstoptime)
end if
"FreRange" wrote:
> Hello all,
>
> I'm not the best programer in the world so I was wondering if I could get a
> little help from you all. I'm using VBScript to make a WMI call to the event
> viewer on a 2003 server. The return for the query is great... Code snip.
>
> et colEvents = objWMIService.ExecQuery ("Select * from Win32_NTLogEvent
> WHERE (Logfile = 'System') AND (EventCode = '6005'or EventCode = '6008' or
> EventCode = '1074' or EventCode = '1076') AND (SourceName <> 'W3SVC')")
>
> intCount = 0
> For Each objService in ColEvents
>
> if objService.EventCode = "6005" THEN
> strboottime = objService.Timewritten
> end if
>
> if objService.EventCode = "1074" THEN
> intCount = intCount + 1
> strstoptime = objService.Timewritten
> strdiff = ( DateDiff("s", WMIDateStringToDate(strstoptime),
> WMIDateStringToDate(strboottime)) )
> intdiff = intdiff + strdiff
> WScript.Echo "Down For: " & SecondsToText(strdiff)
>
> This returns....
>
> Down For: 1 Minute, 7 Seconds
> Down For: 1 Minute, 24 Seconds
> Uptime Report For: CSCS-IT-007C
> Microsoft Windows XP Professional 5.1.2600
> Install Date: 12/06/2004 11:28:17
> Last Reboot: 01/11/2005 18:03:23
> Up For: 6 Days, 17 Hours, 45 Minutes, 9 Seconds
> Total Reboots: 2
> Total Down Time: 2 Minutes, 31 Seconds
>
> So far so good, now I want to change how far back data is collection so I
> mode the query to look for timewritten... code snip...
>
> Set dtmStartDate = CreateObject("WbemScripting.SWbemDateTime")
> DateToCheck = Date - 365
> dtmStartDate.SetVarDate DateToCheck, True
>
> Set dtmEndDate = CreateObject("WbemScripting.SWbemDateTime")
> dtmEndDate.SetVarDate Date, True
> WScript.Echo "Start Date: " & dtmStartDate & " End Date: " & dtmEndDate
>
>
> Set colEvents = objWMIService.ExecQuery ("Select * from Win32_NTLogEvent
> WHERE TimeWritten >= '"&dtmStartDate&"' AND Logfile = 'System' AND (EventCode
> = '6005'or EventCode = '6008' or EventCode = '1074') AND SourceName <>
> 'W3SVC'")
>
>
> The problem I have is the output order is diffrent. Instead of DESC it now
> AESC. I have tried to add ORDER BY TimeWritten but I get an error. Any
> insite on how to change the order would be very helpfull.
>
> Thanks
> David.
>
>
>
|
| |
|
| |
 |
FreRange

|
Posted: Wed Jan 19 17:41:59 CST 2005 |
Top |
VB Scripts >> Collect Item Return in diffrent order.
Hello? Anyone out there *grin*. I know that I have an odd question but I
was hoping that I gave you all enough information to lead me in the right
direction....
Thanks
David.
"FreRange" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> Anothe note on this script.. I also tried to change this bit of code for
> the
> date.... But it still returns events that are older the 365 days.
>
> For Each objService in ColEvents
>
> if objService.EventCode = "6005" [new here] AND objservice.TimeWritten >=
> dtmStartDate THEN
> strboottime = objService.Timewritten
> strlastboot = WMIDateStringToDate(strboottime)
> end if
>
> if objService.EventCode = "1074" THEN
> intCount = intCount + 1
> strstoptime = objService.Timewritten
> strdiff = ( DateDiff("s", WMIDateStringToDate(strstoptime),
> WMIDateStringToDate(strboottime)) )
> intdiff = intdiff + strdiff
> WScript.Echo "Down For: " & SecondsToText(strdiff) & " On " &
> WMIDateStringToDate(strstoptime)
> end if
>
> "FreRange" wrote:
>
>> Hello all,
>>
>> I'm not the best programer in the world so I was wondering if I could get
>> a
>> little help from you all. I'm using VBScript to make a WMI call to the
>> event
>> viewer on a 2003 server. The return for the query is great... Code
>> snip.
>>
>> et colEvents = objWMIService.ExecQuery ("Select * from Win32_NTLogEvent
>> WHERE (Logfile = 'System') AND (EventCode = '6005'or EventCode = '6008'
>> or
>> EventCode = '1074' or EventCode = '1076') AND (SourceName <> 'W3SVC')")
>>
>> intCount = 0
>> For Each objService in ColEvents
>>
>> if objService.EventCode = "6005" THEN
>> strboottime = objService.Timewritten
>> end if
>>
>> if objService.EventCode = "1074" THEN
>> intCount = intCount + 1
>> strstoptime = objService.Timewritten
>> strdiff = ( DateDiff("s", WMIDateStringToDate(strstoptime),
>> WMIDateStringToDate(strboottime)) )
>> intdiff = intdiff + strdiff
>> WScript.Echo "Down For: " & SecondsToText(strdiff)
>>
>> This returns....
>>
>> Down For: 1 Minute, 7 Seconds
>> Down For: 1 Minute, 24 Seconds
>> Uptime Report For: CSCS-IT-007C
>> Microsoft Windows XP Professional 5.1.2600
>> Install Date: 12/06/2004 11:28:17
>> Last Reboot: 01/11/2005 18:03:23
>> Up For: 6 Days, 17 Hours, 45 Minutes, 9 Seconds
>> Total Reboots: 2
>> Total Down Time: 2 Minutes, 31 Seconds
>>
>> So far so good, now I want to change how far back data is collection so I
>> mode the query to look for timewritten... code snip...
>>
>> Set dtmStartDate = CreateObject("WbemScripting.SWbemDateTime")
>> DateToCheck = Date - 365
>> dtmStartDate.SetVarDate DateToCheck, True
>>
>> Set dtmEndDate = CreateObject("WbemScripting.SWbemDateTime")
>> dtmEndDate.SetVarDate Date, True
>> WScript.Echo "Start Date: " & dtmStartDate & " End Date: " & dtmEndDate
>>
>>
>> Set colEvents = objWMIService.ExecQuery ("Select * from Win32_NTLogEvent
>> WHERE TimeWritten >= '"&dtmStartDate&"' AND Logfile = 'System' AND
>> (EventCode
>> = '6005'or EventCode = '6008' or EventCode = '1074') AND SourceName <>
>> 'W3SVC'")
>>
>>
>> The problem I have is the output order is diffrent. Instead of DESC it
>> now
>> AESC. I have tried to add ORDER BY TimeWritten but I get an error. Any
>> insite on how to change the order would be very helpfull.
>>
>> Thanks
>> David.
>>
>>
>>
|
| |
|
| |
 |
| |
 |
Index ‹ Visual Studio ‹ VB Scripts |
- Next
- 1
- Visual Basic >> Trip to DisneyGET YOUR TRIP
TRIPS TO DESNEY
TRIPS TO HAWAII
http://travelexpert2004.us
http://travelexpert2004.biz
http://gotraveling85.us
- 2
- Visual Basic >> vb NameI use Name to rename a file.
All OK, Except when the directory name contains a space ..
Name c:\Test files\abc.txt c:\Test files\abc.txz
then Name fails.
Any suggestions please.
garry
- 3
- MFC >> OnCreate of CFrameWnd based splitter pane gets called twice!!!Hi All,
I have a splitter window, in which I want to have 3 panes (as vertical
columns).
My primary requirement is I want a menu inside one of the panes, i.e,
menu should belong to the pane and not the whole window.
To achieve this, I put a CFrameWnd derived class inside the pane. This
CFrameWnd derived class has the menu I want.
Now, my problem is that after I do this, the OnCreate of the FrameWnd
is getting called twice all the time. Can anyone help me know why this
is happening?
Or even better, does anyone have an alternate solution to putting a
menu in each pane of a splitter window?
Thanks
R
- 4
- 5
- VB Scripts >> CDONTS strangenessI'm trying to send a mail using CDONTS with a .FROM email
address that doesn't exist (like bob@nowhere.com), but it won't send
the mail unless I put a valid .FROM email address (i.e. of an email
address that exists)
The mails I try to send on the Windows 2000 server are moved into the
mailroot/Badmail folder as spam.. so this would seem to be a built-in
spam prevention tool that CDONTS employs.
This would be fine, if it always worked, but sometimes perfectly correct
email addresses don't work either.
Is there any way to disable this spam-prevention so that I can send
emails no matter what the .FROM email address is?
Cheers.
--
"I hear ma train a comin'
... hear freedom comin"
- 6
- Visual Basic >> Show previous instance?I use App.PrevInstance to assure that a second instance of my app
cannot be started. If it's True, I display a MsgBox telling the user
about it and then force a shutdown of the second instance.
What I would like to do is quietly shutdown the second instance and
bring the previous instance to the foreground maximized. How do I do
that?
(I'll bet this is on Randy's web site somewhere but I couldn't find
anything.)
- 7
- Visual Basic >> exe to be included as part of a MSI packageI wrote a little prg that must be included in an installer. I am not the
author of installers. As a matter of fact, I know nothing about them. The
author of the installer asked if I could return an error code that the MSI
could handle. Sure... I guess. How to I return something to the equivalent
of a command line?
Maybe I am confused. If so, feel free to dope slap me!
Thanks
S
- 8
- Visual Basic >> If.....Else?I have a WebBrowser control & a hidden ListBox. When the Form loads,
the ListBox gets populated with those sites which the user has
categorized as Restricted Sites (the ListBox actually gets populated
with the different URLs from a text file).
Now what I want is when the user types a URL in the address bar (which
is a ComboBox), first it has to be checked whether the typed in URL
exists in the ListBox or not. If yes, then show a MsgBox to the user
asking hime whether he would like to proceed ahead or not (since it is
a restricted site). If yes, take the user to the URL but if no, stay
there itself & change the URL of the ComboBox to what it was before the
user typed in the URL of the restricted site.
For e.g. a user first visits www.yahoo.com which is not listed as a
restricted site (though it will be checked first whether www.yahoo.com
is listed as a restricted site or not). Next he types www.google.com,
which is listed as a restricted site, in the address bar. When he
presses 'Enter' on the keyboard, since www.google.com is a restricted
site, he will be first shown a MsgBox asking whether he would like to
proceed or not. If yes, direct the user to www.google.com but if no,
stay there itself & change the address in the address bar to
www.yahoo.com (since before typing www.google.com, the user was in
www.yahoo.com).
This is what I tried:
Private Sub cboURL_Click(Index As Integer)
Dim iCount
For iCount = 0 To lstSites(0).ListCount - 1
If (InStr(cboURL(0).Text, lstSites(0).List(iCount)) > 0) Then
If (vbYes = MsgBox("Are you sure you want to proceed?",
vbYesNo)) Then
wWeb.Navigate2 cboURL(0).Text
Else
wWeb.Stop
End If
'Else
' wWeb.Navigate2 cboURL(0).Text
End If
Next
End Sub
Suppose the user types www.google.com, which is a restricted site, in
the address bar. He is shown the MsgBox. Assume that he clicks No; so
he stays put where he was & doesn't proceed ahead.
Assume that next he enters www.yahoo.com in the address bar which is
not a restricted site. Under such circumstances, the commented "Else"
condition would take the user to www.yahoo.com after verifying that
www.yahoo.com is not a restricted site BUT if that "Else" condition
(i.e. the second "Else" condition) is not commented, then when the user
had been shown the MsgBox asking him whether he would like to proceed
or not after he had typed www.google.com in the address bar, then
irrespective of whether the user clicks Yes or No in the MsgBox, he is
still directed to www.google.com. The bottomline is there can be 3
scenarios:
1. URL typed in the address bar exists in the ListBox; show MsgBox
a. If "Yes" is clicked in the MsgBox, let the user proceed forward to
the restricted site (MsgBox="Yes")
b. If "No", stay there itself & don't let the user proceed ahead.
(MsgBox="No")
2. URL typed by the user in the address bar doesn't exist in the
ListBox; so let the user go ahead (which is as good as MsgBox="No").
So on one hand, when MsgBox="No", then stay there itself but on the
other hand, when MsgBox="No", proceed ahead. This is where I am getting
stuck up i.e. the condition is the same (MsgBox="No") but 2 different
statements have to be executed.
Any ideas how do I overcome this problem?
Thanks,
Arpan
- 9
- MFC >> OT - Debug Windows EXEHi Guys,
Sorry about the offtopic message.
I have an old exe (16 bit). Don't have the source. I want to step throught
the exe. I tried loading it in VS 2003 and even 4.1 but couldn't get it to
do it.
I remember doing that with exe's back in DOS days. Opening the exe in TASM
and stepping through the exe.
Does anyone know of a program that will let me do this?
Ali
- 10
- Visual Basic [VB] >> Book recommendation?Has anyone read the book Microsoft .NET Remoting by Williams, Naftel, &
McClean (Microsoft Press)? There are mixed reviews on Amazon. I'd like to
know what you think. If you've also read Microsoft .NET Distributed
Applications: Integrating XML Web Services and .NET Remoting by MacDonald,
I'd also be interested in your opinion of that.
- 11
- MFC >> How to draw icon on button?Hello,
I have what I think is a simple question. How do I draw an icon on a
button? I set the "Icon" property for the button to true, but I don't know
what to do next.
Thanks.
- 12
- Visual Basic >> passing a textbox control in parameter listHi, I have an application that has about 3 subroutines that I'd like to use in another application so I decided to move them out into a DLL. Anyway, I moved them out and I call them from the two applications and they all work fine. When I moved them out, I temporarily commented out anything to do with the user interface - basically the routines do some processing of files that sometimes takes a long time so in the original application, the routines would update a little status form
What I'd like to do is popup the status form in each of the two applications and then call the subroutines in the DLL and then have the subroutine update the form. So I decided to add a simple textbox control in the subroutines' parameter list. When I go to compile the DLL I get
Compile error
Private object modules cannot be used in public object modules as parameters or return types for public procedures, as public data members, or as fields of public user defined type
This is the test subroutine that gives me the compile error
Public Sub test(t As Control
t.Text = "foobar
End Su
Am I stuck, am I doing something wrong? Is there a way around it? Any other suggestion of how to do what I'd like? Thanks
- 13
- Visual Basic [VB] >> Listview select from Textbox stringI have a text box select items in a listview as text is being typed
into the text box. I get the select bar to move correctly in the
Listview control.
If the user presses the down or up key in the text box, I want to move
to the selected item in the listview box.
The down or up arrow does set focus to the listview box and the
selected item switches from the grey of being unfocused to the blue of
focus. So far, so good.
Pressing the down arrow again moves to the second entry in the
listview instead of the entry below the currently highlighted entry.
Susbsequent cursor movements work.
Obviously, the selected table index that I'm using is not working
correctly. What do I need to do to fix it?
Private Sub txtLoc_TextChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles txtLoc.TextChanged
Dim boolFound As Boolean
Dim i As Integer
Dim intLen As Integer
Dim Item As ListViewItem
Dim strLoc As String
strLoc = txtLoc.Text.Trim ' Get the string
If strLoc = "" Or strLoc = Nothing Then Exit Sub
intLen = strLoc.Length ' Length of substring
For i = 0 To lvw.Items.Count - 1
Item = lvw.Items(i) ' Get the item
Try
If boolFound = False And Item.Text.Substring(0,
intLen) = strLoc Then
lvw.Items(i).Selected = True
lvw.Items(i).EnsureVisible()
boolFound = True
Else
lvw.Items(i).Selected = False
End If
Catch ex As Exception
lvw.Items(i).Selected = False
End Try
Next
End Sub
Private Sub txtLoc_KeyUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles txtLoc.KeyUp
If e.KeyData = Keys.Down Then lvw.Focus()
If e.KeyData = Keys.Up Then lvw.Focus()
End Sub
Thanks
- 14
- Visual Basic [VB] >> vb.net's CreateFileHi,
Private Declare Function CreateFile _
Lib "kernel32" Alias "CreateFileA" _
(ByVal lpFileName As String, _
ByVal dwDesiredAccess As Long, _
ByVal dwShareMode As Long, _
ByVal lpSecurityAttributes As Any, _
ByVal dwCreationDisposition As Long, _
ByVal dwFlagsAndAttributes As Long, _
ByVal hTemplateFile As Long) As Long
Private Declare Function closeHandle_ _
Lib "kernel32" _
Alias "CloseHandle" (ByVal hObject As Long) As Long
How to convert these to vb.net - or is there some other way of obtaining a
file handle. Well actually its "\\.\C:" i want to get to pass to another api
function
Stephen
- 15
|
|
|