|
now I have succefully enumed hosts of my LAN by sending ARP request.
but this require to install Ourself protocol driver to send ARP requests(SendARP does not fit).
It worked very good.
|
|
|
|
|
my demo code is here(using WNet). it can not enume hosts:
#include "../common/initsock.h"
//#include "Ws2tcpip.h"
#include <ws2spi.h>
#include <winnetwk.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
CInitSock theSock; // to call WSAStartup function
using namespace std;
#include "Iphlpapi.h"
#pragma comment(lib, "Iphlpapi.lib")
#pragma comment(lib, "Mpr.lib")
BOOL EnumRes();
void main()
{
EnumRes();
}
BOOL EnumRes()
{
HANDLE hEnum;
DWORD dw = ::WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_ANY, 0, NULL, &hEnum);
if(dw != NO_ERROR)
{
printf(" OpenEnum failed \n");
}
DWORD cCount = -1;
u_char lpBuffer[1024*16];
DWORD cBufferSize = 1024*16;
do
{
dw = ::WNetEnumResource(hEnum, &cCount, lpBuffer, &cBufferSize);
NETRESOURCE *pRes = (NETRESOURCE *)lpBuffer;
if(dw == NO_ERROR)
{
for(int i=0; i
|
|
|
|
|
yanping wang wrote:
it can not enume hosts:
Why? Are you getting a runtime error? If so, what?
yanping wang wrote:
if(pRes[i].dwUsage == RESOURCEUSAGE_CONTAINER)
You may want to change this to:
if ((pRes[i].dwUsage & RESOURCEUSAGE_CONTAINER) == RESOURCEUSAGE_CONTAINER)
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
thank you.
the change you made is right. thank you very much
|
|
|
|
|
Hi,I create a MFC externsion DLL .and I add a class to my project (based CDialog named CBmpDlg)
change the class to AFX_CLASS_EXT....
BUILDING ........ok
copy the lib and dll and .h files to my project (based CDialog)
setting->link input my lib file name
change the class to base CBmpDlg;
buiding ........ok
but when I run the programe,error!!!
see the picture (one is debug two is release)
http://www.vchelp.net/cndevforum/subject_view.asp?subject_id=148807&forum_id=59[^]
THANK YOU!
|
|
|
|
|
chinakknd wrote:
see the picture (one is debug two is release)
Sorry, we cannot see the picture.
suhredayan There is no spoon.
|
|
|
|
|
NOW YOU CAN SEE THE PICTURE
|
|
|
|
|
|
I'm trying to develop an add-in for Outlook Express, the add-in is supposed to intercept sending mails and (optionally) add attachments to the mail being sent.
I have already done that on Microsoft Outlook using Visual Studio Tools for Office, but I couldn't find any way to do it on Outlook Express.
Help would be greatly appreciated, just point me on the way.
Thanks in advance,
Wessam Fathi
Wessam Fathi
|
|
|
|
|
Microsoft dosen't provide any documentation to do this. However keep a watch over msdn [^]. Hope they come with additional interfaces soon.
Note: I'm not trying to say your requirment is not possible.
suhredayan There is no spoon.
|
|
|
|
|
I fixed my earlier problem and found a new one that is easely fixed, but I don't like the fix. It would force useres (of the templates) to code in a way that seems unnatural.
typedef classB<classA<char>> classB_type;
typedef classA<char> classA_type;
typedef classB<classA_type> classB_type;
Why does the first version generate errors?
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
|
:-DThanks! I had forgot about that.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
John R. Shaw wrote:
Why does the first version generate errors?
Hmm... that's exactly the problem (and solution) I mentioned here
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
:-DSorry wrong!
I remmebered your stab at a solution for the previous problem; which is what I was refering to, when I said I forgot. But that was a totaly different problem, with a totaly different solution.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
John R. Shaw wrote:
Sorry wrong!
I remmebered your stab at a solution for the previous problem; which is what I was refering to, when I said I forgot. But that was a totaly different problem, with a totaly different solution.
Hey, no big deal anyway, but...
In this thread you presented a problem. All I said was that the problem you presented in this thread, is exactly the same one *I* mentioned in your other thread (even the same type names), and about which I offered an explanation and a solution. That's all
I wasn't saying that this problem, was the same one you had before.
John R. Shaw wrote:
But that was a totaly different problem, with a totaly different solution.
So, you found the solution? What was it?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Jose Lamas Rios wrote:
So, you found the solution? What was it?
:-DSimple, I hit undo in the three different files involved, until it worked again. Then made the changes again with the final goal in mind.
Originaly the template compiled with out error, but it needed to be able to use a dirived class from a template that it depened on. Hince, I needed to make first template class and argument to the second template class. There was actualy a third template class that used the first two classes, so I don't know which one caused the complier to generate invalid code.
I hate not knowing, that's why I posted the original question. But when you're dealing with templates, inexact error messages can be very difficult to figure out.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hi everyone.
I have a problem concerning the synchronization of the audio and video stream in my directshow filter graph.
I've coded an mpeg-ts demux, which timestamps the media samples, but the data stream has many data errors and so, when there is an error the video pauses for a short while and you can see all these nice mpeg blocks, but the audio continues without interruption.
That causes a slight delay between audio and video after some error have occured.
What can I do to prevent this?
Thanks for advice,
Alex
Don't try it, just do it!
|
|
|
|
|
Hi Alexander!
I wrote a mpeg-ts demux filter.The source is DVB-s,so there is little error in the data stream.But I encounter a problem:the filter can render more than one audio streams,and render one video and one audio ES,but it can't render more than one video ES.when i connect two video out put pin to the decoder and run the gragh,there is a deadlock happens.
I dont know whether you encoutered this problem,I sincerely wait your advice.
Thank you very much!
Please dont laugh at my poor english ,I am a Chinese student
stephen young
|
|
|
|
|
i had this code in C++ and i hav converted it in VC++(MFC application)but there is some problem if any1 cn help me to sort out that problem.
In this program i hav made 3 classes
Class ineuron which is used for the input neurons
Class oneuron, used for the output neurons
Class network is created with 4 input neurons. these 4 neurons are all conected with 1 output neuron.class network has these public members
ineuron nrn[4];
oneuron onrn;
network( float a, float b, float c,float d)
{
nrn[0] = ineuron(a);
nrn[1] = ineuron(b);
nrn[2] = ineuron(c);
nrn[3] = ineuron(d);
onrn = oneuron();
...........}
i hav a problem in coverting this specific class in VC++(MFC Application)
It gives error in "=" sign.can any1 help.
|
|
|
|
|
can you provide complete error message.
|
|
|
|
|
Do the classes oneuron and ineuron have an operator = members?
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Hello,
If network is your constructor, you can try the following:
network::network(float a, float b, float c, float d)
: nrn[0](a),
nrn[1](b),
nrn[2](c),
nrn[3](d)
{
}
This is called a construcor member initializer list. See here[^] and here[^] for more information.
This probably doesn't solve your problem, but I can't solve it since I don't know the exact problem. This "workaround" is better than solving your "operator=" problem..
Hope this helps
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
anyone here who can help me with creating a graphic editor. a design i can use to create my traveling salesman problem using genetic algorithm. a student here so im really needing your help. how i can boost my design and make it very classy. thanx a lot in advance!
marksanz
|
|
|
|
|
Hi,
After reading Michael Dunn's article on adding pages to control panel applates and after reviewing his code,based on michael's code I have tried add a page to the power manger, I changed the DllRegisterServer function
so it will register the propsheetext under the power manager (at least as microsoft publishes in the msdn) but still it does not work,
what am I missing?, is the registry key published in msdn is the currect one?
(it works when I am registering it for the Display property page)
any help will be appreciated.
STDAPI DllRegisterServer(void)
{
bool bNT = ( 0 == (GetVersion() & 0x80000000) );
CRegKey reg;
LONG lRet;
// Add ourself to the approved extensions list on NT.
if ( bNT )
{
lRet = reg.Open ( HKEY_LOCAL_MACHINE,
_T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved"),
KEY_SET_VALUE );
if ( ERROR_SUCCESS != lRet )
return HRESULT_FROM_WIN32(lRet);
lRet = reg.SetValue ( _T("Display CPL Extension"),
_T("{2F5AC606-70CF-461C-BFE1-6063670C3484}") );
if ( ERROR_SUCCESS != lRet )
return HRESULT_FROM_WIN32(lRet);
reg.Close();
}
// Add a key to have our extension loaded by the Display applet. Unfortunately
// the key is different between 9x and 2000, so it has to be done in code.
// I haven't tested this on NT 4 yet (don't have a system handy) so I don't
// know the right key to use on NT 4. For now I'll use the same key as on 2K.
TCHAR szKey [512];
wsprintf ( szKey, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Controls Folder\\PowerCfg\\shellex\\PropertySheetHandlers\\TestDisplayPage"));
lRet = reg.Create ( HKEY_LOCAL_MACHINE, szKey, REG_NONE, REG_OPTION_NON_VOLATILE,
KEY_SET_VALUE );
if ( ERROR_SUCCESS != lRet )
return HRESULT_FROM_WIN32(lRet);
lRet = reg.SetValue ( _T("{2F5AC606-70CF-461C-BFE1-6063670C3484}") );
if ( ERROR_SUCCESS != lRet )
return HRESULT_FROM_WIN32(lRet);
// registers object, typelib and all interfaces in typelib
return _Module.RegisterServer(TRUE);
}
|
|
|
|