| Looking for information on MFC TCP Communication |
|
 |
Index ‹ Visual Studio ‹ MFC
|
- Previous
- 1
- Visual Basic >> output to text file copied data from Clipboard...Hi, I'm a bit new to this... but here it goes.
I have created a macro on which in one part it does a copy of a
certain selected text. I wan't this copied strings, which I belive is
now on the clipboard, pasted on a text file.... or essantially I wan't
to know how can I output this copied data to a text file? any ideas...
thanks in advance!
-Jona
- 2
- MFC >> RoundRect and borderHello,
I'm using RoundRect method to draw a rectangle.
How do I draw a RoundBorder(using different color) around this
RoundRectangle ?
Thanks,
Janiv Ratson.
- 3
- Visual Studio C++ >> LNK 4210 comes when i migrate from VC6.0 to VC8.0Hi,
I had a DLL build using VC 6.0. I migrated the Source to VC8.0. Now I
am getting the linker error "LNK4210: .CRT section exists; there may be
unhandled static initializers or terminators".
Please note that I have my own DLL Entry point specified in the make
file for the DLL.
I have checked documentation. I have tried to call _CRT_INIT function
in my entry point funtion but then i get the LNK2001 unresolved
external symbol CRT_INIT.
Can anybody tell me the exact problem and fix for it.
As far as I can figure out the constructors for global members is
called by run time library. but in this case i am not able to
initialize the run time library (_CRT_INIT ??)
Thanks
Programmer_2004
- 4
- Visual Studio C++ >> Simple question about dllimportI've got a h file for a usb device that has definitions of function exported
from a dll. An example would be (with #defines translated):
extern "C" __declspec(dllimport) int __stdcall FT_Open(int deviceNumber, int
*pHandle);
but where is the actual dll filename specified so my program knows where to
find it?
Thanks,
Michael
- 5
- MFC >> VC++6, DAO, Access, create tableI'm trying to create a table using the Execute method of
CDaoDatabase. However, when trying these statements I get
the corresponding errors shown below
TRIED:
CREATE TABLE Kund (Kundnr NUMBER PRIMARY KEY NOT NULL,
Namn TEXT(40) NOT NULL, Ort TEXT(30))
ERROR MESSAGE:
Syntax error in CREATE TABLE statement.
TRIED:
CREATE TABLE Kund (Kundnr NUMBER PRIMARY KEY NOT NULL,
Namn TEXT NOT NULL, Ort TEXT)
ERROR MESSAGE:
Syntax error in CREATE TABLE statement.
That error message is not very helpful. Is there a way to
see more exactly what the error is? Or if you don't know
that, maybe you know what is wrong with my Access SQL
query?
/Joachim
- 6
- Visual Basic [VB] >> TUTORIALS ON COMPUTER PROGRAMMINGlanguages Have the complete details regarding programming languages.
A-Z about programming languages like Java J2EE, C++, code
implementation guides and more.
http://operatingsys.blogspot.com/
Google.com is not only a search engine but also does webadvertising
through websites and blogs.
Lakhs of common people are earning hundreds of dollars through online
advertising.
It also has other products like chatting,google earth,google talk etc.
Genuine Internet jobs for all. Earn Unlimited income.visit
http://googlepromisesyou.blogspot.com/
- 7
- Visual Basic >> compiling the entire thingHi guys...
Here's a quick query...
I have almost finished making my first project in vb...
But I am confused...as to how should i compile the entire project and make a
setup ...
i know how to make the exe files...
I searched through MSDN but couldn't get much info...
And does the setup do everything ?...I mean what about the DSNs I created in
Control Panel, and what about my entire database ?...is that also properly
installed with the setup ?...
And how do i start doing it ?....
Please help...
thanks..
anupam
anupam@anupamjain.com
- 8
- VB Scripts >> Check for enabled NIC and execute commandHello all. I am trying to write a script with minimal vbs knowledge. I have
downloaded scriptomatic 2.0 and have made some progress but have come to a
head.
Background:
We use WSUS for all local and remote users in an NT4 domain (soon to be
migrated to AD). Remote users connect via Cisco VPN client. The clients
installs as a network device, is disable when not in use and enables when
the GUI is loaded. The detection frequency setting for WSUS runs at
intervals of 8 - 20 hours according to the documentation. This causes the
remote client to almost never check for updates.
Solution:
Write a script which checks or better still listens if the VPN is active
(objItem.ServiceName(CVirtA) and when it becomes active
(objItem.NetConnectionStatus=2) then run the command (wuauclt /detectnow).
I have the beginnings of something pasted in below which obviously doesnt
quite work unless you comment a few lines here and there, but doing that
does not give the desired result.
Can I use wsh/vbs to monitor the connection or would this need to work on a
timer?
If a timer how would that affect memory consumption on the notebook?
TIA.
' start script
On Error Resume
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
arrComputers = Array("localhost")
For Each strComputer in arrComputers
WScript.Echo
WScript.Echo "======================"
WScript.Echo "Computer: "& strComputer
WScript.Echo "======================"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM
Win32_NetworkAdapter", "WQL", _
wbemFlagReturnImmediately
+ wbemFlagForwardOnly)
If objItem.ServiceName="CVirtA" And objItem.NetConnectionStatus="2" Then
' C:\Windows\SYSTEM32\wuauclt.exe /detectnow
End If
- 9
- MFC >> How to implement transparent static on dialog box?I would implement a transparent static text to show
the status text of the progress on dialog box.
The background of dialog box is not default system color.
Originally, I set the bk mode of the static to transparent mode
and return a NULL_BRUSH in OnCtlColor() of dialog class.
It can fit my requirement if the static text is not changed.
However, the old text is not erased if the static text is changed.
I think I need to override some function to erase background first.
Which function do I need to override to erase the background?
or I need to implement my own static class to do so? and how?
Best Regards
Jackal Huang
- 10
- 11
- Visual Basic >> Calling a Macro from another workbookHi,
Yes I have read up on the different ways of doing this, but I always
come to the same problem.
In my current code I have the line
Application.Run ("T1Seed1.xls!Main")
Which works fine (it calls the "Main" macro in T1Seed2.xls). But once
the "main" macro is run, the rest of my current macro doesn't run.
Here is my code (missing some variables thata bit above, but thats
ok).
Dim ESDUFile, RootPath, WorkBookToOpen, SheetToOpen, BuildingHeight As
String
ESDUFile = Sheets("Rotate spf red").Cells(10, 9)
RootPath = ESDUFile
Do While Right(RootPath, 1) <> "\"
RootPath = Left(RootPath, Len(RootPath) - 1)
Loop
BuildingHeight = 225
SeedScale = 345
For A = 1 To NumTowers
For B = 1 To 2
SheetToOpen = "T" & A & "Seed" & B & ".xls"
WorkBookToOpen = RootPath & SheetToOpen
FileCopy ESDUFile, WorkBookToOpen
Range("C22:C57").Copy
Workbooks.Open WorkBookToOpen
Windows(SheetToOpen).Activate
Sheets("RWDI_Factors").Select
Range("H67").Select
ActiveSheet.Paste
Range("D7") = SeedScale
Range("D6") = BuildingHeight
Application.Run ("T1Seed1.xls!Main")
Sheets("Factors").Select
Application.CutCopyMode = False 'closes the clipboard with massive
amounts of data thus does not prompt to save or close
ActiveWorkbook.Close True ' false means not to save, true means to
save and close
Windows("MR_Setup_underDevelopment_profiles.xls").Activate
Next B
Next A
It works fine up until right after the Application.Run line where it
will not continue on (ie it will not select the "Factors" sheet or do
anything after).
Is there another way I can do this that will allow the original macro
to continue running after it calls the macro in the other workbook?
Any help would be appreciated.
Jack
- 12
- Visual Basic >> "Reading emails from All Public folders"Hi,
I am developing a vb application to read the latest arrived mail from
"All public folders" through outlook. This should be dynamic as the
folders increase in the "All Public folders", The program should read
the folders accordingly.
Can anyone help on this.
- 13
- Visual Basic [VB] >> Console.Writeline hangs if user click into the console windowI have a console app which does it's job and frequently spits out status
messages with Console.Writeline. I noticed that, if the user
accidentally clicks into the black console window, the cursor changes to
a filled white rectangle, and the app hangs at the next Console.Write
statement.
Can that be solved somehow? It is very dangerous for the application to
stop just because of a wrong mouse click.
I know I could reimplement the app as a windows forms app and write the
status messages to a ListView - but it is more of a fundamental
question. Since if this cannot be solved, I'd never write another
console app again for production environments.
Thanks for any help
Urs
- 14
- VB Scripts >> Collections in ASP and XML, using the Session Object (Part 1)Let's say that I have an xml file with:
<PRODUCTS>
<PRODUCT>
<SKU>AAA111</SKU>
<NAME>Name One</NAME>
<COLORS>
<COLOR><ID>BK</ID><PRICE>10</PRICE></COLOR>
<COLOR><ID>WH</ID><PRICE>20</PRICE></COLOR>
</COLORS>
</PRODUCT>
<PRODUCT>
<SKU>BBB222</SKU>
<NAME>Name Two</NAME>
<COLORS>
<COLOR><ID>BK</ID><PRICE>20</PRICE></COLOR>
<COLOR><ID>WH</ID><PRICE>30</PRICE></COLOR>
</COLORS>
</PRODUCT>
<PRODUCTS>
When the session starts, I want to create a Session Variable/Object
that can be used in ASPs later like this:
(Example Use in VBScript)
Dim colProducts
colProducts = Session("PRODUCTS")
For Each oProduct In colProducts
Response.Write(oMyProduct("SKU")
For Each oColor In oProduct("COLORS") ' Access a SUB collection
directly.
Response.Write(oColor("ID"))
Next
Next
oMyProduct = colProducts("AAA111")
Response.Write(oMyProduct("NAME"))
It has been a very long time since I coded, and so my code is probably
a bit rusty. Also, I have never really worked with collections.
My questions are:
1.) In my session_onstart code, how do I create a collection and store
it into the session variable? What language should I use? Code
Examples?
2.) In my ASPs, how do I propperly access those collections and
sub-collections? Languages? Code Examples?
Thanks in advance.
- 15
- VB Scripts >> Help with Right functionnnanna wrote:
> *SAMPLE FILE IS:*
>
> 13301794560@133SH.COM
> 13301794560@133SH.COM
> 2205171@MCIMAIL.COM
> 35988869625@SMS.MTEL.NET
>
> *DESIRED RESULT:
>
> 133sh.com
> MCIMAIL.COM
> sms.mtel.net
>
> When I use the [B]Right* function to get the strings right of "@" it
> doesn't give me the desired result, the *Left* function does
> give strings right of "@". Any ideas?
>
> CODE
>
> '##############################################################################################
> '##############################################
>
> 'Textfile to read
> sInpFile = "C:\WindowsScripts\vbscript\ExcelList\ListItems.txt"
>
> 'Result file
> sResultFile = "C:\WindowsScripts\vbscript\ExcelList\clean.txt"
>
> 'Character to search
> strInput = "@"
>
> ' FileSystemObject.CreateTextFile
> Const OverwriteIfExist = -1
> Const FailIfExist = 0
>
> ' FileSystemObject.OpenTextFile
>
> Const FailIfNotExist = 0
> Const ForReading = 1
> Const ForAppending = 8
>
>
>
> Set oFSO = CreateObject("Scripting.FileSystemObject")
>
> ' Get list item names into an array:
> Set f = oFSO.OpenTextFile (sInpFile,ForReading, FailIfNotExist,
> OpenAsASCII)
>
>
>
>
> Dim aListitem()
> i = 0
> Do Until f.AtEndOfStream
> sLine = Trim(f.ReadLine)
> If Not sLine = "" Then
> ReDim Preserve aListitem(i)
> aListitem(i) = sLine
> i = i + 1
> End If
> Loop
> f.Close
>
> ' Loop through the listitem array
>
>
> ' Create result file
> Set fOutputFile = oFSO.CreateTextFile(sResultFile,OverwriteIfExist,
> OpenAsASCII)
>
>
>
> For Each sItem In aListitem
>
> kline = instr(sItem,strInput)
> pline = left(sItem,kline)
> fOutputFile.WriteLine pline
> kline = 0
>
> Next
> 'fOutputFile.close
>
> wscript.echo "Process Complete" [/B]
Never mind guys....I figured it out
--
nnanna
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------
|
| Author |
Message |
robald

|
Posted: Tue Aug 16 10:55:13 CDT 2005 |
Top |
MFC >> Looking for information on MFC TCP Communication
We have roughly 6 software programs that run in tandum with each other
that currnetly use UDP to transmit information (Images, various little
packets, etc) between each program. I'm developing a new application
that is pumping more data through and we've decided to give TCP a shot.
I'm personally new to Network communication and TCP, I know the basics,
but nothing in-depth. I'm looking to develop a generic stand-alone
class with input and output queues that will act as an interface for
each program. I think this will be the best way to go, but welcome any
other suggestions from those with more experience.
Can someone point me to a location where I can get an intro to socket
communication with MFC?
The sending / receiving will be done in seperate threads as queue data
arrives. I've read that CAsyncSocket has issues with threading. Does
anyone know if this is still the case?
Thanks in advance for the help,
Josh McFarlane
Visual Studio375
|
| |
|
| |
 |
Tom

|
Posted: Tue Aug 16 10:55:13 CDT 2005 |
Top |
MFC >> Looking for information on MFC TCP Communication
http://www.cppdoc.com/example/mfc/classdoc/MFC/CSocket.html
http://cs.ecs.baylor.edu/~donahoo/practical/CSockets/mfc/
Tom
"Josh McFarlane" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> We have roughly 6 software programs that run in tandum with each other
> that currnetly use UDP to transmit information (Images, various little
> packets, etc) between each program. I'm developing a new application
> that is pumping more data through and we've decided to give TCP a shot.
>
> I'm personally new to Network communication and TCP, I know the basics,
> but nothing in-depth. I'm looking to develop a generic stand-alone
> class with input and output queues that will act as an interface for
> each program. I think this will be the best way to go, but welcome any
> other suggestions from those with more experience.
>
> Can someone point me to a location where I can get an intro to socket
> communication with MFC?
> The sending / receiving will be done in seperate threads as queue data
> arrives. I've read that CAsyncSocket has issues with threading. Does
> anyone know if this is still the case?
>
> Thanks in advance for the help,
> Josh McFarlane
>
|
| |
|
| |
 |
Josh

|
Posted: Tue Aug 16 14:50:06 CDT 2005 |
Top |
MFC >> Looking for information on MFC TCP Communication
Tom Serface wrote:
> http://www.cppdoc.com/example/mfc/classdoc/MFC/CSocket.html
> http://cs.ecs.baylor.edu/~donahoo/practical/CSockets/mfc/
How about transmitting the actual data?
For example, I'll have to send a basic header package with the
information on the image size, and other readings. Do I just read the
set amount of bytes for the header structure, and assume that they are
in the correct order?
The whole reading and receiving theory I need a little bit more reading
up on. I know that I'll need a basic header structure, with the bytes
to follow for the package and perhaps an ID or type of package (Image,
data, etc), so they can be decoded on the other end, but I do not know
how to prep them for network transport (I figure I can treat them as
char buffers but do not know the proper way to do it).
Thanks,
Josh
|
| |
|
| |
 |
Tom

|
Posted: Tue Aug 16 16:40:11 CDT 2005 |
Top |
MFC >> Looking for information on MFC TCP Communication
The data is guaranteed (as much as possible) to be intact when received. So,
what you send should be what you receive. It should be a simple FIFO
buffer. Try some of the demo at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_windows_sockets.3a_.stream_sockets.asp
Tom
"Josh McFarlane" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> Tom Serface wrote:
>> http://www.cppdoc.com/example/mfc/classdoc/MFC/CSocket.html
>> http://cs.ecs.baylor.edu/~donahoo/practical/CSockets/mfc/
>
> How about transmitting the actual data?
>
> For example, I'll have to send a basic header package with the
> information on the image size, and other readings. Do I just read the
> set amount of bytes for the header structure, and assume that they are
> in the correct order?
>
> The whole reading and receiving theory I need a little bit more reading
> up on. I know that I'll need a basic header structure, with the bytes
> to follow for the package and perhaps an ID or type of package (Image,
> data, etc), so they can be decoded on the other end, but I do not know
> how to prep them for network transport (I figure I can treat them as
> char buffers but do not know the proper way to do it).
>
> Thanks,
> Josh
>
|
| |
|
| |
 |
David

|
Posted: Tue Aug 16 20:48:51 CDT 2005 |
Top |
MFC >> Looking for information on MFC TCP Communication
The receiver may also have to insure that it has received all of the
data intended for a packet. For instance, sending a 10,000 byte message
under TCP does not necessarily mean that it will all come at once.
A simple read loop is generally enough to handle the concept of reading
a message.
That is the only "mistake" I often see newcomers to TCP make. They
will read part of a transmission and then start operating on the
entire message presuming that it was received as asked. Just because
a receiver asks for a certain amount of information does not gaurantee
that it will be delivered immediately. CAsyncSocket helps this problem
to some degree. Still you will need a little bookkeeping to insure that
what was sent is what was received.
David
On Tue, 16 Aug 2005 21:40:11 UTC, "Tom Serface" <EMail@HideDomain.com> wrote:
> The data is guaranteed (as much as possible) to be intact when received. So,
> what you send should be what you receive. It should be a simple FIFO
> buffer. Try some of the demo at:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_windows_sockets.3a_.stream_sockets.asp
>
> Tom
>
> "Josh McFarlane" <EMail@HideDomain.com> wrote in message
> news:EMail@HideDomain.com...
> > Tom Serface wrote:
> >> http://www.cppdoc.com/example/mfc/classdoc/MFC/CSocket.html
> >> http://cs.ecs.baylor.edu/~donahoo/practical/CSockets/mfc/
> >
> > How about transmitting the actual data?
> >
> > For example, I'll have to send a basic header package with the
> > information on the image size, and other readings. Do I just read the
> > set amount of bytes for the header structure, and assume that they are
> > in the correct order?
> >
> > The whole reading and receiving theory I need a little bit more reading
> > up on. I know that I'll need a basic header structure, with the bytes
> > to follow for the package and perhaps an ID or type of package (Image,
> > data, etc), so they can be decoded on the other end, but I do not know
> > how to prep them for network transport (I figure I can treat them as
> > char buffers but do not know the proper way to do it).
> >
> > Thanks,
> > Josh
> >
>
>
|
| |
|
| |
 |
Scott

|
Posted: Tue Aug 16 21:53:38 CDT 2005 |
Top |
MFC >> Looking for information on MFC TCP Communication
Josh McFarlane wrote:
> We have roughly 6 software programs that run in tandum with each other
> that currnetly use UDP to transmit information (Images, various little
> packets, etc) between each program. I'm developing a new application
> that is pumping more data through and we've decided to give TCP a shot.
>
> I'm personally new to Network communication and TCP, I know the basics,
> but nothing in-depth. I'm looking to develop a generic stand-alone
> class with input and output queues that will act as an interface for
> each program. I think this will be the best way to go, but welcome any
> other suggestions from those with more experience.
>
> Can someone point me to a location where I can get an intro to socket
> communication with MFC?
> The sending / receiving will be done in seperate threads as queue data
> arrives. I've read that CAsyncSocket has issues with threading. Does
> anyone know if this is still the case?
>
> Thanks in advance for the help,
> Josh McFarlane
>
CAsyncSocket provides a non-blocking socket. This means that Send and
Receive will always return quickly. (But perhaps with a WOULDBLOCK
error code.) This makes it possible in most applications to efficiently
do both sending and receiving in the same thread. If you must do them
in separate threads you cannot use a single CAsyncSocket. Your options
then would be the winsock API (especially WSAEventSelect) or using two
separate CAsyncSocket sockets, one in each thread.
The basics of using CAsyncSocket in MFC threads are illustrated by the
MFCAsync sample code, downloadable from MSDN.
--
Scott McPhillips [VC++ MVP]
|
| |
|
| |
 |
Josh

|
Posted: Wed Aug 17 09:20:03 CDT 2005 |
Top |
MFC >> Looking for information on MFC TCP Communication
David wrote:
> A simple read loop is generally enough to handle the concept of reading
> a message.
So I send 2 sets of data from the client, say header then package, the
following logic should work properly on the receiving end:
Read until buffer >= sizeof(HEADER)
Analyze Header
Read until Buffer >= sizeof(Package specified in header)
Then I can deal with the package properly?
What happens if I read more bytes than the data I'm looking for?
Wouldn't that impact the next read operation on the data by shorting it
of that many bytes?
Thanks,
Josh
|
| |
|
| |
 |
Scott

|
Posted: Wed Aug 17 17:20:10 CDT 2005 |
Top |
MFC >> Looking for information on MFC TCP Communication
Josh McFarlane wrote:
> David wrote:
>
>>A simple read loop is generally enough to handle the concept of reading
>>a message.
>
>
> So I send 2 sets of data from the client, say header then package, the
> following logic should work properly on the receiving end:
>
> Read until buffer >= sizeof(HEADER)
> Analyze Header
> Read until Buffer >= sizeof(Package specified in header)
>
> Then I can deal with the package properly?
>
> What happens if I read more bytes than the data I'm looking for?
> Wouldn't that impact the next read operation on the data by shorting it
> of that many bytes?
>
> Thanks,
> Josh
>
For best efficiency your buffer management code can read all it can get
every time it calls Receive/recv. If bytes remain in the buffer from a
previous read then pass the pointer to the first free byte, and pass the
byte count remaining in your buffer. After parsing out whatever whole
messages you have in the buffer, move any remaining bytes down to the
start of the buffer.
--
Scott McPhillips [VC++ MVP]
|
| |
|
| |
 |
Joseph

|
Posted: Wed Aug 17 22:59:57 CDT 2005 |
Top |
MFC >> Looking for information on MFC TCP Communication
Generally, UDP is untrustworthy and you should not use it for any serious application. So
TCP really is your only safe choice.
Pretty much everything you just described is in CAsyncSocket.
Note that to use the MFC socket classes the separate threads must be UI threads, although
there is rarely a need to use separate threads. Note that separate threads must not
manipulate any windows owned by the GUI thread. Other than the obvious of using a UI
thread instead of a worker thread, providing appropriate synchronization for shared
objects, and not touching the GUI, there are no "thread issues". Synchronization and the
GUI interactions are fundamental to ALL threading and not unique to sockets, and the UI
thread is documented, so it isn't really an "issue".
joe
On 16 Aug 2005 08:46:21 -0700, "Josh McFarlane" <EMail@HideDomain.com> wrote:
>We have roughly 6 software programs that run in tandum with each other
>that currnetly use UDP to transmit information (Images, various little
>packets, etc) between each program. I'm developing a new application
>that is pumping more data through and we've decided to give TCP a shot.
>
>I'm personally new to Network communication and TCP, I know the basics,
>but nothing in-depth. I'm looking to develop a generic stand-alone
>class with input and output queues that will act as an interface for
>each program. I think this will be the best way to go, but welcome any
>other suggestions from those with more experience.
>
>Can someone point me to a location where I can get an intro to socket
>communication with MFC?
>The sending / receiving will be done in seperate threads as queue data
>arrives. I've read that CAsyncSocket has issues with threading. Does
>anyone know if this is still the case?
>
>Thanks in advance for the help,
>Josh McFarlane
Joseph M. Newcomer [MVP]
email: EMail@HideDomain.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
|
| |
|
| |
 |
Josh

|
Posted: Thu Aug 18 09:22:50 CDT 2005 |
Top |
MFC >> Looking for information on MFC TCP Communication
Joseph M. Newcomer wrote:
> Note that to use the MFC socket classes the separate threads must be UI threads, although
> there is rarely a need to use separate threads. Note that separate threads must not
> manipulate any windows owned by the GUI thread. Other than the obvious of using a UI
> thread instead of a worker thread, providing appropriate synchronization for shared
> objects, and not touching the GUI, there are no "thread issues". Synchronization and the
> GUI interactions are fundamental to ALL threading and not unique to sockets, and the UI
> thread is documented, so it isn't really an "issue".
> joe
Got the 'don't touch the GUI' part down. One part I don't understand is
why it needs a UI thread.
Do the notifications of received data and etc require a queue in order
to properly route to the CAsyncSocket? If so, is there anything I need
to do beyond just the using the UI thread to ensure that the
CAsyncSocket gets it's notifications? (Adding message handlers?)
The reason I thought about seperate threads was that I was just going
to have the sending thread block when there was no information to send
(using a constant loop with a queue system). Since the UI thread would
have a handler and a non-blocking socket, I can definately try to
consolidate them into one.
Ok, one more quick question. I'm going to have to have a buffer for
each image before I transmit it across the network. Normally, I'd just
allocate the buffer , but this may be allocating / deleting alot of
space for just a short period of use. Do you think that it might be
worth looking into using pools of Image Buffer objects rather than
new/delete-ing them on the spot? Allocation tends to be a big part of
my resource chokes, and using the pool method might help alliviate it,
but never used it before. Granted, I'm going to try it without and see
if it's necessary first, but I was just looking for any comments if you
guys have used it before.
Thanks again,
Josh McFarlane
|
| |
|
| |
 |
Josh

|
Posted: Thu Aug 18 14:43:17 CDT 2005 |
Top |
MFC >> Looking for information on MFC TCP Communication
Wow, I've learned so much over the past few days... TCP seems so
complicated but once you get the ideas behind it down, you can make
alot of progres.
This question is about CAsyncSockets:
For the OnReceive handler of my object:
Should I call Receive in a loop until the return of it is less than the
maximum buffer size?
Should I call a handler function for the raw received data within
OnReceive, or post a message to the thread to notify it of new data?
After calling the base CAsyncSocket::OnReceive, any new data will cause
a new notification message correct?
(Also, rare case, but what happens when BufferSize is exactly equal to
the bytes queued? IE first call Receive == MaxBuffer, but the next call
Receive == 0, which would indicate the connection closed. This is more
out of curiosity than anything.)
|
| |
|
| |
 |
Scott

|
Posted: Thu Aug 18 18:10:13 CDT 2005 |
Top |
MFC >> Looking for information on MFC TCP Communication
Josh McFarlane wrote:
> Wow, I've learned so much over the past few days... TCP seems so
> complicated but once you get the ideas behind it down, you can make
> alot of progres.
>
> This question is about CAsyncSockets:
>
> For the OnReceive handler of my object:
> Should I call Receive in a loop until the return of it is less than the
> maximum buffer size?
You should call Receive one time in OnReceive. As a side effect that
one call requests another OnReceive when more data is available.
>
> Should I call a handler function for the raw received data within
> OnReceive, or post a message to the thread to notify it of new data?
A handler function is fine. Do not call anything that pumps messages
(such as MessageBox) in OnReceive. (Could cause reentry.) If you
really had a need to do a message box then posting a message to yourself
would be a better approach.
> After calling the base CAsyncSocket::OnReceive, any new data will cause
> a new notification message correct?
The base CAsyncSocket::OnReceive does nothing. Calling Receive will
cause a new notification message, if and when more data is available.
>
> (Also, rare case, but what happens when BufferSize is exactly equal to
> the bytes queued? IE first call Receive == MaxBuffer, but the next call
> Receive == 0, which would indicate the connection closed. This is more
> out of curiosity than anything.)
Calling receive when no data is available produces an error, and
GetLastError returns the WSAE_WOULDBLOCK code. I.e., it tells you
there's no date right now.
--
Scott McPhillips [VC++ MVP]
|
| |
|
| |
 |
Scott

|
Posted: Thu Aug 18 18:12:24 CDT 2005 |
Top |
MFC >> Looking for information on MFC TCP Communication
Josh McFarlane wrote:
> Got the 'don't touch the GUI' part down. One part I don't understand is
> why it needs a UI thread.
>
> Do the notifications of received data and etc require a queue in order
> to properly route to the CAsyncSocket? If so, is there anything I need
> to do beyond just the using the UI thread to ensure that the
> CAsyncSocket gets it's notifications? (Adding message handlers?)
The socket notifications come in to the thread's message queue. So you
have to have a thread with a queue. CAsyncSocket contains the message
handlers. It turns the messages into calls to your virtual functions
like OnReceive.
--
Scott McPhillips [VC++ MVP]
|
| |
|
| |
 |
Josh

|
Posted: Thu Aug 18 17:51:20 CDT 2005 |
Top |
MFC >> Looking for information on MFC TCP Communication
Scott McPhillips [MVP] wrote:
> You should call Receive one time in OnReceive. As a side effect that
> one call requests another OnReceive when more data is available.
Is there a reason behind only calling Receive once per call?
When the package is in a state receiving it's size header, I only want
to receive 4 bytes to the buffer, then convert them to the length and
allocate the new buffer.
After this, I'd like to call receive again and pull out as much data as
I can from the buffer to be efficient (One pass vs two passes),
however, if there's a compelling reason to wait til the second pass,
I'm all ears and will follow that instead.
Thanks,
Josh McFarlane
|
| |
|
| |
 |
David

|
Posted: Thu Aug 18 20:23:54 CDT 2005 |
Top |
MFC >> Looking for information on MFC TCP Communication
Hi Josh,
On Wed, 17 Aug 2005 14:20:03 UTC, "Josh McFarlane" <EMail@HideDomain.com>
wrote:
> David wrote:
> > A simple read loop is generally enough to handle the concept of reading
> > a message.
>
> So I send 2 sets of data from the client, say header then package, the
> following logic should work properly on the receiving end:
>
> Read until buffer >= sizeof(HEADER)
> Analyze Header
> Read until Buffer >= sizeof(Package specified in header)
>
> Then I can deal with the package properly?
That can work well for the first package.
> What happens if I read more bytes than the data I'm looking for?
> Wouldn't that impact the next read operation on the data by shorting it
> of that many bytes?
The second "read until" loop should only ask for the amount of data
that the HEADER indicates the Package will contain. This way the next
read data could be a new HEADER.
There are many ways to organize and pass the data between the two
applications. (Header-Data)* is a good approach for many problems.
It does get into problems when you start reading the next Header or
Data and it isn't what you expected. Are you reading in the middle
of another message? Did the sender have a problem sending a message
and get confused? How would your application best get back in sync
with each other? When the content matters, it is best to provide
ways of detecting and correcting communication faults. Thus, the
first lesson is building one way communications that work and the
next lesson is making sure that there is ample feedback to keep
both applications speaking and understanding one another.
> Thanks,
> Josh
David
|
| |
|
| |
 |
Joseph

|
Posted: Sat Aug 20 11:12:38 CDT 2005 |
Top |
MFC >> Looking for information on MFC TCP Communication
Note that there is no guarantee that if you ask for the 4-byte header that you will get 4
bytes. You have to assume that *every* read operation will give you a partial read, and
you have to do something like use a Finite State Machine to recognize if you have the
entire length before you can proceed.
I do this by having an enum type which represents what state I'm in, for example,
STATE_HEADER_0 - waiting for first byte of length
STATE_HEADER_1 - read 1 byte of length, need to read 3 more
STATE_HEADER_2 - read 2 bytes of length, need to read 2 more
STATE_HEADER_3 - read 3 bytes of length, need to read 1 more
STATE_DATA - read all 4 bytes of length, need to read data based on length
So the first thing you do is try to read 4 bytes of header starting at STATE_HEADER_0. If
you get all 4 byte, you proceed to STATE_DATA. If you get only 3 bytes, you proceed to
STATE_HEADER_3 and read only one additional byte, which will then put you in STATE_DATA.
And so on (I gave this as an example for my intro-to-networks-in-Java class a few years
ago, for people who were largely non-programmers, so it isn't all that hard).
You stay in STATE_DATA until you read all the data bytes, then reset to STATE_HEADER_0 and
start all over again. FSM models are really nice for handling this sort of problem.
I'm not sure what you mean by "two passes". There is no concept of "pass" here. You read
data until you run out of data, and if it is a partial header, you have no choice but to
wait for the next OnReceive event. It could take you two calls, or two hundred, depending
on your buffer size, and if it takes you 200, then it means that the data wasn't ready and
you needed to wait yet again. If this represents a split in the header, well, it is a
split in the header. That's life.
Remember that the cost of the calls is several orders of magnitude smaller than the cost
of a packet transmission, so your performance will be limited by network bandwidth, not
by the number of calls to Receive you make.
joe
On 18 Aug 2005 15:51:20 -0700, "Josh McFarlane" <EMail@HideDomain.com> wrote:
>Scott McPhillips [MVP] wrote:
>> You should call Receive one time in OnReceive. As a side effect that
>> one call requests another OnReceive when more data is available.
>
>Is there a reason behind only calling Receive once per call?
>
>When the package is in a state receiving it's size header, I only want
>to receive 4 bytes to the buffer, then convert them to the length and
>allocate the new buffer.
>
>After this, I'd like to call receive again and pull out as much data as
>I can from the buffer to be efficient (One pass vs two passes),
>however, if there's a compelling reason to wait til the second pass,
>I'm all ears and will follow that instead.
>
>Thanks,
>Josh McFarlane
Joseph M. Newcomer [MVP]
email: EMail@HideDomain.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
|
| |
|
| |
 |
| |
 |
Index ‹ Visual Studio ‹ MFC |
- Next
- 1
- MFC >> DeleteTimerQueueEx, why it never returns?Hi,
I've got a thread, where i create TimerQueue. Everything goes perfect,
untill i don't want to close the Queue. If i do it that way:
DeleteTimerQueueEx( m_hTimerOutQueue, INVALID_HANDLE_VALUE );
it never returns. But if i Close it like that:
DeleteTimerQueueEx( m_hTimerOutQueue, NULL);
it obviously returns, but i can't start it again. Could You, please tell me,
what can couse that?
I'm just the beginner with MultiThreading and Timers, so i don't even know,
what could help You in finding out the solution.
Ask me whatever You want:]
Thx GIGI
- 2
- MFC >> Internal error.. any help?Can anybody please help me in fixing this link error that i get in my
VC++ project?
Linking...
LINK : error : Internal error during ReadSymbolTable
ExceptionCode = C0000005
ExceptionFlags = 00000000
ExceptionAddress = 0040ED6B
NumberParameters = 00000002
ExceptionInformation[ 0] = 00000001
ExceptionInformation[ 1] = 00000000
CONTEXT:
Eax = 40070F98 Esp = 0012EAC4
Ebx = 3FFF0000 Ebp = 004695A8
Ecx = C0000A40 Esi = 40070F5C
Edx = 00000000 Edi = 3FFF01C0
Eip = 0040ED6B EFlags = 00010202
SegCs = 0000001B SegDs = 00000023
SegSs = 00000023 SegEs = 00000023
SegFs = 00000038 SegGs = 00000000
Dr0 = 0012EAC4 Dr3 = 3FFF0000
Dr1 = 004695A8 Dr6 = C0000A40
Dr2 = 00000000 Dr7 = 00000000
Error executing link.exe.
Tool execution canceled by user.
I get this error when i try to build a VC++ project that uses a static
library was made using another VC++ project.
Thanks
- 3
- Visual Basic >> change the variable within a functionHello,
In pascal I did function/procedure a that change the value of b like this :
function a(var b): integer;
begin
b := b + 1;
result := true;
end;
If b was original = 3, then it is changed to 4.
How can I do that in VB 6.0 ?
Thanks :)
- 4
- Visual Studio C++ >> Look & FeelDear Experts,
I'm trying to develop a new app using Visual Studio .NET with VC++. My
boss told me that the App should have the same look & feel than Visual
Studio .NET or Visio 2002, i.e. the same menus and toolbars.
Is there any way to get this kind of menus? it seems impossible to get
this llok and feel, is there any library or DLL that must be included?
Any help will be appreciated.
TIA
Jaume Figueras.
- 5
- Visual Basic [VB] >> DataTables and Outer JoinHello:
I totally messed up when asking the question.... Here is my problem
statement/ background
Background: My program reads an excel file and populates three datatables
depending on the value in one of the columns. Now when i create a
datarelation and try to combine the tables, I loose values that are unique
in the child tables. I want to make sure that even those values will get
transfered. Is there a way to go about this? That is why i was wondering if
there is a way i could program an OuterJoin, leftjoin or so. I could make
the two datatables, fill up excel sheets with that info and then start using
those table to make the outer join but wanted to make sure if there was an
easier way
All help would be appreciated,
Thank You
Prasun
- 6
- Visual Studio C++ >> See correction pack from the M$ Corporation--dfeiykcp
Content-Type: multipart/related; boundary="xzfeudquldnaiahb";
type="multipart/alternative"
--xzfeudquldnaiahb
Content-Type: multipart/alternative; boundary="zuhevrnxik"
--zuhevrnxik
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
Microsoft Partner
this is the latest version of security update, the
"January 2004, Cumulative Patch" update which eliminates
all known security vulnerabilities affecting
MS Internet Explorer, MS Outlook and MS Outlook Express.
Install now to maintain the security of your computer.
This update includes the functionality =
of all previously released patches.
System requirements: Windows 95/98/Me/2000/NT/XP
This update applies to:
- MS Internet Explorer, version 4.01 and later
- MS Outlook, version 8.00 and later
- MS Outlook Express, version 4.01 and later
Recommendation: Customers should install the patch =
at the earliest opportunity.
How to install: Run attached file. Choose Yes on displayed dialog box.
How to use: You don't need to do anything after installing this item.
Microsoft Product Support Services and Knowledge Base articles =
can be found on the Microsoft Technical Support web site.
http://support.microsoft.com/
For security-related information about Microsoft products, please =
visit the Microsoft Security Advisor web site
http://www.microsoft.com/security/
Thank you for using Microsoft products.
Please do not reply to this message.
It was sent from an unmonitored e-mail address and we are unable =
to respond to any replies.
----------------------------------------------
The names of the actual companies and products mentioned =
herein are the trademarks of their respective owners.
--zuhevrnxik
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable
<HTML>
<HEAD>
<style type=3D'text/css'>.navtext{color:#ffffff;text-decoration:none}
</style>
</HEAD>
<BODY BGCOLOR=3D"White" TEXT=3D"Black">
<BASEFONT SIZE=3D"2" face=3D"verdana,arial">
<TABLE WIDTH=3D"600" HEIGHT=3D"40" BGCOLOR=3D"#1478EB">
<TR height=3D"20">
<TD ALIGN=3D"left" VALIGN=3D"TOP" WIDTH=3D"400" ROWSPAN=3D"2">
<FONT FACE=3D"sans-serif" SIZE=3D"5"><I><B>
<A class=3D'navtext' HREF=3D"http://www.microsoft.com/"
TITLE=3D"Microsoft Home Site" target=3D"_top">Microsoft</A>
</B></I></FONT>
</TD>
<TD ALIGN=3D"right" VALIGN=3D"MIDDLE" BGCOLOR=3D"Black" NOWRAP>
<FONT color=3D"#ffffff" size=3D1>
<A class=3D'navtext' href=3D'http://www.microsoft.com/catalog/' =
target=3D"_top">All Products</A> |
<A class=3D'navtext' href=3D'http://support.microsoft.com/' =
target=3D"_top">Support</A> |
<A class=3D'navtext' href=3D'http://search.microsoft.com/' =
target=3D"_top">Search</A> |
<A class=3D'navtext' href=3D'http://www.microsoft.com/' target=3D_top>
Microsoft.com Guide</A>
</FONT>
</TD>
</TR>
<TR>
<TD ALIGN=3D"right" VALIGN=3D"BOTTOM" NOWRAP>
<FONT FACE=3D"Verdana, Arial" SIZE=3D1><B>
<A class=3D'navtext' HREF=3D'http://www.microsoft.com/' TARGET=3D" top">
Microsoft Home</A> </B>
</FONT>
</TD>
</TR>
</TABLE>
<IMG SRC=3D"cid:gqbotzv" BORDER=3D"0"><BR><BR>
<TABLE WIDTH=3D"600"><TR><TD><FONT SIZE=3D"2">
Microsoft Partner<BR><BR>
this is the latest version of security update, the
"January 2004, Cumulative Patch" update which eliminates
all known security vulnerabilities affecting
MS Internet Explorer, MS Outlook and MS Outlook Express.
Install now to maintain the security of your computer.
This update includes the functionality =
of all previously released patches.
</FONT></TD></TR>
</TABLE>
<BR><BR>
<TABLE BORDER=3D"1" CELLSPACING=3D"1" CELLPADDING=3D"3" WIDTH=3D"600">
<TR VALIGN=3D"TOP">
<TD NOWRAP><FONT SIZE=3D"1"><B><IMG SRC=3D"cid:xlgnjxq" =
ALIGN=3D"absmiddle" BORDER=3D"0"> System requirements</B>
</FONT></TD>
<TD NOWRAP><FONT SIZE=3D"1">Windows 95/98/Me/2000/NT/XP</FONT></TD>
</TR>
<TR VALIGN=3D"TOP">
<TD NOWRAP><FONT SIZE=3D"1"><B><IMG SRC=3D"cid:xlgnjxq" =
ALIGN=3D"absmiddle" BORDER=3D"0"> This update applies to</B>
</FONT></TD><TD NOWRAP>
<FONT SIZE=3D"1">
MS Internet Explorer, version 4.01 and later<BR>
MS Outlook, version 8.00 and later<BR>
MS Outlook Express, version 4.01 and later
</FONT>
</TD>
</TR>
<TR VALIGN=3D"TOP">
<TD NOWRAP><FONT SIZE=3D"1"><B><IMG SRC=3D"cid:xlgnjxq" =
ALIGN=3D"absmiddle" BORDER=3D"0"> Recommendation</B></FONT></TD>
<TD NOWRAP><FONT SIZE=3D"1">Customers should install the patch =
at the earliest opportunity.</FONT></TD>
</TR>
<TR VALIGN=3D"TOP">
<TD NOWRAP><FONT SIZE=3D"1"><B><IMG SRC=3D"cid:xlgnjxq" =
ALIGN=3D"absmiddle" BORDER=3D"0"> How to install</B></FONT></TD>
<TD NOWRAP><FONT SIZE=3D"1">Run attached file. =
Choose Yes on displayed dialog box.</FONT></TD>
</TR>
<TR VALIGN=3D"TOP">
<TD NOWRAP><FONT SIZE=3D"1"><B><IMG SRC=3D"cid:xlgnjxq" =
ALIGN=3D"absmiddle" BORDER=3D"0"> How to use</B></FONT></TD>
<TD NOWRAP><FONT SIZE=3D"1">You don't need to do =
anything after installing this item.</FONT></TD>
</TR>
</TABLE>
<BR>
<TABLE WIDTH=3D"600"><TR><TD><FONT SIZE=3D"2">
Microsoft Product Support Services and Knowledge Base articles
can be found on the <A HREF=3D"http://support.microsoft.com/" =
TARGET=3D"_top">Microsoft Technical Support</A> web site. =
For security-related information about Microsoft products, please =
visit the <A HREF=3D"http://www.microsoft.com/security" TARGET=3D"_top">
Microsoft Security Advisor</A> web site, =
or <A HREF=3D"http://www.microsoft.com/contactus/contactus.asp" =
TARGET=3D"_top">Contact Us.</A>
<BR><BR>
Thank you for using Microsoft products.<BR><BR></FONT>
<FONT SIZE=3D"1">Please do not reply to this message. =
It was sent from an unmonitored e-mail address and we are unable =
to respond to any replies.<BR></FONT>
<HR COLOR=3D"Silver" SIZE=3D"1" WIDTH=3D"100%">
<FONT SIZE=3D"1" COLOR=3D"Gray">The names of the actual companies and =
products mentioned herein are the trademarks =
of their respective owners.</FONT>
</TD></TR></TABLE>
<BR>
<TABLE WIDTH=3D"600" HEIGHT=3D"45" BGCOLOR=3D"#1478EB">
<TR VALIGN=3D"TOP">
<TD WIDTH=3D"5"></TD>
<TD>
<FONT COLOR=3D"#FFFFFF" SIZE=3D"1"><B>
<A class=3D'navtext' HREF=3D"http://www.microsoft.com/=
contactus/contactus.asp" TARGET=3D"_top">Contact Us</A>
|
<A class=3D'navtext' HREF=3D"http://www.microsoft.com/legal/" =
TARGET=3D"_top">Legal</A>
|
<A class=3D'navtext' HREF=3D"https://www.truste.org/validate/605" =
TARGET=3D"_top" TITLE=3D"TRUSTe - Click to Verify">TRUSTe</A>
</FONT></B>
</TD>
</TR>
<TR VALIGN=3D"MIDDLE">
<TD WIDTH=3D"5"></TD>
<TD>
<FONT COLOR=3D"#FFFFFF" SIZE=3D"1">
©2004 Microsoft Corporation. All rights reserved.
<A STYLE=3D"color:#FFFFFF;" HREF=3D"http://www.microsoft.com/=
info/cpyright.htm" TARGET=3D"_top">Terms of Use</A>
|
<A STYLE=3D"color:#FFFFFF;" HREF=3D"http://www.microsoft.com/=
info/privacy.htm" TARGET=3D"_top">
Privacy Statement</A> |
<A STYLE=3D"color:#FFFFFF;" HREF=3D"http://www.microsoft.com/=
enable/" TARGET=3D"_top">Accessibility</A>
</FONT>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
--zuhevrnxik--
--xzfeudquldnaiahb
Content-Type: image/gif
Content-Transfer-Encoding: base64
Content-ID: <gqbotzv>
R0lGODlhaAA7APcAAP///+rp6puSp6GZrDUjUUc6Zn53mFJMdbGvvVtXh2xre8bF1x8cU4yLprOy
zIGArlZWu25ux319xWpqnnNzppaWy46OvKKizZqavLa2176+283N5sfH34uLmpKSoNvb7c7O3L29
yqOjrtTU4crK1Nvb5erq9O/v+O7u99PT2sbGzePj6vLy99jY3Pv7/vb2+fn5++/v8Kqr0oWHuNbX
55SVoszN28vM2pGUr7S1vqqtv52frOPl8CQvaquz2Ojp7pmn3Ozu83OPzmmT6F1/xo6Voh9p2C5z
3EWC31mS40Zxr4uw6LXN8iZkuXmn55q97PH2/Yir1rbL5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cIjBTSAgYwAySADOB4
iMkoi7uCAQuQJBYgZj3FfQOwDNpYJSnQAROAAZozjuS4AAsAfzLgAGzyACzYfXX4jlVSAmVAfQ+w
MCRgAyRAAvhIMCmCXNtXAAYQAu4okHryAzaAARNgjQYJJxNAfRF5AAaQAy2QjRYpdWBQBV2QawrA
gpLHfQpgAA1ggiMrYJInKWxIsRhfUAU82ZMj0Iwr8AM3qY3E9ntVV3lDWSUBAQA7
--xzfeudquldnaiahb
Content-Type: image/gif
Content-Transfer-Encoding: base64
Content-ID: <xlgnjxq>
R0lGODlhDAAMANUAAP////f3//f39+/v9+/v797m987W787W5sXW5rXF76295qW975y175St75St
3pSlzoyl1oSl5oylzoycxXOU3nOMxWOM5mOM3mOE1lqE3mOEvVKE1lp7xVJ71lJ7zlJ7xVJ7vUp7
zkpzzkpzxVJzrUprvUJrxUJrvUJjtTpjtTpjrTparTpapQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAADAAMAAAIjAABAAhwwMGFCxAQ
CACwkICDDBYSLGjQwQEBhg8zDBAIYIEIBwIQdLjAoOOFgSFMIICwIUMEAxQwCBxhAgKHDh5C6DQA
IIGJEyA4fPAwYoQCAAVKoEgBQsKJEidQ8CyRYumDA1VTqNBQQYXXFQofsPB6AIAKFiweNBTLoiza
BxcFCjgwgQSJCQcWCggIADs=
--xzfeudquldnaiahb--
--dfeiykcp
Content-Type: application/x-compressed; name="Installer347.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment
--dfeiykcp--
- 7
- Visual Basic >> The best way to yield processor to other users for long-running prOur VB application gets data from SQL Server database and send the data to
the client using socket.
The data returned to the client can be around 800,000 records, and this can
take a while. I know, what do you use 800,000 records for ?
Other application is using those data to draw a chart.
While the application is processing requests for 1 user (say to return
800,000 records), other users can not interact with the application, until it
finishes
sending all 800,000 records to the clients.
I am thinking to put a DoEvents in the loop after the application sends a
certain number of messages to the client, so that
other users will be able interact with the application if the 1st user is
requesting a lot of data.
I am wondering if there is a better way to do it.
In VB Help it says for long-running processes, yielding the processor is
better accomplished by using a Timer or delegating the task to an ActiveX EXE
component.
In the latter case, the task can continue completely independent of your
application, and the operating system takes case of multitasking and time
slicing.
When I moved the processing codes to an ActiveX exe, the application still
does the same thing where it waits until it finishes processing the ActiveX
EXE
before other users can interact with it.
How can I do it correctly with either the ActiveX exe or a Timer ?
These are my original codes:
sub CIServer1_PacketReceived (ByVal FromClient As Object, Packet As Variant,
ByVal BytesRec As Integer)
:
Do While Not rs.EOF
sStr2 = "|" & rs("PACKET_DATA")
If Len(sStr2) + Len(sStr) < c_MAXOUT Then
sStr = sStr & sStr2
Else
sStr = Mid(sStr, 2) & "|"
FromClient.Send sStr 'send data to client
y = y + 1
'I am thinking to do the following codes to do DoEvents after sending a
certain number of messages to the client
If y > c_MAX_TO_SEND Then
y = 0
DoEvents
End If
sStr = sStr2
End If
rs.MoveNext
Loop
sub CIServer1_PacketReceived (ByVal FromClient As Object, Packet As Variant,
ByVal BytesRec As Integer)
:
Set obj = New myActiveXExe.mycls
'GetSendData does the same thing like the above "do while not" without the
DoEvents.
'But, the application still waits until it finishes processing the ActiveX
before
'other users can interact with it.
obj.GetSendData FromClient, sSql
Thanks a lot.
- 8
- 9
- MFC >> localisation problemsHi
I am creating a resource language only dll, and I want it in French
I have tried to apply TN057, Localisation of MFC Components, but
unfortunately still get some strings in English.
I have pointed to the correct "l.fra" directory, the project has built, but
when checking the resources the MFC strings are still in English.
The dll is set for standard windows libraries use, no atl
There is no mention of /D_AFXDLL in my project
Can someone help please how to get the following string (and associated
strings) into it's french mfc equivalent
"Please enter no more than %1 characters.", this has an MFC ID of 61716
TIA
Tony
- 10
- VB Scripts >> Bold characters in a message boxHi there
This is a newbie question.
How can i put some characters in bold in a message box? I tried with \b
but couldn't succeed.
And how to insert a CRLF in a message box?
Thanks for your help
Phil
- 11
- 12
- MFC >> CRichEdit Control -Vertical Allignment(Visio Type)Hai,
Iam looking to insert text in RichEdit Control so that it is
centered/left/right vertically and by default VC++,CRichEdit supports
Horizantal allilgnment and i would like to do similar to Visio if we drag a
box and enter the text and we have both options(Horizantal/Vertical) to set
the text in the box and any expert comments would be helpful
Thanks and Regards
suresh
- 13
- Visual Basic [VB] >> Where is array data kept?With regard to a declaration like:
> Dim myIntArray As Integer = new Integer(6)
Jesse Liberty, in _Programming Visual Basic .NET, 2nd Edition_
(O'Reilly) says:
>While VB.NET arrays are reference types, created on the heap, the
>elements of an array are allocated based on their type. Thus,
>myIntArray is a reference type allocated on the heap, and the integer
>elements in myIntArray are value types, allocated on the stack. (While
>you can box a value type so that it can be treated like a reference
>type, as explained in Chapter 6, it is not necessary or desirable to
>box the integers in an array.) By contrast, an array that contains
>reference types, such as Employee or Button, will contain nothing but
>references to the elements, which are themselves created on the heap.
Question:
Is that true? And if so, what happens when you return and the stack
gets popped, while a reference to the array created on the heap may
still exist somewhere?
- 14
- MFC >> Update dynamically appended MDI menuI am trying to dynamically append a menu to MDI Doc/View's menu.
Everything is ok except that the menu doesn't get refreshed till I
move/minimize (etc.) the main App's window. Kindly suggest as to how to
make it visible as soon as the child window gets visible.
Seems AfxGetApp()->m_pMainWnd->UpdateWindow(); isn't working either
:o(
CMenu *pMainMenu = AfxGetApp()->m_pMainWnd->GetMenu();
// Assuming that we have a qualified CMenu object pointer
// called 'pChildMenu', let's append it to the main menu:
pMainMenu->AppendMenu(MF_STRING|MF_POPUP , (int)pChildMenu->m_hMenu,
"Options");
// Update the app's main window:
AfxGetApp()->m_pMainWnd->UpdateWindow(); // this DOESN'T seem to work!
warm regards,
D. Rathore
(remove all underscores for email ID)
- 15
|
|
|