|
Hi,
I am doing a dialog based app USING MFC.
I need to interact with the front end using Flash.
Can anybody help me in this regard?
The flow of app is .....
Create a Dialog based app
Insert a Flash based control.
Insert a Flash control "buton".
Pls help me in communicating with these two.
Regards
|
|
|
|
|
How can you tell if a CWnd object is displayed or not. I can never figure this one out.
If you initilise the object but not displayed as a window what function can I call to test it?
---
|
|
|
|
|
May be it's need to check WS_VISIBLE style flag, true or false, setted or not ?
|
|
|
|
|
BOOL CWnd::IsWindowVisible();
Maxwell Chen
|
|
|
|
|
Thanks, that was rather stupid of me
---
|
|
|
|
|
Where can I get/download DBG files for MS VS 7, C++
I need exact link/URL.
Now i'm walking on www.microsoft.com and while i have no results
Thanks a lot in advance !!!
|
|
|
|
|
|
COOL!!! MEGA THANKS !!!
Thanks a lot again many times !
Navigation of MS site very hard for me (
|
|
|
|
|
Is there any way to know that a time has been set.
For example SetTimer(id, elapsed minutes ....)
Can I know whether the time with this id has been set or not?
|
|
|
|
|
I also never got this answer, but i tried the following code
m_set = 0;
SetTimer(....)
if(m_set==0) //dont start it again...
else
settimert
m_set=1;
If your ever get good answer , plz do let me know
regards
Balkrishna
|
|
|
|
|
Hi !
I have a question which might look silly about std namespace :
I thought that when using the new C++ headers of the includes (without the ending .h), I had to put a std:: in front of each keyword (or put 'using namespace std' at the begining of my code).
In the exemple below, it works how I was expecting with the vector class, but it doesn't work with the cmath include. I get a compile error that std is not a namespace. If I take out the 'std::' in front of abs, it works, but why ? What am I missing there ?
#include <cmath>
#include <vector>
int main (void)
{
std::vector<int> MyVect;
int a=-5;
int b=std::abs(a);
return 0;
}
Thanks for your help !
Jerome
|
|
|
|
|
#include <iostream>
#include <vector>
#include <cmath>
int main (void)
{
std::vector<int> MyVect;
int a= -5;
int b= abs(a);
return 0;
}
<b>Maxwell Chen</b>
|
|
|
|
|
Hi !
I just realised my previous message was wrong, the '<' disappeared !
What I'd like to know is why abs is not in the std namespace ?
Jerome
|
|
|
|
|
If my understanding is correct, namespace std wraps those standard classes of the Standard C++ Library (for example, iostream, string, list, map, etc.)
Function abs(...), and all the rest functions like printf(...), are inherited from the C Language Runtime Library. They are of the global namespace. To invoke them, do this way...
::abs(nMyValue);
which means abs(...) belongs to the global namespace.
Maxwell Chen
|
|
|
|
|
At a guess, you're still using Visual C++ 6.0. VC 6's supplied library did not do the <cxxx> headers properly: while they included the old functions, they didn't put them in the std namespace.
By my reading, this was fixed in VS.NET 2002.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Exactly, I'm still using VC 6 !
Thanks for your answer !
Jerome
|
|
|
|
|
Hi All.
I need help related to files. I have a binary file...let say abc.bin. If i open this file with notepad, the content is something like as follows...
5b 7a 82 43 2c 03 b0 12 02 a6 0c 93 03 24 b0 12
24 a0 02 3c b0 12 0e a1 92 43 2c 03 e2 93 17 12
And so on...
Now, I want to convert that file to a file that have contents as
0x5b 0x7a 0x82 0x43 0x2c 0x03 0xb0 0x12 0x02 0xa6 0x0c 0x93 0x03 0x24 0xb0 0x12
0x24 0xa0 0x02 0x3c 0xb0 0x12 0x0e 0xa1 0x92 0x43 0x2c 0x03 0xe2 0x93 0x17 0x12
And so on...
I am trying to use CFile to open and then modifying it, but not able to do.
If anyone can suggest anything that can resolve my issue, it will be really great for me.
Thanks and Regards,
Pankaj Bhalla
pankajbhalla@mantraonline.com
|
|
|
|
|
You mean you want to read in each line, and for each hex value, prefix it with '0x'. You'll need to read from one file, write to another, and then delete the original, and rename your output file. Doing this in place is awkward because you are changing the size of the file.
Hope that helps a bit.
Steve S
|
|
|
|
|
why using 2 different files ?
we can add bytes into a file without overwrite it. an we can move into the file stream...
TOXCCT >>> GEII power
|
|
|
|
|
Using what functions? Anyway, even if those functions existed, the excessive IO to support such a function would vastly dwarf the extra code to create a new file and rename it.
Also, there are other issues involved. What if the program failed halfway through. Now you have a partially converted file which is totally worthless. This is a major concern for real life applications. Either the operation completes successfully or it fails without damaging the original.
BTW, we are converting 1 binary bytes to 10 ASCII bytes. We are doing a lot more than just inserting two characters.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
I'm developing a client server application using MFC. My server should be able to accept multiple connection from clients (50 clients). I have a problem when I connect two clients, either one of the client will be disconnected. What is the cause of the problem. I'm really stuck and need help on solving the problem.
Here is my server code that accept client connection:
UINT thread(LPVOID p)
{
char recv_msg[3];
CSize size;
size.cx=0;
size.cy=30;
int s,loop,flag=0;
int msgcount;
CVCBUILD2000Dlg *dlg=(CVCBUILD2000Dlg*)AfxGetApp()->GetMainWnd();
msgcount=dlg->getcount();
msgcount = 1;
if (msgcount==-1)
loop=0;
if(loop)
{
dlg->msgsock[msgcount]=accept(dlg->sock,(sockaddr*)&(dlg->serv),&(dlg->addlen));
s=1;
AfxBeginThread(thread,0);
dlg->SetForegroundWindow();
dlg->m_list.InsertItem(dlg->count++,"Connected");
dlg->m_list.InsertItem(dlg->count++,inet_ntoa(dlg->serv.sin_addr));
dlg->m_list.Scroll(size);
dlg->m_button.EnableWindow(TRUE);
//while ERROR_SOCKET not true
while (s!=-1)
{
//get the input from connected PDA
s=recv(dlg->msgsock[msgcount],recv_msg,5,0);
dlg->m_Status.SetWindowText("");
dlg->ChkInput(recv_msg[0], recv_msg[1]);
if (recv_msg[0] == 'F')
{
s = -1;
}
dlg->SetForegroundWindow();
dlg->m_list.Scroll(size);
}
dlg->msgsock[msgcount]=NULL;
for (int i=0;i<3;i++)
if (dlg->msgsock[i]!=NULL)
flag=1;
if (flag != 1)
{
dlg->m_button.EnableWindow(FALSE);
//this calls the function ClearWindow
//pass 1 param (msgsock)
dlg->ClearWindow(msgcount);
closesocket(dlg->msgsock[msgcount]);
dlg->m_list.InsertItem(dlg->count++,"Disconnected");
dlg->m_edit.SetWindowText("");
}
}
AfxEndThread(0);
return 0;
}
|
|
|
|
|
I really don't understand your code. I think you have major design issues to deal with. Mixing the socket handling code up with the protocol handling code with the windows handling code seems to me to be a recipe for problems. And a thread per connection is usually inefficient. Consider using either MFC sockets, straightforward sockets with Windows Messages for events, or sockets with Events you can 'WaitForMultipleEvents' on. Also reference some of the server library implementations available here. I have one of my own, but it's not documented yet. Here if you're interested.
Anyway I suspect your problem is that 'msgcount' never seems to be set in the 'dlg'. And there's clearly a bug here,
msgcount=dlg->getcount();
msgcount = 1;
Good luck.
Paul
|
|
|
|
|
Sir,
I am developing an which maps CString as the key and maps to the class.
For that I am using this code.
in Person.h"
CPerson {
private:
int age;
public:
CPerson ();
CPerson (int a){
age = a;
}
}
And in "FileView.cpp"
CMapStringToOb map;
CPerson one ;
//one = new CPreson();
map.SetAt( "Bart", one );
This gives me an error.
Pls help me with a solution .
Regards
|
|
|
|
|
use std::map instead. Then you can do this:
myCoolMap["Bart"] = one;
I suspect the problem though is that your class needs a copy constructor and/or operator = in order for this to work.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Either use the template version of CMap (e.g. CMap<CString, LPCTSTR, CPerson*, CPerson*> ) in afxtempl.h , or derive CPerson from CObject .
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|