| How to get control identification from (Sender as Object) |
|
 |
Index ‹ Visual Studio ‹ Visual Basic [VB]
|
- Previous
- 1
- 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.
- 2
- VB Scripts >> Call a function from a com dll with byref argumentsHello,
For script support of our application we use a com-DLL that provides several
functions.
Now I need to include an additional function that returns two strings to the
caller:
HRESULT Test(BSTR* para1, BSTR* para2);
How can I call the function 'test' from within the VB Script, or how does
the prototype of the function need to be changed in order to be called from
within the VB Script?
Thanks
Frank Franzoni
- 3
- 4
- Visual Basic [VB] >> Binary RepresentationI want to show the binary equivalentcy of the numbers 1 -
256. I am writing my program as a console application
and I do not want to use any String formats. Can anyone
please get me started on the right track. Thank you in
advance.
D
- 5
- 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
- 6
- MFC >> About ShellExecuteHi,
I need open a new window when I use ShellExecute to browse a http web site,
but ShellExecute open the web site in a existent IE window. So how do i do?
Thanks
- 7
- MFC >> new C++ blogHi all,
Guys! we all share same interest here C++!
I just thought you might be interested in looking
at and hopefully subscribing yet another C++ blog:
http://cpptruths.blogspot.com
This blog is about "Intermediate to advanced material on C++ langugae
features, standards, idioms and design patterns." I try to publish some
serious and useful C++ and OO material on this blog. I also encourage
you to subscribe cpptruths@yahoogroups.com so that you don't have to
visit the website often. You will discover many useful resources on the
cpptruths@yahoogroups homepage. Publishing frequency is around 1/2
posts per week.
Thanks.
Sumant.
- 8
- MFC >> VC++6 OLE export to MS ProjectI didn't know which group to use for this question, so I have chosen 3. Hope
I haven't annoyed anyone!...
I'm using VC++ 6.0. I am writing an export facility to MS Project. I have
exported a bunch of tasks to MS Project. I have exported resource
information and successfully attached resources to the tasks.
Question 1:
I have had to do this all by guess work as I can't find any help system
anywhere that says which methods do what and what parameter types to use. Is
there a help system detailing what methods are available to C++ through OLE,
as I am sick of having to randomly guess which of the various OLE
methods/classes to use!!
I currently open up the target application (have linked to Excel also). I
open the VB editor and read through the object browser. This offers a little
help, but the methods available through OLE usually don't quite match the VB
ones!
Question 2:
How do I export task dependencies? I found a method - AddSuccessor on the MS
project "Task" class, but when I call it and pass the name of another task
in as the parameter it just throws a COleDispatchException with error, "The
value is not valid".
I have found 2 other classes - TaskDependency and TaskDependencies, but I
can't get them to work either.
HELP !!!
- 9
- 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
- 10
- 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
- 11
- Visual Studio C++ >> Graphic API, stretchHi All,
I have a picture, I want to it be repaint as stretch not original size.
I know how to use stretch API.
but I remember that is copy from a HDC, how to do that in my app?
Best regards,
Boki.
///////////////////////////////////////////////////////////////////////////////
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
// TextOut (hdc, 10, 250, psText, 9) ;
if (gpPicture)
{
// get width and height of picture
long hmWidth;
long hmHeight;
gpPicture->get_Width(&hmWidth);
gpPicture->get_Height(&hmHeight);
// convert himetric to pixels
int nWidth = MulDiv(hmWidth, GetDeviceCaps(hdc, LOGPIXELSX),
HIMETRIC_INCH);
int nHeight = MulDiv(hmHeight, GetDeviceCaps(hdc, LOGPIXELSY),
HIMETRIC_INCH);
RECT rc;
GetClientRect(hWnd, &rc);
// display picture using IPicture::Render
gpPicture->Render(hdc, 0, 0, nWidth, nHeight, 0, hmHeight, hmWidth,
-hmHeight, &rc);
}
EndPaint(hWnd, &ps);
break;
///////////////////////////////////////////////////////////////////////////////
- 12
- 13
- Visual Studio C++ >> importlib and include directoriesHello,
I would like to change my odl line:
importlib("c:\Program files\common files\system\ado\msado21.tlb");
to
importlib("system\ado\msado21.tlb");
and add "$(CommonProgramFiles)" to my "Additional include directories" (/I
setting in the midl compiler).
But this does not seem to work!
I really need a "generic" workaround since my project needs to be compilable
accross multiple machines which do not always have the same
"CommonProgramFiles" directory. The "Additional include directories" (/I)
works in cl but not in midl.
Any ideas?
Many thanks,
SerGioGioGio
- 14
- VB Scripts >> Enumerate everything below and including Domain users?Hi,
I have a script such as listed below. The script enumerates the contents of
a OU called Domain Users. This is great however I have two child OU's, under
Domain users, one called a users and one called b users.
I.e.
Ou - Domain Users
Ou - a
User A
Ou - b
User B
What do I need to add to this script to get it two enumerate everything
below and including Domain users?
Thanks
' Export all valid recipients (= proxyAddresses) into a
' file virtual.txt
'
' Ferdinand Hoffmann & Patrick Koetter
' 20021100901
' Shamelessly stolen from
' http://www.microsoft.com/windows2000/techinfo/ \
' planning/activedirectory/bulksteps.asp
'Global variables
Dim Container
Dim OutPutFile
Dim FileSystem
'Initialize global variables
Set FileSystem = WScript.CreateObject("Scripting.FileSystemObject")
Set OutPutFile = FileSystem.CreateTextFile("virtual.txt", True)
Set Container=GetObject("LDAP://OU=Domain Users,DC=testing,DC=local")
'Enumerate Container
EnumerateUsers Container
'Clean up
OutPutFile.Close
Set FileSystem = Nothing
Set Container = Nothing
'Say Finished when your done
WScript.Echo "Finished"
WScript.Quit(0)
'List all Users
Sub EnumerateUsers(Cont)
Dim User
'Go through all Users and select them
For Each User In Cont
Select Case LCase(User.Class)
'If you find Users
Case "user"
'Select all proxyAddresses
Dim Alias
If Not IsEmpty(User.proxyAddresses) Then
For Each Alias in User.proxyAddresses
OutPutFile.WriteLine "alias: " & Alias
'WScript.Echo Alias
Next
End If
Case "organizationalunit" , "container"
EnumerateUsers User
End Select
Next
End Sub
- 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 |
spfeltman

|
Posted: Sat Oct 09 13:09:24 CDT 2004 |
Top |
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
Visual Studio242
|
| |
|
| |
 |
Jared

|
Posted: Sat Oct 09 13:09:24 CDT 2004 |
Top |
Visual Basic [VB] >> How to get control identification from (Sender as Object)
You can use TypeOf and CType.
If TypeOf sender Is Label Then
Dim lbl As Label = CType(sender, Label)
Select Case lbl.Name
Case Is = "lblID"
' do something
Case Is = "lblExpense"
' do something
End Select
ElseIf TypeOf sender Is TextBox Then
Dim txt As TextBox = CType(sender, TextBox)
' do something
End If
"Marty" <EMail@HideDomain.com> wrote in message
news:tIV9d.298$EMail@HideDomain.com...
> 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
>
>
|
| |
|
| |
 |
Marty

|
Posted: Sat Oct 09 13:27:36 CDT 2004 |
Top |
Visual Basic [VB] >> How to get control identification from (Sender as Object)
Wonderful, thanks you!
Marty
Jared wrote:
> You can use TypeOf and CType.
>
> If TypeOf sender Is Label Then
> Dim lbl As Label = CType(sender, Label)
> Select Case lbl.Name
> Case Is = "lblID"
> ' do something
> Case Is = "lblExpense"
> ' do something
> End Select
> ElseIf TypeOf sender Is TextBox Then
> Dim txt As TextBox = CType(sender, TextBox)
> ' do something
> End If
>
> "Marty" <EMail@HideDomain.com> wrote in message
> news:tIV9d.298$EMail@HideDomain.com...
>
>>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
>>
>>
>
>
>
|
| |
|
| |
 |
Cor

|
Posted: Sun Oct 10 02:35:30 CDT 2004 |
Top |
Visual Basic [VB] >> How to get control identification from (Sender as Object)
Marty,
In addition to Jared,
Keep in mind that you do not have to know the type when the member is
inheritted from control.
They have by instance all name, text, click etc.
Cor
|
| |
|
| |
 |
| |
 |
Index ‹ Visual Studio ‹ Visual Basic [VB] |
- Next
- 1
- 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)?
- 2
- 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
- 3
- 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!
- 4
- 5
- 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.
- 6
- 7
- 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 =---
- 8
- 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.)
- 9
- 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
- 10
- Visual Basic >> Trip to DisneyGET YOUR TRIP
TRIPS TO DESNEY
TRIPS TO HAWAII
http://travelexpert2004.us
http://travelexpert2004.biz
http://gotraveling85.us
- 11
- 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
- 12
- 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",
"")
- 13
- 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
- 14
- 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
- 15
|
|
|