|
godspeed123 wrote: Now the way that it is going now I have this circular queue
Why a circular queue, and not a queue? Maybe even MSMQ[^]?
|
|
|
|
|
With a queue I thought I would over run the memory, and then cause the whole computer to crash.
|
|
|
|
|
godspeed123 wrote: With a queue I thought I would over run the memory, and then cause the whole computer to crash.
The queue does not need to store items (entirely) in the memory. Again, look at MSMQ - it stores messages in files in the MSMQ\Storage folder.
|
|
|
|
|
You may also do this,
Use queue(STL,maybe) and mark the zone you push data into the queue [queue::push(msg)] using Critical section. That works, simple.
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
Hi,
I'm writing a MFC application with callback dll functions, but it's have the problem with the callback function and mfc. I have two callback functions: OnInviteResult and OnLoginResult are called by a function in a dll. The first function OnLoginResult works fine, but OnInviteResult make the program halt when it execute the line:
pdlg->m_status.ReplaceSel("Connected\r\n");
I have debuged and seen pdlg pointer has the same address in both OnLoginResult and OnInviteResult functions.
Below is my code:
TestDLLDlg.cpp
CTestDLLDlg* pdlg;
.....
CTestDLLDlg::CTestDLLDlg(CWnd* pParent )
: CDialog(CTestDLLDlg::IDD, pParent)
{
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
pdlg = this;
}
......
void CALLBACK OnLoginResult(int *registered)
{
switch (*registered){
case 1:
pdlg->m_status.ReplaceSel("Registered\r\n");
break;
case 2:
pdlg->m_status.ReplaceSel("Invalid Username or Password\r\n");
break;
case 3:
pdlg->m_status.ReplaceSel("Service Unavaiable\r\n");
break;
}
}
void CALLBACK OnInviteResult(int *status)
{
switch (*status){
case 1:
pdlg->m_status.ReplaceSel("Ringing...\r\n");
break;
case 2:
pdlg->m_status.ReplaceSel("Connected\r\n");
break;
case 3:
pdlg->m_status.ReplaceSel("Hung up\r\n");
break;
default:
break;
}
}
int CTestDLLDlg::SetCallbackFunctions(void)
{
SetCallbackLogin(OnLoginResult);
SetCallbackInvite(OnInviteResult);
return 0;
}
Do you have any idea about this problem?
Any help would be appreciated.
DBQ.
-- modified at 17:31 Wednesday 21st March, 2007
|
|
|
|
|
Van Ly Doc Hanh wrote: but OnInviteResult make the program halt when it execute the line:
pdlg->m_status.ReplaceSel("Connected\r\n");
Which doesn't tell us a whole lot. Have you set a breakpoint on that statement and debugged into it?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I did set the break point on that statement and when I press F10 for that line, it run for a long time and my app become "Not Responding".
DBQ.
|
|
|
|
|
Van Ly Doc Hanh wrote: ...when I press F10 for that line...
I said step into, not over.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I'm sorry. I misunderstood your words.
When I hit F11, it pop up a windows:
"Finding source: afxwin2.inl"
f:\vs70builds\3077\vc\mfcatl\ship\atlmfc\include\afxwin2.inl
I tried to step into and it looks like:
Dialog changes the text in CEdit control and send message to Window but there is no control takes that message -> program waiting forever.
How can I solve this problem?
DBQ.
-- modified at 17:27 Wednesday 21st March, 2007
|
|
|
|
|
Press "Shift" + F11 rather than F11.
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
Van Ly Doc Hanh wrote: I did set the break point on that statement and when I press F10 for that line, it run for a long time and my app become "Not Responding".
Use F11 for step into and check the behavior
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hello together,
I need some help for my dialog box.
I search an entry for my message map of one dialog box. This entry shall call a function if the dialog box is completly shown on the screen.
The most entries like ON_WM_CREATE or ON_WM_ACTIVATE are called the functions before the dialog box is completely shown on the screen.
Kind regards
GruenerSchreibtisch
|
|
|
|
|
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I am trying to allow a cold fusion app to use a dll. I do not know cold fusion but they say that they use a tag to grab the dll and send it a parameter. It does not call an API function in the dll but rather calls the dll with a parameter. If i create a win 32 dll , can i just put my code in here:
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
Oh maybe not cause this returns bool.
I think it has to be a dll with a "main" section. Any input?
|
|
|
|
|
Hi friends,
I'm trying to forward a TCP/IP port (can be described dynamic) to MySQL port (3306).
Although i've written an MFC project using CASyncSocket to solve this problem. It works with Client/Server text communication based programs but it cannot fwd MySQL requests.
-Let me tell what i did:
1.Listen a port
2.Accept incoming connection (this is the incoming socket)
(for this accepted socket)
I.If receive any data Read max 100 byte packet
II. Add this packet to an array (vector)
III. A thread (consumer thread) checks this array's size
-if there's any packet sends it to 3306 by another CAsyncSocket
object (this is the outgoing socket)
IV. Same process for incoming data from 3306 to accepted socket
i wrote another Client/Server application which only acceps incoming requests and read their messages and echo it to themselves. This is a text based communication.
Result:
forwarder can't forward the data between app and MySQL host
i think main goal is binary data!
how can i do this
Could anyone help me?
Thanks lot,
|
|
|
|
|
I'm lost. Which part isn't working?
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
-in project: every time i Receive static sized byte array from incoming socket
then send it to server (with the length of received size)
it only works with text based communication like chat
but mysql send binary data (and uses its' own protocol)
may be..., could you tell about the logical analyse or steps (like overflow diagram) about how to forward an incoming TCP/IP connection to another host:Port
like Proxy's but independent from connection protocol (like physical bridges used to separate sub networks)
thanx a lot for your reply
Note: i must go out coz it's late
|
|
|
|
|
What about data coming FROM the server to the client? Are you relaying all that data too?
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Yes, i do reply, when i receive any message from one of them i put it into related queue then forward it
i don't know much about MySQL server communication protocol may it be related with this?
i only want to send all packages from one gate to another gate (and reverse) that's all
|
|
|
|
|
I see you've closed the project but if you were looking at "messages" as they passed through
then you'd need to know everything about the message protocol. Otherwise every byte should
be passed through untouched.
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
We've closed this project coz it's much complex for a single project's single leaf
we've agreed to use a PROXY server to solve this problem
|
|
|
|
|
I've created a static global variable, "static int m_foo", in stdafx.h in my MFC project.
Then I change the value of m_foo in the FooMainFrm.cpp file.
Whenever I query m_foo, in any of the other modules, I find its state reinitialized to zero.
Using the "extern" keyword at the top of each of the modules doesn't help.
What's going on here?
|
|
|
|
|
werpa wrote: Using the "extern" keyword at the top of each of the modules doesn't help
did put the extern keyword on every cpp files that use it, or all but one ?
anyway, global variables don't need to be static AFAIK.
and at last, why going global ? can't you incorporate your variable as a class member (public static if you like) ?
|
|
|
|
|
I put "extern" in the modules that used the varialbes. I didn't put it in the ones that didn't use the variable. I am incorporating the variable into a class where it doesn't precisely fit in order to have its global and static reach.
|
|
|
|
|
werpa wrote: I am incorporating the variable into a class where it doesn't precisely fit in order to have its global and static reach.
Sounds like it might belong in your CWinApp -derived class.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|