Send Receive Problem I Have In My Projects ( Server && Client )
Hello all, How are you??
Befoure I'll copy a really big pice of code I was thinkin' your expereience might help me!
I'm developin' few projects in the same time, though i'm developing a Server & Client match software for secure data transffers.
IanB was helped me in a thread I opened about "How to get data from a file into var with limit" ( ex. 1024kb each time ) He gave me the next code: Code: Private Const CPY_BUFFER = 1024
Public Function SendFile(ByVal sSource As String) As Boolean Dim iSNr As Integer Dim dCount As Double Dim dRest As Double Dim sTemp As String Dim i as Long
SendFile = True
iSNr = FreeFile Open sSource For Binary As iSNr dRest = LOF(iSNr) If dRest < 1 Then Close iSNr GoTo ERROR_HANDLER End If
If dRest > CPY_BUFFER Then sTemp = Space(CPY_BUFFER) dCount = Int(dRest CPY_BUFFER) For I = 1 To dCount Get iSNr, , sTemp ' Send sTemp Here dRest = dRest - CPY_BUFFER Next sTemp = Space(dRest) Get iSNr, , sTemp ' 1 final send for any bytes left over (if file is not a multiple of buffer size) Else sTemp = Space(dRest) Get iSNr, , sTemp ' 1 send here where file < buffer size End If
Close iSNr Exit Function
ERROR_HANDLER: SendFile = False Close iSNr End Function
& I edited & update this code to work once on my Server & once on my Client to do the same 2 things. 1 - To Download data & store it in a new file 2 - To Upload data & grab data from a file.
It is working fine! thoughhhh!! in 1 update i made for this code, was that I added progressbar to the progress of the sends & receive. In the Server while i'm sendin' a file I'm gettin' it in the same time in the Client side! BUT!! & here is a big! hugh! B-U-T in here! When the Client sends data it sends it really fast, & the server getting it after some time ( Without stucks or anything ) , the file received succefully but in a late...
Any ideas what can make the diffarents? the Send Receive codes are wrotten the same in the server & in the client with the same Var's!
Any idea of you will might give me a solution, Thanks in advance, & sorry for the use of many many words to describe my problem in this thread :/
Thanks in advance, yours, Yoni D.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Send/Receive From An Internet Server....
This is a very vague question. I'm trying to design an application to use between myself and my family. I have a server already to use but I have absolutely no clue what is needed to talk back and forth on this server. The closest example I can think of is a multiplayer game. Data is sent/received from a server in a real-time status.
Because I don't know where to even start, I can't design anything. I'm thinking of setting up a database and dropping it on the server, but I don't know how to connect to it. Is there something like ADO? If so, would the source contain the IP address and root directory of the database? I just have no clue. If anyone can supply any information at all, I would greatly appreciate it.
Send Message To Remote Computer(client/server)
hi;
i have a program.the program is send message to remote computer.send computer is server.server only send message.the remote computer is only client so receive message for read (and print).i have(know) Remote computers ip number.need ip number for communication.I used net send but couldnt.please help me.
Thans...
Send A Multi-function Command From A Client To A Server, Useing Winsock
im new to the winsock control...
i have created a server, and a client which successfully connect, and send and receive data. i want to be able to send one string of data to the server which the server can split up and use those separate strings to execute different commands.
e.g.
i want to send a (one single) string to the server which tels it to display a message box. when the string arives the server splits the string int the folloing variabls
strCMD = "1"
'the command to execute in this case a message box.
strPar1 = "Error!"
'the first parameter for the message box in this case the message box title.
strPar2 = "This is a message from the client!"
'the second Parameter for the message box, in this case, the message to be displayed.
strPar3 = "4096"
' the type of message box to be displayed, in this case system modal.
i have developed ways of acheiving this but they are unreliable and constantly cause errors. if i could send a string array, that would be perfect, but i cannot work out how to do that.
please tell me what to do!!!
Winsock, I Made A Server-Client... Now I'm Trying To Make A Server-Client+++
Trying to get this Winsock Chat thing to support more than 1 person. I don't know at ALL what to do... Could anyone push me in the right direction?
Also, I need help getting screen names to work as well. Thanks.
As you will see, I attempted to add multiple connections myself... I failed. =[
I'm using VB6.
Code:Option Explicit
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const EM_LINESCROLL = &HB6
Dim ClientNum As Integer
Private Sub cmdSend_Click()
Dim strdata As String
strdata = "Server : " & txtmsg.Text
tcpServer(0).SendData strdata
Text1.Text = Text1.Text & strdata & vbCrLf
txtmsg.Text = ""
SendMessage Text1.hwnd, EM_LINESCROLL, 0, 10
End Sub
Private Sub Form_Load()
Dim s As String
s = InputBox("Server Port Number: ")
tcpServer(0).Close
tcpServer(0).LocalPort = s
tcpServer(0).Listen
End Sub
Private Sub Form_Activate()
txtmsg.SetFocus
End Sub
Private Sub tcpServer_ConnectionRequest(Index As Integer, ByVal requestID As Long)
If Not tcpServer(0).State = sckConnected Then
ClientNum = ClientNum + 1
tcpServer(ClientNum).Close
Load tcpServer(ClientNum)
tcpServer(ClientNum).Accept requestID
Text1.Text = "User has entered the server..." & vbCrLf
SendMessage Text1.hwnd, EM_LINESCROLL, 0, 10
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
MsgBox "Wanna-Be AIM"
tcpServer(0).Close
End Sub
Private Sub tcpServer_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Dim strdata As String
tcpServer(0).GetData strdata
Text1.Text = Text1.Text & strdata & vbCrLf
SendMessage Text1.hwnd, EM_LINESCROLL, 0, 10
End Sub
How To Send A Message To DDEML Client When The DDEML Server Goes Down
Dear Friends,
I have completed a full DDEML Client...
My Client Program collects data from an Third party server..over which have no control..
Now when the third party server crashes or closes for some uncontrolled reason...I want my Client program to be able to find out that the server has stopped..
Is there any function to find out whether the server is still on...i have tried DDEConnectList but it does not work...
I have also tried the DDECallBack function whether it sends any of these flags when the server goes down
XTYP_DISCONNECT,
XTYP_ERROR
but no success..
I have also checked out the msdn.microsoft.com...but nothing specifically in this context mentioned
Thanks
Regards
Mustafa
Send And Receive Sms Help!
hello,
in my final project i use moblie to send and Receive Sms but i want a soooo sample code to make that
i find 2 code for send and i want only 1 code to Receive Sms
Any one Know it or from where i can get it?
__________
the 2 code for send is:
__________1st____________
' Requires ASmsCtrl.dll by ActiveXperts Software (www.activexperts.com/files/activsms/asmsctrl.dll)
Option Explicit
Dim asObj
Set asObj = CreateObject( "ActiveXperts.SMSC" )
Wscript.Echo "ActiveXperts SMS/Pager Toolkit " & asObj.Version & " demo."
WScript.Echo "Please visit http://www.activexperts.com/activsms/smsclist/ for a list of SMSC service providers. Use the appropriate provider properties in the fields of the object, like ProviderType, ModemSpeed, ModemsSettings and so on)"
asObj.ProviderDialString = "1122334455" ' Provider's full dial-in number, including dial prefixes, int. dialoing codes etc.
asObj.ProviderType = 1 ' UCP = 0, TAP = 1
asObj.PortID = 1 ' Comport
asObj.ModemSpeed = 1200 ' Depends on provider. 1200bps is most common
asObj.ModemSettings = "7,e,1" ' 7,e,1 or 8,n,1. Depends on provider
asObj.Sender = "00000000000" ' Set your own mobile phone number here; only digits are allow, minimum 1 character, max. 16 characters
asObj.Recipient = "004412345678" ' Recipient's mobile phone number. Format depends on providers. Most common formats are: 004412345678, 4412345678 and 12345678
asObj.MessageText = "Hello, world" ' SMS message to send. Must be less than 160 characters
asObj.LogFile = "c:smslog.txt" ' Trace log to see what's going on
asObj.SendMessage TRUE ' TRUE means: through provider, not through GSM
If( asObj.LastError <> 0 ) Then
WScript.Echo "Failed to send message, error: " & asObj.LastError & " (" & asObj.GetErrorDescription( asObj.LastError ) & ")"
WScript.Echo "To view the trace file, open " & asObj.LogFile & "."
Else
WScript.Echo "Message successfully delivered"
End If
______________2nd___________
COM1.CommPort = Val(txtCommPort)
COM1.CommSetting = txtCommSetting
COM1.SMSCenter = txtSMSCenter
COM1.SMSMessage = txtSMSMessage
COM1.SMSNumber = txtSMSNumber
COM1.Send
MsgBox "The phones reply is " & COM1.ErrorMessage
'smsocx wanted from www.smsocx.com
Send And Receive
Hey! anybody can give me a little idea on how can i send and receive message like the default features in cellphone, using vb apps... anybody? really appreciated...
Coz' now i'm using a third party software (SMS from intellisoftware.co.uk) for that, and i want to create a program like such things.
What i want is where i gonna start? components needed? I'm just how can vb do that?
I have already now a modem, antenna (outdoor), pc (with vb) hehe... becuase these are the important requirements needed from intellisoftware.
I have already dowloaded a third party software (30-day trial), including send and receive message features. As I've browsed and studied their application they are using MS Access to store outgoing/incoming data.
Please help me out regarding this, just an idea on how these things worked...
Thanks in advance if you would. I knew if it's worked, there's something will send you back. hehehe Just an idea... ok?????
noielen
Send And Receive UDP
HI all,
Just a quick question as i am fairly new to VB.
Is there an applicatoin already existing that can send and receive UDP packets to and from particular IP addresses.
Or if there isn't could anyone give some pointers as to how i would go about this task.
Thanks in advance!!
Chris
How To Send And Receive SMS
Hi everybody!!!
I want to make an VB6 application to send and receive SMS via data cable and mobile phone. Can someone tell me how to start? Is there any ActiveX control for this?
Please help me!!!
Send/receive From Webpage (possible?)
Hi all,
I want to design a program in VB.NET that can send and receive information from a website. For example, the VB program can take a users name, open up a website address, enter the name in the web search field, run the search, then display the returned page within the program. I've looked over the internet and it seems that this may be impossible, but I just wanted to consult you guys and see if anyone knew differently. I don't think I can use asp as I don't own the website I would be contacting. I guess an easy way to imagine it is a program where you can type in a search term, which would then check with google and display the results as an HTML document within the program
Simple Send->Receive
Does anyone have any idea of how to write a simple send receive over an RS232?
I've got the send part as mscomm1.output = message, but how would i then get it to receive the returned signal.
Apologies if this is a simple question but i'm not a programmer, I'm an electrochemist.
Thanks
Sean
WinSock Send/Receive
Hello,
I was recently writing a program that uses WinSock to send and receive data (duh). This is obviously showing my lack of programming logic, but hey :-)
What I am confused about is how the client receives the data from the server. IE (I try to do some MSN messenger programming here and there), the client connects to MSN's server, sends the first packet, and the server responds. How would you check to see what the server responded with? Is there a property in WinSock that will return that?
Thanks in advance =)
Outlook Send/receive
I found the previous thread on send and receive from outlook (jun 2003), and it really helped, I have managed to get this far now:
Dim MyCommandBar As CommandBar
Dim oCtl As CommandBarControl
Set MyCommandBar = OutlookApp.ActiveExplorer.CommandBars.Item("standard")
Set oCtl = MyCommandBar.Controls.Item("Send/Receive")
oCtl.Execute
when I debug the enabled status for this control it is enabled, the caption is correct, so why does the execute fail. This is the message I get
Method 'Execute' of object 'CommandBarPopup' failed.
p.s. I have exchange open and conected to the internet, so I tried making the command bar invisible and that worked
why is it trying to use the command bar popup execute?
how can I make it work?
VBA Conditional Send/Receive
Hi, all.
I've got the following code:
Set octl = oOL.ActiveExplorer.CommandBars.FindControl(ID:=5488)
octl.Execute
The above VBA code finds the Send/Receive button, and basically clicks it, causing Outlook to do a Send/Receive.
The code is a small part of my spam reporting VBA code. After I click the 'Report As Spam' button, it compiles the spam message's header and body into a .txt attachment, adds that attachment to a new mail message, and sends it.
Unfortunately, the part of Outlook 2000 that causes Outlook to immediately and automatically send the message as soon as it hits the Outbox folder (when initiated from VBA) is broken (MS acknowledges this, and figures it's not worth fixing). Thus, I have to simulate clicking the Send/Receive button to get it to send.
The problem is this:
I often select all the spam messages received, and click the 'Report As Spam' button before Outlook has finished checking the other email addresses (on which we very rarely get spam). Thus, the code above does nothing. If Outlook is already Sending/Receiving when that code is initiated, the code has no effect.
I'd like to figure out a way to determine that Outlook is already Sending/Receiving, and if the above code is initiated, it'll wait for the current Send/Receive session to quit, and immediately initiate either a Send/Receive or just a Send, so the spam reports can go out immediately, rather than waiting for the automatic timed email checking.
I know I'll probably end up using olSyncState and possibly the Progress Event (although to use the Progress Event, it has to be put in a class module, which I don't want to do, so I'd rather stick with olSyncState).
Anybody know how to access olSyncState, and set up somehow for the above code to wait until olSyncState = 0, then run the code above, or some way to get the automatic Send (as soon as the email hits the Outbox) to work?
If necessary, we can use the Redemption DLL, as that is part of this VBA project.
Thanks for any help you can give.
Send/Receive Event
How do I execute code after the user has clicked on the Send/Receive button?
Outlook Send/Receive
Hi~
I have Outlook tied to an Internet Email account. Is there anyone who knows how to execute a Send/Receive in code so that it will check my Internet email account and download any emails? I want it to run Send/Receive every time I open Outlook.
Send And Receive Emails
Hi,
I need to be able to send emails from my program and then receive replies from the users.
Thanks
Send Message, Receive ACK
My brain is in a twist here.
I have a string messages to send to a device via a com port, and I expect a 16-character acknowledgement (ACK) string back from this connected device. If I don't receive the ACK for a certain timeout period, I should resend the message. There should be a number of retries (eg 3) where if I still receive no ACK then I regard the external device as faulty. How do I do this? I know the commands to set the port and send a string down there, but it's the part where I have to receive an ACK with a certain timeout period, which is what I don't understand to do. While I'm waiting for the ACK, the rest of my software should carry on doing it's business while I await the ACK.
Thanks.
Send/Receive Speed
Does anyone know the simplest way to get the Send/Receive speed when downloading or sending files. Nothing fancy needed, it's just for my own use to check mine. (Modem, Dsl, Sat. )
MSComm Send / Receive
Hi All.
Can someone get me started on how to send / receive a text file using the mscomm control Between 2 Pc ??
Send/Receive File
How can I send and receive a file with the WinSock control over a LAN using the TCP protocol. For example, I need to send a file from computer 192.168.0.1 (friendly name: 192.168.0.1) to the another computer on the network 192.168.0.25 (friendly name: cpm1). How can I design a simple client/server application to send it? ((( I'm a newbie with the winsock control ))).
thanks alot...
Send/Receive Mail
I am developing an application that uses an instance of outlook to connect to a remote mail service and I cannot find out how to initiate the send and receive function of outlook. Does anyone know how I can initiate this through VBA?
Send And Receive Data
I need to know how I can comunicate two applications running in two diferent computers.
Theese computers are now joined by a LAN and both applications must work at the same time and the data must be sended in real time.
If you know something about this, please write me. I'm very worried.
Thanks a lot.
How To Send And Receive Data Over USB Using Vb6
hi,
I used mscomm RS232 serial port. But it is not effective for my program. so now we decided to use USB. We are using 8051 microcontroller. I searched in google. I didn't find any code till now. please someone may guide me through example code for how to send data and how to receive data from USB.
Thanks in advance,
Vijaya.
Send And Receive Mms Message
i have pocketpc 2003 (i-mate)
and work with eVB ,
can anyone tell me the way to send and receive mms in my application eVB
or program with C# and i run it from my application
or the way to send from MMS composer of i-mate
thank you,
How To Send And Receive Fax Through VB Application
HI Friends, I am new to using vb city. I have created an application, and i have to provide a facility to send reports (in simple text format) to client through fax. Simple i have to send a fax using my application.
Thankx for your help
Send And Receive Sms To Gsm Modem
i am connecting a gsm modem to the serial port of computer and i want to use the visual basic to send at command using RS232 to read and send sms from the sim card in the modem so i need help in writing the code using visual basic
Send/Receive Files To/from The Net
can my app send/receive a file (e.g pictures) to/from the net through socket ? how ?
can i issue a response header to a browser ? how ?
many thanx
A Way To Monitor A Data Send/receive With Some Ip
Edit by HardCode: Split from here. Please start your own thread instead of posting to a five month old thread.
Quote:
Originally Posted by DeX
Have a look at this. It's the best method I've found. I use it for my Download Meter program which you can find in my sig:
http://www.vbip.com/iphelper/get_interface_info.asp
Alright? do you have the source code of your program available to share?
thanks
A Way To Monitor A Data Send/receive With Some Ip
Are there any possible way to monitor our network card sending or receiving data with a specify ip address. and it would be great if it compatible with old windows version and it's ok if not.
Thanks
Start Send/Receive In Outlook From VB
Hello,
I am using the send method of the mailitem property to send my mail to Outlook.
My problem is that the mail is shown in the Outbox and is sent only if I manually press Send/Receive from Outlook OR the time interval which I have set for Send/Receive in Outlook is actualized.
Can anyone please tell me whether it is possible to forcibly make a Send/Receive in Outlook after sending the mail to Outlook using mailitem.send
Thanks in advance
Send/Receive Text From Another Program.
First of all, hiya, I'm Rick. Just downloaded Visual Basic 2005 from the microsoft website after a long break from programming. Thought I'd give it a go.
I play a MuD called DragonRealms, it has it's own application/FrontEnd for access to the game. I think it is still based around Telnet but am not sure.
What I'd like to do is create a program that can recieve text from the game 'window' and send text back to the input box. I started to learn the basics of this years ago and never quite got there. Can anyone help point me in the right direction?
If you need more details about anything just ask and I'll provide them.
Looking forward to getting into some AI programming again. This site looks like it'll be really helpful.
Rick.
BAS Module To Receive And Send Coordinates
I have a VB application which takes MS Access datafiles and extracts out coordinate fields from the original file and attaches new fields to each former record point thus creating a new table of point features for inclusion in a Geographic Information System. I am presently handling conversions between decimal degrees of Lat-Long, Degrees-Minutes-Seconds of Lat-Long and UTM Easting and Northing coordinates.
I previously had written two separate VB programs which each handled user inputs of Decimal Degrees of Lat-Long with the program returning the resulting UTM Easting and Northing coordinates and the UTM Zone. The other program took Zone, UTM Easting and Northing and returned decimal degrees of Lat-Long.
The problem I am having here is I want to create a BASIC module for each of these two conversion routines. One I have called UTM2LL and the other LL2UTM. I want these to behave like functions where the BAS module is called from the main program having two or three needed parameters sent. It will then take those parameters and process the coordinate changes and I want it to return two or three (as the case may be) values in variable names to the main program. The main program will then publish them to the Output File, initialize everything back to 0 and loop to the top to get the next coordinate pair.
My question is: Can you show me what the general structure would be for such a BAS module, how it would be called from the Main program and how it would return the desired variables.
Example
I want to convert pvarDecD_X = 45.3456 and pvarDecD_Y = -81.4567 to their respective values in UTM Easting and UTM NOrthing coordinates (plus the UTM ZOne these coordinates come from). I want to call the BASIC module entitled LL2UTM.BAS to execute this conversion. What code would I use in the Main to call the function while passing it pvarDecD_x and pvarDecD_Y? Similarly, once the BAS module has received the call with parameters and executed its conversion code to store the results in different variables, how would it pass back to the Main program the results which would be pvarUTM_Zone, pvarUTM_X and pvarUTM_Y?
Serial Communication Send And Receive Then...
Hi.
I have a question about serial communications in VB6.
I want to send a command to a device, then receive a code back, and depending on what I receive, do one thing or another.
First I use this:
Private Sub Form_Load()
' Use COM4
MSComm4.CommPort = 4
' 9600 baud, no parity, 8 data bits, 1 stop bit
MSComm4.Settings = "9600,N,8,1"
' Disable DTR
MSComm4.DTREnable = False
' Open the port
MSComm4.PortOpen = True
End Sub
_____________________________________________
Then I use:
Private Sub cmdVolUP_Click()
' Send Out Data
MSComm4.Output = "Volume Up"
End Sub
_____________________________________________
I want it do be something like this:
Private Sub cmdVolUP_Click()
' Send Out Data
MSComm4.Output = "Volume Up"
If MSComm4.Input = "OK0DH" Then End Sub
If MSComm4.Input = "" after 1second Then
' Show Popup "No Answer Received"
If MSComm4.Input = "ERR0DH" Then
' Show popup "Error Received"
End Sub
Can someone please help me with this one?
It doesn't have to be a popup form with an OK button. Maybe just Text that shows up in a text box in the main form for about 2 seconds then disappears.
I will be very greatful for any help.
Thanks
/Dan from Sweden
Send/Receive Outlook Express
How can I do a Send/Receive in Outlook Express? I don't want to send any particular email or anything. I'd prefer to be able to do it in the back round without launching Outlook Express.
Any suggestions?
Send/Receive Multiple Files VB && ASP
I posted this here to get some more eyes.
Here's my problem. I want users to go to an ASP page with a bunch of links to files. The user will view the files as checkboxed items. Each file they want they will check off. Once they have all the files they need, click a button to popup a browse dialog of where to save these files on thier own (local) harddrive. Once they specify a path, download all the checked files to that folder, showing some kind of progress indicator for these.
Now I've got the ASP page all hacked out as to the files and how they will be checked off, what I need is the next step, the sending of multiple files to a remote drive and showing the progress of the download. Here's another wrench into the mix. Some of the files the user might want are located in ZIP files. If it's in a ZIP file, it must be extracted (server side) before being sent. Should I code something VB wise as an EXE or DLL, or do this all through ASP and script?
I need some advice on where I should start in this and maybe some good examples of how things like this may have been done before. This is relativly new territory for me but believe me, the help will be appreciated. Thanks in advance!
________________________________________________________
A new approach to this I though of recently, what do you think about this... When the user clicks on the button to download. It tabs up all the selected files, writes a text file containing all the file names, and passes that text file through command line to a client side app that takes in the file, gets all the files it needs to downlaod....then accesses the server and downloads all the files. Would this work? If so, how the heck would I do it? Thanks again!
Send/receive Mail With CDO Object
Hello!!
I would like send and receive mail with CDO object.
How can i do?
PS:
I have outlook on my PC, and i connect me to Exchange Server
Send And Receive Entire Array
how can i send an entire array through winsock and receive it on the other end, not knowing how big the array is on the other end??
is there a way like:
dim myArray(1 to 5) as String
winsock1.sendData myArray(1 to 5)
is that allowed?
**{STILL UNRESOLVED}** Send/Receive SMS In VB With Nokia 30
Hi All, I'm newbie in here
I got problem making application to send/recieve sms in vb with Nokia 30.
I have read all about sending sms in this forum. but I still confuse (I'm newbie ).
can anyone in this forum tell me howto develop the application???
please help me.... please help me....
thanks
Edited by - afritz3050 on 7/27/2004 12:12:35 PM
How Send And Receive Two Type Of Data
Hi all,
I want send two parameters to the client with the same events, and how i can separate between them at the receiver (client).
i got problem to do that. Alse i don't like to separate them in two send operations. like
Winsock1.SendData parameter1
DoEvents
Winsock1.SendData Parameter2
DoEvents
Also, i have done with this code, but i think it is wrong, because it takes time to d that. Plz i need help to solve this problem.
email me
Server's code:-
Winsock1.SendDate parameter1
Winsock1.SendData "*"
Winsock1.Senddata parameter2
DoEvents
Client's Code:-
Private Sub tcpClient_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
Dim i As Integer
Dim Index As Integer
Dim R_data as String
tcpClient.GetData strData, vbString
Index = 1
For i = 1 To Len(strData)
If (Mid(strData, i, 1)) <> "*" Then
R_data(Index) = R_data(Index) & (Mid(strData, i, 1))
Else
Index = Index + 1
End If
Next
End Sub
How To Send/Receive Mails Using CDO 1.21 From Workgroup PC
i am writing a simple VB6 application that will be able to send and receive emails. i am using MAPI and CDO 1.21(Microsoft Collaboration Data Object). in my office we are using MS Exchange Server 5.5 and Microsoft Outlook for messaging service. when i logon to my intranet domain and run my application using the underlying Profile(configured for MS Outlook to access/send messages) , it is working without any problem.
Now my question is how to logon to exchange server programmatically from a workgroup PC when i am logged of from the domain. for testing i tried the following things----
1. in a workgroup pc i configured outlook express for my existing exchange server mailbox and created a profile for my mailbox. now outlook express is able to retrieve all my messages from the exchange server mailbox.
2. now if my application tries to logon to exchange server with the same profile it always asks for authentication. it asks to enter Username,Domain and Mailbox Password. after i supply the above parameters it retrievs the messages from my inbox. now my Question is -- is there any way out to programmaticall supply those parameters and prevent that dialog box to appear. please help me to come out of this problem.
i am pasting some part of my code for better realization---
CODE
================================================
Option Explicit
Dim NewSession As Boolean
Dim strProfile As String
Dim objSession As MAPI.Session
Dim objFolder As MAPI.Folder
Dim objRecepients As MAPI.Recipients
Dim objRecepient As MAPI.Recipient
Dim objMessages As MAPI.Messages
Dim objMessage As MAPI.Message
=================================
'Logons using one of the profile
'returns
'(1)-Success
'(0)-Request Cancelled
'(-1)-Logon Failed(error)
Private Function LogOn() As Integer
On Error GoTo eh
strProfile = "server" & vbLf & "sumanta"
Set objSession = CreateObject("MAPI.Session")
'Logon using one of the profile
objSession.LogOn , , , False, , True, strProfile
NewSession = True
'successfully logged on
LogOn = 1
Exit Function
eh:
'logon failure
If Err.Number = CdoE_USER_CANCEL Then
'request cancelled
LogOn = 0
NewSession = False
Else
'Logon Failed
LogOn = -1
NewSession = False
End If
End Function
=======================
'logoff from the current CDO session
Private Sub LogOff()
If NewSession Then
objSession.LogOff
End If
Set objSession = Nothing
NewSession = False
End Sub
=======================
Private Sub Form_Load()
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
Dim Response As Integer
'Logon to Exchange Server
Response = LogOn
If Response = 0 Then
MsgBox "Logon request cancelled!", vbExclamation, "VM Messaging"
Exit Sub
ElseIf Response = -1 Then
MsgBox "Logon failed!", vbExclamation, "VM Messaging"
Exit Sub
End If
FetchAllMsg
End Sub
is there anybody who can help me providing a solid solution to this?
|