Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Outlook automation
Message
 
To
10/04/2003 20:42:48
Henry Ravichander
RC Management Systems Inc.
Saskatchewan, Canada
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00776065
Message ID:
00776523
Views:
60
>Which Brian are you referring to? Will the above mentioned sharewares do a >complete job on emails.

Hello, I am the Brian previously mentioned. Yes, the SMTP controls mentioned should be pretty thorough for sending mail. I do know that it takes months of research and development to create these controls to implement the fully RFC specs and handle different server abnormalities and undocumented behaviors.


>BTW, how does one register files manually or automate registering of files, >specially in the situation that i am facing in my other thread.

Are you attempting to register ActiveX controls? I cant find your previous thread. If so, then their are a variety of ways to handle it.
One way is to shell out to Regsvr32, but that is not the ideal way.

Below is Visual Basic code to directyly open the file and execute the DLLRegister function. You should be able to port this to foxpro.
It is commented, in Visual Basic ' is a comment identifier. The declares reference API function calls.

--------------------------------------------------------------------------
Private Declare Function GetFileVersionInfoSize Lib "VERSION.DLL" Alias "GetFileVersionInfoSizeA" _
(ByVal lptstrFilename As String, lpdwHandle As Long) As Long
Private Declare Function GetFileVersionInfo Lib "VERSION.DLL" Alias "GetFileVersionInfoA" _
(ByVal lptstrFilename As String, ByVal dwhandle As Long, ByVal dwlen As Long, lpdata As Any) As Long
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" _
(ByVal lpLibFileName As String) As Long
Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, _
ByVal lpProcName As String) As Long
Private Declare Function CreateThread Lib "kernel32" (lpThreadAttributes As Any, _
ByVal dwStackSize As Long, ByVal lpStartAddress As Long, ByVal lParameter As Long, _
ByVal dwCreationFlags As Long, lpThreadID As Long) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, _
ByVal dwMilliseconds As Long) As Long
Private Declare Function GetExitCodeThread Lib "kernel32" (ByVal hThread As Long, _
lpExitCode As Long) As Long
Private Declare Sub ExitThread Lib "kernel32" (ByVal dwExitCode As Long)
Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long

Public Function RegUnReg(ByVal sFileName As String, Optional Register As Boolean = True) As Boolean
On Error Resume Next
Dim lLib As Long ' Store handle of the control library
Dim lpDLLEntryPoint As Long ' Store the address of function called
Dim lpThreadID As Long ' Pointer that receives the thread identifier
Dim lpExitCode As Long ' Exit code of GetExitCodeThread
Dim mThread
Dim mresult

' Load the control DLL, i. e. map the specified DLL file into the
' address space of the calling process
lLib = LoadLibrary(sFileName)
If lLib = 0 Then
' e.g. file not exists or not a valid DLL file
MsgBox "Failure loading control DLL"
Exit Function
End If

' Find and store the DLL entry point, i.e. obtain the address of the
' “DllRegisterServer” or "DllUnregisterServer" function (to register
' or deregister the server’s components in the registry).
'
If Register Then
lpDLLEntryPoint = GetProcAddress(lLib, "DllRegisterServer")
Else
lpDLLEntryPoint = GetProcAddress(lLib, "DllUnregisterServer")
End If
If lpDLLEntryPoint = vbNull Then
GoTo earlyExit1
End If
Screen.MousePointer = vbHourglass
' Create a thread to execute within the virtual address space of the calling process
mThread = CreateThread(ByVal 0, 0, ByVal lpDLLEntryPoint, ByVal 0, 0, lpThreadID)
If mThread = 0 Then
GoTo earlyExit1
End If

' Use WaitForSingleObject to check the return state (i) when the specified object
' is in the signaled state or (ii) when the time-out interval elapses. This
' function can be used to test Process and Thread.
mresult = WaitForSingleObject(mThread, 10000)
If mresult <> 0 Then
GoTo earlyExit2
End If

' We don't call the dangerous TerminateThread(); after the last handle
' to an object is closed, the object is removed from the system.
CloseHandle mThread
FreeLibrary lLib

Screen.MousePointer = vbDefault
'MsgBox "Process completed"
RegUnReg = True
Exit Function


earlyExit1:
Screen.MousePointer = vbDefault
MsgBox "Process failed in obtaining entry point or creating thread."
' Decrements the reference count of loaded DLL module before leaving
FreeLibrary lLib
Exit Function

earlyExit2:
Screen.MousePointer = vbDefault
MsgBox "Process failed in signaled state or time-out."
FreeLibrary lLib
' Terminate the thread to free up resources that are used by the thread
' NB Calling ExitThread for an application's primary thread will cause
' the application to terminate
lpExitCode = GetExitCodeThread(mThread, lpExitCode)
ExitThread lpExitCode
End Function
--------------------------------------------------------------------------


Hope this code helps. It should definitely show you how to register a product.

Brian Seekford
Brian Seekford
Seekford Solutions, Inc.
http://www.SeekfordSolutions.com
Internet ActiveX Controls and .NET Class Libraries.
SMTP/S FTP POP3/S HTTP/S SNTP MIME PING WHOIS TRACEROUTE NNTP DNS MX
Base64, UUEncode, yEnc, MD5, SHA1, URL, Quoted-Printable.
Resizer and Tooltips
Email Verification and more. Check us out!
Previous
Reply
Map
View

Click here to load this message in the networking platform