|
Hi,
Not sure if this is the right forum for this question but I didn't see a networking stuff forum...
Is there an api/method for getting the signal strength of a wireless connection (802.11b/g) programatically. Windows XP is able to display the wireless signal strength when you bring up the status dialog of a wireless network connection, I would like to do something similar in my app.
This will probably be impossible in Win2k and below since third party applications managed the wireless connections, but in windows XP it should be possible.
Does anyone have any ideas?
Thanks Tom.
|
|
|
|
|
Hi,
Here is my idea, If that wireless modem is connected to u r serial port, then u must issue some command to that port using FILE IO APIs,so that modem will respond to u r command.For command set u must refer that that modem specs.
If that is inbuilt modem then i hope there must some APIs,i am not sure about this case.
PSN
|
|
|
|
|
A wireless (802.11b/g) interface adapter would never be connected to a serial port because rs232 transfer is way too slow... Regardless of whether it is a PCMCIA, PCI or USB 802.11b/g adapter windows will display it as a Network Connection.
Win XP is able to monitor signal strength through its Network Connections sub system, this is something that Win2K and below could not do...
This is why I am wondering if there is any way to tap into this functionality programatically?
Thnx Tom.
|
|
|
|
|
Check out the Windows XP Device Driver Interface.
There should be stuff about how to Access a Wireless Network card's Hardware Interface something like a DeviceIoControl function.
http://www.microsoft.com/whdc/device/network/wireless/default.mspx[^]
This is the Link on Microsoft Driver Website if that Helps.
-Ve
-of All the things I lost, I miss my mind the most...
|
|
|
|
|
Looking for a few good tut's on making screensavers..found the old jonny castaway screensaver and would like to make one similar to it. Will be using microsoft visual studio 6, c++ or VB. Any help would be appreciated......Thanks
|
|
|
|
|
Here is one:
http://www.codeproject.com/cpp/smoovcpscreensaver.asp
Nigel Thompson created another but I was unable to find it.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello, I had posted a question yesterday with no responses.. I figured I would give it one more shot..
I found a article on another site that talked about my problem.. here is a little blurb from the article...
If the terminating socket has been closed, calling Flush on the CArchive will raise an exception (so will calling Close). In the previous case, before the exception is handled, CArchive goes out of scope and its destructor calls Close. Close throws another exception and all hell breaks loose. Never throw exceptions from destructors.
You will need nested try / catch blocks ... [Article^]
My problem with the exceptions is fixed but I still have a memory leak.. Any ideas why??
void CMainFrame::OnSend(CClientSocket *pSocket, CString strMsg)
{ if(*pSocket != INVALID_SOCKET)
{
try
{
sendObject(pSocket, strMsg);
}
catch (CException* pEx)
{
pEx->Delete();
}
}
}
BOOL CMainFrame::sendObject(CClientSocket *pSocket, CString strMsg)
{
BOOL bRet = TRUE;
CSocketFile sf(pSocket);
CArchive ar_send(&sf, CArchive::store);
try
{
ar_send << strMsg;
ar_send.Flush();
ar_send.Close();
sf.Close();
}
catch (CException* pEx)
{
bRet = FALSE;
pEx->Delete();
}
return bRet;
}
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Hello,
The exception thrown is probably allocated using new . Try calling <delete> on pEx and see if that solves anything...
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Why do you mean by call on pEx? If it was allocated using new shouldn't the pEx->Delete() clean it up?
Thanks for the response,
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Hello,
I see, I forgot to close a <code> tag... It should read: call delete on pEx. I've just read the documentation on CException and I read that you shouldn't call delete on the object...
You can use a memory leak detect[^] mechanism to detect the leak. There are several others here on CP
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Didn't help, it ASSERTS if you try to 'delete pEx' the ASSERT says to use pEx->Delete() and not the other... Anyway I have traced the problem down some what, the Flush() causes a exception and so does the Close().. I'm not sure how I can catch both exceptions.. I can see 2 exceptions in the debug window yet my trace shows that I am only catching one of the two.. When I put another try/catch around the Close I catch it yet an extra exception occurs (3), this is just odd.. And the memory leak is still there.. weird..
I tried using AfxIsValidAddress() for the CArchive and CSocketFile and this worked like a charm in Debug mode, Said that the address wasn't valid when the connection was lost, yet said it was valid when the connection was present.. but in Release mode it fails every time, connected or not.. ever had any experence in using AfxIsValidAddress?
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
I use AfxIsValidAddress a lot, but I never experianced any problems with it.
I see that you catch exceptions, but I don't see you use the exceptions. You only delete them. What is the exception trying to tell you?
Besides that, if you application won't run for a long time and the memory leak isn't too big, I wouldn't worry about it.
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Just to simplify the code i didn't show what i do with the exception, actually I do a ...
char szError[4096];
pEx->GetErrorMessage(szError, sizeof(szError));
TRACE("sendObject Error: %s\n", szError);
pEx->Delete();
... For testing I sometimes used a AfxMessageBox..
anyway, the memory leak is super small, and actually the application will never get that far unless the super un-natural happens, but it still bothers me that I can't figure it out so I just wanted to see if anyone had any ideas..
Thanks for all your help!
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Hello All,
It is well know that other systems in my LAN can connect to my machine by typing "\\User\d$" at the Start Menu->RUN... command and entering the password.
Q) Is there any way i could get the list of machine(Ip or Name) connected to mine. Does the sytem registry keep track of all the machines which have/are connected.
please get me some code if possible.
Regards,
Prax
|
|
|
|
|
From a command prompt you can type 'net sessions'..
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
"NET VIEW" will give you a list of machines that can access yours.
WNetEnumResource is a win32 windows networking API that will let you iterate through the same list as with the above command.
Ray
|
|
|
|
|
Try NetSessionEnum(NULL, ...) .
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hello,
I have two .exe, the main application (in mfc) and a directshow filter crossed by a video stream.
From the directshow filter code, when a certain value is detected I have to send it (to the main application) and to make start a method in the main application.
How can I realise such a thing ? Is Callback a possible solution ?
Thanks a lot for your help and have a nice day,
alain
There is no way to happiness, happiness is the way !
|
|
|
|
|
I don't believe callback is possible. Here are some high level suggestions you can research.
You can try the function FindWindow(..) to get a handle on your MFC window and then SendMessage() to send a message to this window. It's a win32 function.
Otherwise you may need to use some other method (interprocess communication). I suppose you can try network communication using sockets. Maybe send/receive on 127.0.0.1. Or I believe Windows should provide some functions to send/receive messages between processes.
There are tutorials on codeproject.
http://www.codeproject.com/threads/[^]
|
|
|
|
|
Thanks a lot for your answer.
I am triing to use the BEGIN_MESSAGE_MAP of MFC to realise what I need :
BEGIN_MESSAGE_MAP(CPatchingMPEG2Dlg, CDialog)
ON_MESSAGE(WM_USER+1, OnMyMessage)
END_MESSAGE_MAP()
I think it's the right direction, but now I get the difficult of paasing m_hwnd variable to my direcshow code. I am going to try your solution with 'FindWindow' which seems very good !
I wish you a nice day,
thanks, alain
There is no way to happiness, happiness is the way !
|
|
|
|
|
|
Hello,
I'm led to believe that one can use GetModuleHandle and GetProcAddress to get a function from another exe...
The thing you can do is export a function from your main application (the callback) and use GetProcAddress from the direct show filter code to call the callback...
Hope this helps
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Hello, thanks a lot for your answer.
I am triing to use the BEGIN_MESSAGE_MAP of MFC to realise what I need :
BEGIN_MESSAGE_MAP(CPatchingMPEG2Dlg, CDialog)
ON_MESSAGE(WM_USER+1, OnMyMessage)
END_MESSAGE_MAP()
I think it's the right direction, but now I get the difficult of passing m_hwnd variable to my direcshow code. I am going to try the solution with 'FindWindow' as suggested by Budric.
If I cannot go on with this I will try your solution.
I wish you a nice day and again thanks very much for your help !
alain
There is no way to happiness, happiness is the way !
|
|
|
|
|
Hi Friends,
I've a treectrl on a dialog based application which gets populated from
ms-access database containing some 2000 records in OnInItDialog. To fetch the
data, i am simply using the SQLFetch and inserting it using a while loop in treectrl using InsertItem, but it takes too much of time. Can anybody help me in speeding up my treectrl.
The fields in my database are "BookmarkName", "BookmarkType" where Bookmark
name is the bookmark name and BookmarkType is either "Folder" or "Bookmark" and Bookmarks are added as child in Folders.
Vikram Kashyap
"You will never fail, until u stop trying"
|
|
|
|
|
you should probably post a snippet of what your routine to insert the items into your tree control looks like. That'll make it easier for us to see where you might have any problems
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
My articles[^]
bdiamond
|
|
|
|